Skip to content

Commit 0b88bd9

Browse files
committed
Travis Sniffer
1 parent ab2e802 commit 0b88bd9

3 files changed

Lines changed: 17 additions & 23 deletions

File tree

controller/main.php

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function handle($name = '')
134134
*/
135135
private function table($name)
136136
{
137-
if($name == 'pastebin')
137+
if ($name == 'pastebin')
138138
{
139139
return $this->pastebin_table;
140140
}
@@ -158,7 +158,7 @@ private function display_pb()
158158
$snippet_id = $this->request->variable('s', 0);
159159
$submit = isset($_POST['submit']) ? true : false;
160160

161-
if(in_array($mode, array('view', 'download', 'moderate')))
161+
if (in_array($mode, array('view', 'download', 'moderate')))
162162
{
163163
// for all of these we have to check if the entry exists
164164

@@ -230,7 +230,6 @@ private function display_pb()
230230
'S_AUTH_POST' => ($auth->acl_get('u_pastebin_post')) ? true : false,
231231
));
232232

233-
234233
// Now let's decide what to do
235234
switch ($mode)
236235
{
@@ -255,7 +254,7 @@ private function display_pb()
255254
'snippet_prune_on' => max(1, min(6, $this->request->variable('pruning_months', 0))),
256255
);
257256

258-
if($this->auth->acl_get('u_pastebin_post_notlim') && $this->request->variable('pruning_months',0) == -1)
257+
if ($this->auth->acl_get('u_pastebin_post_notlim') && $this->request->variable('pruning_months',0) == -1)
259258
{
260259
//Infinite Time...
261260
$data['snippet_prunable'] = 0;
@@ -298,7 +297,7 @@ private function display_pb()
298297
$error[] = $user->lang['ERR_NO_BODY'];
299298
}
300299

301-
if(!check_form_key('pastebinform'))
300+
if (!check_form_key('pastebinform'))
302301
{
303302
$error[] = $user->lang['FORM_INVALID'];
304303
}
@@ -363,11 +362,6 @@ private function display_pb()
363362
case 'view':
364363
case 'download':
365364
case 'moderate':
366-
367-
368-
369-
370-
371365
if ($mode == 'view')
372366
{
373367
if (!$auth->acl_get('u_pastebin_view'))
@@ -504,7 +498,7 @@ private function display_pb()
504498
$redirect_append = array();
505499
}
506500
}
507-
else if($auth_edit)
501+
else if ($auth_edit)
508502
{
509503
$snippet->load_from_array(array(
510504
'snippet_prunable' => (int) $prunable,
@@ -547,7 +541,7 @@ private function display_pb()
547541
$confirm_image = '';
548542
if (!$auth->acl_get('u_pastebin_post_novc'))
549543
{
550-
if(!isset($captcha))
544+
if (!isset($captcha))
551545
{
552546
$captcha = $this->captcha_factory->get_instance($this->config['captcha_plugin']);
553547
$captcha->init($this::CONFIRM_PASTEBIN);
@@ -575,9 +569,9 @@ private function display_pb()
575569
}
576570

577571
//Allow infinite storage if it is already set and we are editing, or if the user is allowed to
578-
if((isset($data['snippet_prunable']) && !$data['snippet_prunable']) || $this->auth->acl_get('u_pastebin_post_notlim'))
572+
if ((isset($data['snippet_prunable']) && !$data['snippet_prunable']) || $this->auth->acl_get('u_pastebin_post_notlim'))
579573
{
580-
if(isset($data['snippet_prunable']))
574+
if (isset($data['snippet_prunable']))
581575
{
582576
$selected = ($data['snippet_prunable'] == 0 || $prune_month == -1) ? ' selected="selected"' : '';
583577
}
@@ -588,7 +582,7 @@ private function display_pb()
588582
$pruning_months_select .= '<option' . $selected . ' value="-1">' . $this->user->lang['INFINITE'] . '</option>';
589583
}
590584

591-
if(!isset($highlight))
585+
if (!isset($highlight))
592586
{
593587
$highlight = isset($data['snippet_highlight']) ? $data['snippet_highlight'] : 'php';
594588
}

event/base_events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function viewonline_page($event)
6161
{
6262
if ($event['on_page'][1] == 'app')
6363
{
64-
if(strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/pastebin') === 0)
64+
if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/pastebin') === 0)
6565
{
6666
$event['location'] = $this->user->lang('PASTEBIN_VIEWONLINE');
6767
$event['location_url'] = $this->helper->route('phpbbde_pastebin_main_controller');

functions/pastebin.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function load($id)
6464
$sql = 'SELECT * FROM ' . $this->pastebin_table . ' WHERE snippet_id = ' . (int) $id;
6565
$result = $this->db->sql_query($sql);
6666
$row = $this->db->sql_fetchrow($result);
67-
if($row)
67+
if ($row)
6868
{
6969
$this->data = $row;
7070
return true;
@@ -80,9 +80,9 @@ function load($id)
8080
*/
8181
function load_from_array($data)
8282
{
83-
foreach($this->data as $key => $value)
83+
foreach ($this->data as $key => $value)
8484
{
85-
if(isset($data[$key]))
85+
if (isset($data[$key]))
8686
{
8787
$this->data[$key] = $data[$key];
8888
}
@@ -94,7 +94,7 @@ function load_from_array($data)
9494
*/
9595
function submit()
9696
{
97-
if($this->data['snippet_id'])
97+
if ($this->data['snippet_id'])
9898
{
9999
// Update
100100
$sql = 'UPDATE ' . $this->pastebin_table . ' SET ' . $this->db->sql_build_array('UPDATE', $this->data) . ' WHERE snippet_id = ' . (int) $this->data['snippet_id'];
@@ -132,7 +132,7 @@ function offsetExists($offset)
132132

133133
function offsetGet($offset)
134134
{
135-
if(!isset($this->data[$offset]))
135+
if (!isset($this->data[$offset]))
136136
{
137137
throw new \Exception('Invalid offset');
138138
}
@@ -141,7 +141,7 @@ function offsetGet($offset)
141141

142142
function offsetSet($offset, $value)
143143
{
144-
if(!isset($this->data[$offset]))
144+
if (!isset($this->data[$offset]))
145145
{
146146
throw new \Exception('Invalid offset');
147147
}
@@ -153,4 +153,4 @@ function offsetUnset($offset)
153153
{
154154

155155
}
156-
}
156+
}

0 commit comments

Comments
 (0)