Passed
Branch master (dd6e46)
by Michael
03:32
created
class/Digest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         global $myts;
68 68
 
69 69
         $clean = stripslashes($text);
70
-        $clean =& $myts->displayTarea($clean, 1, 0, 1);
70
+        $clean = & $myts->displayTarea($clean, 1, 0, 1);
71 71
         $clean = strip_tags($clean);
72 72
         $clean = htmlspecialchars($clean, ENT_QUOTES);
73 73
 
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
             $linebreak = $isHtml ? '<br>' : "\n";
88 88
             for ($i = 0; $i < $digest_count; ++$i) {
89 89
                 if ($isHtml) {
90
-                    $content .= ($i + 1) . '. <a href=' . $this->items[$i]['link'] . '>' . $this->items[$i]['title'] . '</a>';
90
+                    $content .= ($i + 1).'. <a href='.$this->items[$i]['link'].'>'.$this->items[$i]['title'].'</a>';
91 91
                 } else {
92
-                    $content .= ($i + 1) . '. ' . $this->items[$i]['title'] . $linebreak . $this->items[$i]['link'];
92
+                    $content .= ($i + 1).'. '.$this->items[$i]['title'].$linebreak.$this->items[$i]['link'];
93 93
                 }
94 94
 
95
-                $content .= $linebreak . $this->items[$i]['author'];
95
+                $content .= $linebreak.$this->items[$i]['author'];
96 96
                 if ($isSummary) {
97
-                    $content .= $linebreak . $this->items[$i]['summary'];
97
+                    $content .= $linebreak.$this->items[$i]['summary'];
98 98
                 }
99
-                $content .= $linebreak . $linebreak;
99
+                $content .= $linebreak.$linebreak;
100 100
             }
101 101
         }
102 102
         $this->setVar('digest_content', $content);
Please login to merge, or discard this patch.
class/Utility.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function addField($field, $table)
66 66
     {
67 67
         global $xoopsDB;
68
-        $result = $xoopsDB->queryF('ALTER TABLE ' . $table . " ADD $field");
68
+        $result = $xoopsDB->queryF('ALTER TABLE '.$table." ADD $field");
69 69
 
70 70
         return $result;
71 71
     }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             if (!@mkdir($folder) && !is_dir($folder)) {
84 84
                 throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder));
85 85
             } else {
86
-                file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
86
+                file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>');
87 87
             }
88 88
         } catch (\Exception $e) {
89 89
             echo 'Caught exception: ', $e->getMessage(), "\n", '<br>';
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             return;
99 99
         }
100 100
         // for 2.5 systems, clear everything
101
-        require_once XOOPS_ROOT_PATH . '/modules/system/class/maintenance.php';
101
+        require_once XOOPS_ROOT_PATH.'/modules/system/class/maintenance.php';
102 102
         $maintenance = new \SystemMaintenance();
103 103
         $cacheList   = [
104 104
             3, // xoops_cache
Please login to merge, or discard this patch.
class/ReadHandler.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     public function __construct(\XoopsDatabase $db, $type)
93 93
     {
94 94
         $type = ('forum' === $type) ? 'forum' : 'topic';
95
-        parent::__construct($db, 'newbb_reads_' . $type, Read::class . $type, 'read_id', 'post_id');
95
+        parent::__construct($db, 'newbb_reads_'.$type, Read::class.$type, 'read_id', 'post_id');
96 96
         $this->type  = $type;
97 97
         $newbbConfig = newbbLoadConfig();
98 98
         // irmtfan if read_expire = 0 dont clean
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             return false;
114 114
         }
115 115
 
116
-        $sql = 'DELETE bb FROM ' . $this->table . ' AS bb' . ' LEFT JOIN ' . $this->table . ' AS aa ON bb.read_item = aa.read_item ' . ' WHERE aa.post_id > bb.post_id';
116
+        $sql = 'DELETE bb FROM '.$this->table.' AS bb'.' LEFT JOIN '.$this->table.' AS aa ON bb.read_item = aa.read_item '.' WHERE aa.post_id > bb.post_id';
117 117
         if (!$result = $this->db->queryF($sql)) {
118 118
             //xoops_error($this->db->error());
119 119
             return false;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         }
125 125
         // irmtfan move here and rephrase
126 126
         $expire = time() - (int)$this->lifetime;
127
-        $sql    = 'DELETE FROM ' . $this->table . ' WHERE read_time < ' . $expire;
127
+        $sql    = 'DELETE FROM '.$this->table.' WHERE read_time < '.$expire;
128 128
         if (!$result = $this->db->queryF($sql)) {
129 129
             //xoops_error($this->db->error());
130 130
             return false;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                 return false;
181 181
             }
182 182
         }
183
-        $sql = 'SELECT post_id ' . ' FROM ' . $this->table . ' WHERE read_item = ' . (int)$read_item . '     AND uid = ' . (int)$uid;
183
+        $sql = 'SELECT post_id '.' FROM '.$this->table.' WHERE read_item = '.(int)$read_item.'     AND uid = '.(int)$uid;
184 184
         if (!$result = $this->db->queryF($sql, 1)) {
185 185
             return null;
186 186
         }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
             }
236 236
         }
237 237
 
238
-        $sql = 'UPDATE ' . $this->table . ' SET post_id = ' . (int)$post_id . ',' . '     read_time =' . time() . ' WHERE read_item = ' . (int)$read_item . '     AND uid = ' . (int)$uid;
238
+        $sql = 'UPDATE '.$this->table.' SET post_id = '.(int)$post_id.','.'     read_time ='.time().' WHERE read_item = '.(int)$read_item.'     AND uid = '.(int)$uid;
239 239
         if ($this->db->queryF($sql) && $this->db->getAffectedRows()) {
240 240
             return true;
241 241
         }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         }
308 308
 
309 309
         $criteria = new \CriteriaCompo(new \Criteria('uid', $uid));
310
-        $criteria->add(new \Criteria('read_item', '(' . implode(', ', array_map('intval', array_keys($items))) . ')', 'IN'));
310
+        $criteria->add(new \Criteria('read_item', '('.implode(', ', array_map('intval', array_keys($items))).')', 'IN'));
311 311
         $itemsObject = $this->getAll($criteria, ['read_item', 'post_id']);
312 312
 
313 313
         $items_list = [];
@@ -339,43 +339,43 @@  discard block
 block discarded – undo
339 339
         $sql = "SET sql_mode=(SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''))";
340 340
         $this->db->queryF($sql);
341 341
 
342
-        $sql = 'CREATE TABLE ' . $this->table . '_duplicate LIKE ' . $this->table . '; ';
342
+        $sql = 'CREATE TABLE '.$this->table.'_duplicate LIKE '.$this->table.'; ';
343 343
         if (!$result = $this->db->queryF($sql)) {
344
-            xoops_error($this->db->error() . '<br>' . $sql);
344
+            xoops_error($this->db->error().'<br>'.$sql);
345 345
 
346 346
             return false;
347 347
         }
348
-        $sql = 'INSERT ' . $this->table . '_duplicate SELECT * FROM ' . $this->table . ' GROUP BY read_item, uid; ';
348
+        $sql = 'INSERT '.$this->table.'_duplicate SELECT * FROM '.$this->table.' GROUP BY read_item, uid; ';
349 349
         if (!$result = $this->db->queryF($sql)) {
350
-            xoops_error($this->db->error() . '<br>' . $sql);
350
+            xoops_error($this->db->error().'<br>'.$sql);
351 351
 
352 352
             return false;
353 353
         }
354
-        $sql = 'RENAME TABLE ' . $this->table . ' TO ' . $this->table . '_with_duplicate; ';
354
+        $sql = 'RENAME TABLE '.$this->table.' TO '.$this->table.'_with_duplicate; ';
355 355
         if (!$result = $this->db->queryF($sql)) {
356
-            xoops_error($this->db->error() . '<br>' . $sql);
356
+            xoops_error($this->db->error().'<br>'.$sql);
357 357
 
358 358
             return false;
359 359
         }
360
-        $sql = 'RENAME TABLE ' . $this->table . '_duplicate TO ' . $this->table . '; ';
360
+        $sql = 'RENAME TABLE '.$this->table.'_duplicate TO '.$this->table.'; ';
361 361
         if (!$result = $this->db->queryF($sql)) {
362
-            xoops_error($this->db->error() . '<br>' . $sql);
362
+            xoops_error($this->db->error().'<br>'.$sql);
363 363
 
364 364
             return false;
365 365
         }
366
-        $sql    = 'SHOW INDEX FROM ' . $this->table . " WHERE KEY_NAME = 'read_item_uid'";
366
+        $sql    = 'SHOW INDEX FROM '.$this->table." WHERE KEY_NAME = 'read_item_uid'";
367 367
         $result = $this->db->queryF($sql);
368 368
         if (empty($result)) {
369
-            $sql .= 'ALTER TABLE ' . $this->table . ' ADD INDEX read_item_uid ( read_item, uid ); ';
369
+            $sql .= 'ALTER TABLE '.$this->table.' ADD INDEX read_item_uid ( read_item, uid ); ';
370 370
             if (!$result = $this->db->queryF($sql)) {
371
-                xoops_error($this->db->error() . '<br>' . $sql);
371
+                xoops_error($this->db->error().'<br>'.$sql);
372 372
 
373 373
                 return false;
374 374
             }
375 375
         }
376
-        $sql = 'DROP TABLE ' . $this->table . '_with_duplicate; ';
376
+        $sql = 'DROP TABLE '.$this->table.'_with_duplicate; ';
377 377
         if (!$result = $this->db->queryF($sql)) {
378
-            xoops_error($this->db->error() . '<br>' . $sql);
378
+            xoops_error($this->db->error().'<br>'.$sql);
379 379
 
380 380
             return false;
381 381
         }
Please login to merge, or discard this patch.
class/Xmlrss.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         if (count($this->items) < $this->max_items) {
87 87
             if (!empty($label)) {
88
-                $label = '[' . $this->cleanup($label) . ']';
88
+                $label = '['.$this->cleanup($label).']';
89 89
             }
90 90
             if (!empty($description)) {
91 91
                 $description = $this->cleanup($description, $this->max_item_description);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 //$description = $label;
95 95
             }
96 96
 
97
-            $title         = $this->cleanup($title) . ' ' . $label;
97
+            $title         = $this->cleanup($title).' '.$label;
98 98
             $pubdate       = $this->cleanup($pubdate);
99 99
             $this->items[] = [
100 100
                 'title'       => $title,
Please login to merge, or discard this patch.
class/Tree.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
         }
94 94
 
95 95
         $newPostArray = [];
96
-        $prefix       .= $this->increment;
96
+        $prefix .= $this->increment;
97 97
         foreach ($this->postArray as $post) {
98 98
             if ($post->getVar('pid') == $pid) {
99 99
                 $postTree_array[] = [
Please login to merge, or discard this patch.
class/ModerateHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,16 +112,16 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $ips = [];
114 114
         if ($isUid) {
115
-            $criteria = 'uid =' . (int)$item;
115
+            $criteria = 'uid ='.(int)$item;
116 116
         } else {
117 117
             $ip_segs = explode('.', $item);
118 118
             $segs    = min(count($ip_segs), 4);
119 119
             for ($i = 1; $i <= $segs; ++$i) {
120 120
                 $ips[] = $this->db->quoteString(implode('.', array_slice($ip_segs, 0, $i)));
121 121
             }
122
-            $criteria = 'ip IN(' . implode(',', $ips) . ')';
122
+            $criteria = 'ip IN('.implode(',', $ips).')';
123 123
         }
124
-        $sql = 'SELECT MAX(mod_end) AS expire FROM ' . $this->db->prefix('newbb_moderates') . ' WHERE ' . $criteria;
124
+        $sql = 'SELECT MAX(mod_end) AS expire FROM '.$this->db->prefix('newbb_moderates').' WHERE '.$criteria;
125 125
         if (!$result = $this->db->query($sql)) {
126 126
             return -1;
127 127
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function cleanOrphan($table_link = '', $field_link = '', $field_object = '') //cleanOrphan()
142 142
     {
143
-        $sql = 'DELETE FROM ' . $this->table . ' WHERE (forum_id >0 AND forum_id NOT IN ( SELECT DISTINCT forum_id FROM ' . $this->db->prefix('newbb_forums') . ') )';
143
+        $sql = 'DELETE FROM '.$this->table.' WHERE (forum_id >0 AND forum_id NOT IN ( SELECT DISTINCT forum_id FROM '.$this->db->prefix('newbb_forums').') )';
144 144
         if (!$result = $this->db->queryF($sql)) {
145 145
             //xoops_error($this->db->error());
146 146
             return false;
Please login to merge, or discard this patch.
class/ObjectTree.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                     $ret[$key]['forum_name'] = $this->tree[$key]['obj']->getVar('forum_name');
69 69
                 }
70 70
                 $ret[$key]['prefix'] = $prefix_curr;
71
-                $prefix_curr         .= $prefix_orig;
71
+                $prefix_curr .= $prefix_orig;
72 72
             }
73 73
             if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
74 74
                 foreach ($this->tree[$key]['child'] as $childkey) {
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
             $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
127 127
             trigger_error("makeSelBox() is deprecated since 2.5.9, please use makeSelectElement(), accessed from {$trace[0]['file']} line {$trace[0]['line']},");
128 128
 
129
-            $ret = '<select name=' . $name . '>';
129
+            $ret = '<select name='.$name.'>';
130 130
             if (!empty($addEmptyOption)) {
131
-                $ret .= '<option value="0">' . (is_string($EmptyOption) ? $EmptyOption : '') . '</option>';
131
+                $ret .= '<option value="0">'.(is_string($EmptyOption) ? $EmptyOption : '').'</option>';
132 132
             }
133 133
             $this->_makeSelBoxOptions('forum_name', $selected, $key, $ret, $prefix);
134 134
             $ret .= '</select>';
Please login to merge, or discard this patch.
class/Plugin/userlog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             case 'viewtopic.php':
67 67
                 /** @var Newbb\TopicHandler $topicHandler */
68 68
                 $topicHandler = Newbb\Helper::getInstance()->getHandler('Topic');
69
-                $post_id      = Request::getInt('post_id', 0);// !empty($_REQUEST["post_id"]) ? (int)($_REQUEST["post_id"]) : 0;
69
+                $post_id      = Request::getInt('post_id', 0); // !empty($_REQUEST["post_id"]) ? (int)($_REQUEST["post_id"]) : 0;
70 70
                 $move         = strtolower(Request::getString('move', '', 'GET')); // isset($_GET['move'])? strtolower($_GET['move']) : '';
71 71
                 $topic_id     = Request::getInt('topic_id', 0); // !empty($_REQUEST["topic_id"]) ? (int)($_REQUEST["topic_id"]) : 0;
72 72
                 if (!empty($post_id)) {
Please login to merge, or discard this patch.
class/plugins/plugin.tag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     /** @var TopicHandler $itemHandler */
49 49
     $itemHandler = Newbb\Helper::getInstance()->getHandler('Topic');
50 50
     /** @var \XoopsObject $itemsObject */
51
-    $itemsObject = $itemHandler->getObjects(new \Criteria('topic_id', '(' . implode(', ', $items_id) . ')', 'IN'), true);
51
+    $itemsObject = $itemHandler->getObjects(new \Criteria('topic_id', '('.implode(', ', $items_id).')', 'IN'), true);
52 52
 
53 53
     foreach (array_keys($items) as $cat_id) {
54 54
         foreach (array_keys($items[$cat_id]) as $item_id) {
Please login to merge, or discard this patch.