Completed
Pull Request — master (#314)
by Thomas
07:26
created
htdocs/lib2/edithelper.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
         $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
84 84
     } else {
85 85
         // convert smilies ...
86
-        for ($n = 0; $n < count($smiley['image']); $n ++) {
86
+        for ($n = 0; $n < count($smiley['image']); $n++) {
87 87
             $text = mb_ereg_replace(
88
-                "<img [^>]*?src=[^>]+?" . str_replace('.', '\.', $smiley['file'][$n]) . "[^>]+?>",
89
-                "[s![" . $smiley['text'][$n] . "]!s]",
88
+                "<img [^>]*?src=[^>]+?".str_replace('.', '\.', $smiley['file'][$n])."[^>]+?>",
89
+                "[s![".$smiley['text'][$n]."]!s]",
90 90
                 $text
91 91
             );
92 92
             // the [s[ ]s] is needed to protect the spaces around the smileys
@@ -118,5 +118,5 @@  discard block
 block discarded – undo
118 118
 
119 119
 function editorJsPath()
120 120
 {
121
-    return 'resource2/ocstyle/js/editor.js?ft=' . filemtime('resource2/ocstyle/js/editor.js');
121
+    return 'resource2/ocstyle/js/editor.js?ft='.filemtime('resource2/ocstyle/js/editor.js');
122 122
 }
Please login to merge, or discard this patch.
htdocs/lib2/translateAccess.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-require_once __DIR__ . '/logic/const.inc.php';
8
+require_once __DIR__.'/logic/const.inc.php';
9 9
 
10 10
 class translateAccess
11 11
 {
Please login to merge, or discard this patch.
htdocs/lib2/common.inc.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  *  TODO: accept-language des Browser auswerten
11 11
  ***************************************************************************/
12 12
 
13
-require_once __DIR__ . '/../vendor/autoload.php';
13
+require_once __DIR__.'/../vendor/autoload.php';
14 14
 
15 15
 function __autoload($class_name)
16 16
 {
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
         return;
21 21
     }
22 22
 
23
-    $file1 = $opt['rootpath'] . 'lib2/' . $class_name . '.class.php';
24
-    $file2 = $opt['rootpath'] . 'lib2/logic/' . $class_name . '.class.php';
23
+    $file1 = $opt['rootpath'].'lib2/'.$class_name.'.class.php';
24
+    $file2 = $opt['rootpath'].'lib2/logic/'.$class_name.'.class.php';
25 25
     if (file_exists($file1)) {
26 26
         require_once $file1;
27 27
     } elseif (file_exists($file2)) {
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 mb_regex_encoding('UTF-8');
44 44
 
45 45
 // set options
46
-require_once $opt['rootpath'] . 'config2/settings-dist.inc.php';
47
-require_once $opt['rootpath'] . 'config2/settings.inc.php';
48
-require_once $opt['rootpath'] . 'config2/verify-settings.inc.php';
46
+require_once $opt['rootpath'].'config2/settings-dist.inc.php';
47
+require_once $opt['rootpath'].'config2/settings.inc.php';
48
+require_once $opt['rootpath'].'config2/verify-settings.inc.php';
49 49
 
50 50
 foreach ($opt['page']['banned_user_agents'] as $ua) {
51 51
     if (strpos($useragent, $ua) !== false) {
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
     }
70 70
 }
71 71
 
72
-require_once $opt['rootpath'] . 'lib2/errorhandler.inc.php';
72
+require_once $opt['rootpath'].'lib2/errorhandler.inc.php';
73 73
 configure_php();
74 74
 
75
-require $opt['rootpath'] . 'lib2/cookie.class.php';
75
+require $opt['rootpath'].'lib2/cookie.class.php';
76 76
 normalize_settings();
77 77
 set_language();
78 78
 set_usercountry();
@@ -85,30 +85,30 @@  discard block
 block discarded – undo
85 85
         $opt['template']['style'] = $opt['template']['default']['style'];
86 86
     }
87 87
 
88
-    if (!is_dir($opt['rootpath'] . 'templates2/' . $opt['template']['style'])) {
88
+    if (!is_dir($opt['rootpath'].'templates2/'.$opt['template']['style'])) {
89 89
         $opt['template']['style'] = $opt['template']['default']['style'];
90 90
     }
91 91
 } else {
92 92
     $opt['template']['style'] = $opt['template']['default']['style'];
93 93
 }
94
-$opt['stylepath'] = $opt['rootpath'] . 'templates2/' . $opt['template']['style'] . '/';
94
+$opt['stylepath'] = $opt['rootpath'].'templates2/'.$opt['template']['style'].'/';
95 95
 
96 96
 check_useragent();
97 97
 
98 98
 /* setup smarty
99 99
  *
100 100
  */
101
-require $opt['rootpath'] . 'lib2/OcSmarty.class.php';
101
+require $opt['rootpath'].'lib2/OcSmarty.class.php';
102 102
 $tpl = new OcSmarty();
103 103
 
104 104
 // include all we need
105
-require_once $opt['rootpath'] . 'lib2/logic/const.inc.php';
106
-require_once $opt['rootpath'] . 'lib2/error.inc.php';
107
-require_once $opt['rootpath'] . 'lib2/util.inc.php';
108
-require_once $opt['rootpath'] . 'lib2/db.inc.php';
109
-require_once $opt['rootpath'] . 'lib2/login.class.php';
110
-require_once $opt['rootpath'] . 'lib2/menu.class.php';
111
-require_once $opt['rootpath'] . 'lib2/logic/labels.inc.php';
105
+require_once $opt['rootpath'].'lib2/logic/const.inc.php';
106
+require_once $opt['rootpath'].'lib2/error.inc.php';
107
+require_once $opt['rootpath'].'lib2/util.inc.php';
108
+require_once $opt['rootpath'].'lib2/db.inc.php';
109
+require_once $opt['rootpath'].'lib2/login.class.php';
110
+require_once $opt['rootpath'].'lib2/menu.class.php';
111
+require_once $opt['rootpath'].'lib2/logic/labels.inc.php';
112 112
 // require_once $opt['rootpath'] . 'lib2/throttle.inc.php';
113 113
 
114 114
 // apply post configuration
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     $login->userid > 0 &&
124 124
     sql_value("SELECT `email_problems` FROM `user` WHERE `user_id`='&1'", 0, $login->userid) != 0
125 125
 ) {
126
-    header("Location: verifyemail.php?page=" . basename($_SERVER['REQUEST_URI']));
126
+    header("Location: verifyemail.php?page=".basename($_SERVER['REQUEST_URI']));
127 127
     exit;
128 128
 }
129 129
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     }
149 149
 
150 150
     if (isset($opt['logic']['cachemaps']['wmsurl']) && strstr($opt['logic']['cachemaps']['wmsurl'], '://')) {
151
-        $opt['logic']['cachemaps']['wmsurl'] = $opt['page']['protocol'] . strstr(
151
+        $opt['logic']['cachemaps']['wmsurl'] = $opt['page']['protocol'].strstr(
152 152
                 $opt['logic']['cachemaps']['wmsurl'],
153 153
                 '://'
154 154
             );
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $cookie->set('locale', $opt['template']['locale'], $opt['template']['default']['locale']);
237 237
     }
238 238
 
239
-    bindtextdomain('messages', $opt['rootpath'] . 'cache2/translate');
239
+    bindtextdomain('messages', $opt['rootpath'].'cache2/translate');
240 240
     set_php_locale();
241 241
     textdomain('messages');
242 242
 }
@@ -277,13 +277,13 @@  discard block
 block discarded – undo
277 277
     if (strtolower(substr($url, 0, strlen($opt['page']['absolute_http_url']))) == $opt['page']['absolute_http_url']
278 278
         && $opt['page']['https']['active']
279 279
     ) {
280
-        return 'https' . strstr($url, '://');
280
+        return 'https'.strstr($url, '://');
281 281
     } elseif (strtolower(
282 282
             substr($url, 0, strlen($opt['page']['absolute_https_url']))
283 283
         ) == $opt['page']['absolute_https_url']
284 284
         && !$opt['page']['https']['active']
285 285
     ) {
286
-        return 'http' . strstr($url, '://');
286
+        return 'http'.strstr($url, '://');
287 287
     } else {
288 288
         return $url;
289 289
     }
Please login to merge, or discard this patch.
htdocs/lib2/sqldebugger.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *  This modules gives you a very usefull SQL debugger for MySQL ...
8 8
  ***************************************************************************/
9 9
 
10
-require_once $opt['rootpath'] . 'lib2/bench.inc.php';
10
+require_once $opt['rootpath'].'lib2/bench.inc.php';
11 11
 
12 12
 $sqldebugger = new sqldebugger();
13 13
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $command['mode'] = $db['mode'];
49 49
         $command['slave'] = $bQuerySlave;
50 50
         $command['server'] = $sServer;
51
-        $command['dblink'] = '' . $dblink;
51
+        $command['dblink'] = ''.$dblink;
52 52
 
53 53
         $bUseExplain = false;
54 54
         $sql = trim($sql);
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
                     break;
75 75
                 }
76 76
                 $command['result'][] = $r;
77
-                $c ++;
77
+                $c++;
78 78
             }
79 79
             sql_free_result($rs);
80 80
 
81
-            $rs = mysql_query('EXPLAIN EXTENDED ' . $sqlexplain, $dblink);
81
+            $rs = mysql_query('EXPLAIN EXTENDED '.$sqlexplain, $dblink);
82 82
             while ($r = sql_fetch_assoc($rs)) {
83 83
                 $command['explain'][] = $r;
84 84
             }
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
             return '';
127 127
         }
128 128
 
129
-        return 'SELECT * ' . substr($sql, $start);
129
+        return 'SELECT * '.substr($sql, $start);
130 130
     }
131 131
 
132 132
     public function insert_nocache($sql)
133 133
     {
134 134
         if (strtoupper(substr($sql, 0, 7)) == 'SELECT ') {
135
-            $sql = 'SELECT SQL_NO_CACHE ' . substr($sql, 7);
135
+            $sql = 'SELECT SQL_NO_CACHE '.substr($sql, 7);
136 136
         }
137 137
 
138 138
         return $sql;
Please login to merge, or discard this patch.
htdocs/lib2/rowEditor.class.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 {
10 10
     public $sTable;
11 11
     public $sAutoIncrementField = null;
12
-    public $pk;     // (idx:name; type, default, nullable, value, insertfunction)
12
+    public $pk; // (idx:name; type, default, nullable, value, insertfunction)
13 13
     public $fields; // (idx:name; type, default, nullable, value, changed, insertfunction)
14 14
 
15 15
     // status var
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             if ($i == $index) {
255 255
                 return $k;
256 256
             }
257
-            $i ++;
257
+            $i++;
258 258
         }
259 259
     }
260 260
 
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
         $fselect = array();
316 316
         $sql = 'SELECT ';
317 317
         foreach ($this->fields as $k => $field) {
318
-            $fselect[] = '`' . sql_escape($k) . '`';
318
+            $fselect[] = '`'.sql_escape($k).'`';
319 319
         }
320 320
         $sql .= join(', ', $fselect);
321 321
 
322
-        $sql .= ' FROM `' . sql_escape($this->sTable) . '`';
323
-        $sql .= ' WHERE ' . $this->pBuildPK();
322
+        $sql .= ' FROM `'.sql_escape($this->sTable).'`';
323
+        $sql .= ' WHERE '.$this->pBuildPK();
324 324
 
325 325
         return $sql;
326 326
     }
@@ -330,9 +330,9 @@  discard block
 block discarded – undo
330 330
         $fwhere = array();
331 331
         foreach ($this->pk as $k => $field) {
332 332
             if ($field['value'] === null) {
333
-                $fwhere[] = 'ISNULL(`' . sql_escape($k) . '`)';
333
+                $fwhere[] = 'ISNULL(`'.sql_escape($k).'`)';
334 334
             } else {
335
-                $fwhere[] = '`' . sql_escape($k) . '`=\'' . sql_escape($field['value']) . '\'';
335
+                $fwhere[] = '`'.sql_escape($k).'`=\''.sql_escape($field['value']).'\'';
336 336
             }
337 337
         }
338 338
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 
463 463
     public function pBuildInsert()
464 464
     {
465
-        $sql = 'INSERT IGNORE INTO `' . sql_escape($this->sTable) . '` (';
465
+        $sql = 'INSERT IGNORE INTO `'.sql_escape($this->sTable).'` (';
466 466
 
467 467
         $sFields = array();
468 468
         $sValues = array();
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                 continue;
481 481
             }
482 482
 
483
-            $sFields[] = '`' . sql_escape($k) . '`';
483
+            $sFields[] = '`'.sql_escape($k).'`';
484 484
 
485 485
             if ((($field['insertfunction'] & RE_INSERT_OVERWRITE) == RE_INSERT_OVERWRITE) || (($field['changed'] == false) && ($field['insertfunction'] != RE_INSERT_NOTHING))) {
486 486
                 if (($field['insertfunction'] & RE_INSERT_NOW) == RE_INSERT_NOW) {
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                 if ($field['value'] === null) {
493 493
                     $sValues[] = 'NULL';
494 494
                 } else {
495
-                    $sValues[] = '\'' . sql_escape($this->pFormatValueSql($field['type'], $field['value'])) . '\'';
495
+                    $sValues[] = '\''.sql_escape($this->pFormatValueSql($field['type'], $field['value'])).'\'';
496 496
                 }
497 497
             }
498 498
         }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
                 continue;
503 503
             }
504 504
 
505
-            $sFields[] = '`' . sql_escape($k) . '`';
505
+            $sFields[] = '`'.sql_escape($k).'`';
506 506
 
507 507
             if ((($field['insertfunction'] & RE_INSERT_OVERWRITE) == RE_INSERT_OVERWRITE) || (($field['changed'] == false) && ($field['insertfunction'] != RE_INSERT_NOTHING))) {
508 508
                 if (($field['insertfunction'] & RE_INSERT_NOW) == RE_INSERT_NOW) {
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
                 if ($field['value'] === null) {
515 515
                     $sValues[] = 'NULL';
516 516
                 } else {
517
-                    $sValues[] = '\'' . sql_escape($this->pFormatValueSql($field['type'], $field['value'])) . '\'';
517
+                    $sValues[] = '\''.sql_escape($this->pFormatValueSql($field['type'], $field['value'])).'\'';
518 518
                 }
519 519
             }
520 520
         }
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 
529 529
     public function pBuildUpdate()
530 530
     {
531
-        $sql = 'UPDATE IGNORE `' . sql_escape($this->sTable) . '` SET ';
531
+        $sql = 'UPDATE IGNORE `'.sql_escape($this->sTable).'` SET ';
532 532
 
533 533
         $sSet = '';
534 534
         foreach ($this->fields as $k => $field) {
@@ -538,9 +538,9 @@  discard block
 block discarded – undo
538 538
                 }
539 539
 
540 540
                 if ($field['value'] === null) {
541
-                    $sSet .= '`' . sql_escape($k) . '`=NULL';
541
+                    $sSet .= '`'.sql_escape($k).'`=NULL';
542 542
                 } else {
543
-                    $sSet .= '`' . sql_escape($k) . '`=\'' . sql_escape($this->pFormatValueSql($field['type'], $field['value'])) . '\'';
543
+                    $sSet .= '`'.sql_escape($k).'`=\''.sql_escape($this->pFormatValueSql($field['type'], $field['value'])).'\'';
544 544
                 }
545 545
             }
546 546
         }
@@ -567,12 +567,12 @@  discard block
 block discarded – undo
567 567
         }
568 568
 
569 569
         if ($this->fields[$field]['value'] === null) {
570
-            $sSet = '`' . sql_escape($field) . '`=NULL';
570
+            $sSet = '`'.sql_escape($field).'`=NULL';
571 571
         } else {
572
-            $sSet = '`' . sql_escape($field) . '`=\'' . sql_escape($this->pFormatValueSql($this->fields[$field]['type'], $this->fields[$field]['value'])) . '\'';
572
+            $sSet = '`'.sql_escape($field).'`=\''.sql_escape($this->pFormatValueSql($this->fields[$field]['type'], $this->fields[$field]['value'])).'\'';
573 573
         }
574 574
 
575
-        $sql = 'UPDATE `' . sql_escape($this->sTable) . '` SET ' . $sSet;
575
+        $sql = 'UPDATE `'.sql_escape($this->sTable).'` SET '.$sSet;
576 576
         $sql .= ' WHERE ';
577 577
         $sql .= $this->pBuildPK();
578 578
 
Please login to merge, or discard this patch.
htdocs/lib2/RSSParser.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                                     'description' => $item->description
67 67
                                 );
68 68
                                 // increment counter
69
-                                $i ++;
69
+                                $i++;
70 70
                                 // htmlspecialchars_decode() works around inconsistent HTML encoding
71 71
                                 // e.g. in SMF Forum Threads
72 72
                             } elseif (!in_array(htmlspecialchars_decode($item->title), $headlines) &&
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
                                     'title' => $item->title,
79 79
                                     'link' => $item->link
80 80
                                 );
81
-                                $headlines[] = "" . htmlspecialchars_decode($item->title);
81
+                                $headlines[] = "".htmlspecialchars_decode($item->title);
82 82
                                 // increment counter
83
-                                $i ++;
83
+                                $i++;
84 84
                             }
85 85
                         }
86 86
                     }
Please login to merge, or discard this patch.
htdocs/lib2/smiley.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@
 block discarded – undo
90 90
 
91 91
     $smiley_a = array();
92 92
     for ($n = 0; $n < count($smiley['file']); ++ $n) {
93
-        $smiley['image'][$n] = '<img src="' . $opt['template']['smiley'] . $smiley['file'][$n] . '" alt="' . $smiley['text'][$n] . '" border="0" width="18px" height="18px" />';
94
-        $smiley['spaced_image'][$n] = ' ' . $smiley['image'][$n] . ' ';
93
+        $smiley['image'][$n] = '<img src="'.$opt['template']['smiley'].$smiley['file'][$n].'" alt="'.$smiley['text'][$n].'" border="0" width="18px" height="18px" />';
94
+        $smiley['spaced_image'][$n] = ' '.$smiley['image'][$n].' ';
95 95
         $smiley_a[] = [
96 96
             'text' => $smiley['text'][$n],
97 97
             'file' => $smiley['file'][$n],
Please login to merge, or discard this patch.
htdocs/lib2/OcSmarty.class.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
  *  Inherit Smarty-Class and extend it
8 8
  ***************************************************************************/
9 9
 
10
-require_once __DIR__ . '/../vendor/autoload.php';
11
-require_once $opt['rootpath'] . 'lib2/db.inc.php';
12
-require_once $opt['rootpath'] . 'lib2/logic/labels.inc.php';
10
+require_once __DIR__.'/../vendor/autoload.php';
11
+require_once $opt['rootpath'].'lib2/db.inc.php';
12
+require_once $opt['rootpath'].'lib2/logic/labels.inc.php';
13 13
 
14 14
 class OcSmarty extends Smarty
15 15
 {
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public $main_template = 'sys_main';
18 18
     public $bench = null;
19 19
     public $compile_id = null;
20
-    public $cache_id = null;    // This is a smarty caching ID, not a caches.cache_id.
20
+    public $cache_id = null; // This is a smarty caching ID, not a caches.cache_id.
21 21
     public $title = '';
22 22
     public $menuitem = null;
23 23
     public $nowpsearch = false;
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
     public function __construct()
41 41
     {
42 42
         global $opt, $sqldebugger;
43
-        require_once $opt['rootpath'] . 'lib2/bench.inc.php';
43
+        require_once $opt['rootpath'].'lib2/bench.inc.php';
44 44
         $this->bench = new CBench();
45 45
         $this->bench->start();
46 46
 
47 47
         // configuration
48 48
         $this->template_dir = $opt['stylepath'];
49
-        $this->compile_dir = $opt['rootpath'] . 'cache2/smarty/compiled/';
50
-        $this->cache_dir = $opt['rootpath'] . 'cache2/smarty/cache/';
49
+        $this->compile_dir = $opt['rootpath'].'cache2/smarty/compiled/';
50
+        $this->cache_dir = $opt['rootpath'].'cache2/smarty/cache/';
51 51
         $this->plugins_dir = [
52 52
             'plugins',
53
-            __DIR__ . '/../src/Oc/SmartyPlugins'
53
+            __DIR__.'/../src/Oc/SmartyPlugins'
54 54
         ];
55 55
 
56 56
         // disable caching ... if caching is enabled, 1 hour is default
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->cache_lifetime = 3600; // default
59 59
 
60 60
         // register additional functions
61
-        require_once __DIR__ . '/../src/Oc/SmartyPlugins/block.nocache.php';
61
+        require_once __DIR__.'/../src/Oc/SmartyPlugins/block.nocache.php';
62 62
         $this->register_block('nocache', 'smarty_block_nocache', false);
63 63
         $this->load_filter('pre', 't');
64 64
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         // process debug level
75 75
         if (($opt['debug'] & DEBUG_SQLDEBUGGER) == DEBUG_SQLDEBUGGER) {
76
-            require_once $opt['rootpath'] . 'lib2/sqldebugger.class.php';
76
+            require_once $opt['rootpath'].'lib2/sqldebugger.class.php';
77 77
         } elseif (($opt['debug'] & DEBUG_OUTOFSERVICE) == DEBUG_OUTOFSERVICE) {
78 78
             $this->name = 'sys_outofservice';
79 79
             $this->display();
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
                 $this->target = '';
88 88
             }
89 89
         } else {
90
-            $target = basename($_SERVER['PHP_SELF']) . '?';
90
+            $target = basename($_SERVER['PHP_SELF']).'?';
91 91
 
92 92
             // REQUEST-Variablen durchlaufen und an target anhaengen
93 93
             reset($_REQUEST);
94 94
             while (list($varname, $varvalue) = each($_REQUEST)) {
95 95
                 if (in_array($varname, $opt['logic']['targetvars'])) {
96
-                    $target .= urlencode($varname) . '=' . urlencode($varvalue) . '&';
96
+                    $target .= urlencode($varname).'='.urlencode($varvalue).'&';
97 97
                 }
98 98
             }
99 99
             reset($_REQUEST);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $optn['page']['absolute_urlpath'] = parse_url($opt['page']['absolute_url'], PHP_URL_PATH);
178 178
         $optn['page']['absolute_http_url'] = $opt['page']['absolute_http_url'];
179 179
         $optn['page']['default_absolute_url'] = $opt['page']['default_absolute_url'];
180
-        $optn['page']['login_url'] = ($opt['page']['https']['force_login'] ? $opt['page']['absolute_https_url'] : '') . 'login.php';
180
+        $optn['page']['login_url'] = ($opt['page']['https']['force_login'] ? $opt['page']['absolute_https_url'] : '').'login.php';
181 181
         $optn['page']['target'] = $this->target;
182 182
         $optn['page']['showdonations'] = $opt['page']['showdonations'];
183 183
         $optn['page']['title'] = $opt['page']['title'];
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         }
304 304
         $this->assign('sys_dbslave', ($db['slave_id'] != - 1));
305 305
 
306
-        if ($this->template_exists($this->name . '.tpl')) {
306
+        if ($this->template_exists($this->name.'.tpl')) {
307 307
             $this->assign('template', $this->name);
308 308
         } elseif ($this->name != 'sys_error') {
309 309
             $this->error(ERROR_TEMPLATE_NOT_FOUND);
@@ -314,15 +314,15 @@  discard block
 block discarded – undo
314 314
 
315 315
         $this->assign(
316 316
             'screen_css_time',
317
-            filemtime($opt['rootpath'] . "resource2/" . $opt['template']['style'] . "/css/style_screen.css")
317
+            filemtime($opt['rootpath']."resource2/".$opt['template']['style']."/css/style_screen.css")
318 318
         );
319 319
         $this->assign(
320 320
             'screen_msie_css_time',
321
-            filemtime($opt['rootpath'] . "resource2/" . $opt['template']['style'] . "/css/style_screen_msie.css")
321
+            filemtime($opt['rootpath']."resource2/".$opt['template']['style']."/css/style_screen_msie.css")
322 322
         );
323 323
         $this->assign(
324 324
             'print_css_time',
325
-            filemtime($opt['rootpath'] . "resource2/" . $opt['template']['style'] . "/css/style_print.css")
325
+            filemtime($opt['rootpath']."resource2/".$opt['template']['style']."/css/style_print.css")
326 326
         );
327 327
 
328 328
         // check if the template is compiled
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
         }
343 343
 
344 344
         if (($opt['debug'] & DEBUG_SQLDEBUGGER) == DEBUG_SQLDEBUGGER) {
345
-            require_once $opt['rootpath'] . 'lib2/sqldebugger.class.php';
345
+            require_once $opt['rootpath'].'lib2/sqldebugger.class.php';
346 346
 
347
-            parent::fetch($this->main_template . '.tpl', $this->get_cache_id(), $this->get_compile_id());
347
+            parent::fetch($this->main_template.'.tpl', $this->get_cache_id(), $this->get_compile_id());
348 348
 
349 349
             $this->clear_all_assign();
350 350
             $this->main_template = 'sys_sqldebugger';
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
             $opt['debug'] = $opt['debug'] & ~DEBUG_SQLDEBUGGER;
362 362
 
363 363
             $this->header();
364
-            parent::display($this->main_template . '.tpl');
364
+            parent::display($this->main_template.'.tpl');
365 365
         } else {
366 366
             $this->header();
367
-            parent::display($this->main_template . '.tpl', $this->get_cache_id(), $this->get_compile_id());
367
+            parent::display($this->main_template.'.tpl', $this->get_cache_id(), $this->get_compile_id());
368 368
         }
369 369
 
370 370
         exit;
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
 
386 386
         $args = func_get_args();
387 387
         unset($args[0]);
388
-        for ($i = 1; isset($args[$i]); $i ++) {
389
-            $this->assign('p' . $i, $args[$i]);
388
+        for ($i = 1; isset($args[$i]); $i++) {
389
+            $this->assign('p'.$i, $args[$i]);
390 390
         }
391 391
 
392 392
         $this->name = 'error';
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
             }
406 406
         }
407 407
 
408
-        return parent::is_cached($this->main_template . '.tpl', $this->get_cache_id(), $this->get_compile_id());
408
+        return parent::is_cached($this->main_template.'.tpl', $this->get_cache_id(), $this->get_compile_id());
409 409
     }
410 410
 
411 411
     public function get_cache_id()
@@ -416,14 +416,14 @@  discard block
 block discarded – undo
416 416
         // Probably this is no safety or stability issue, but to be sure we restrict
417 417
         // the ID to a reasonable set of characters:
418 418
 
419
-        return $this->name . '|' . mb_ereg_replace('/[^A-Za-z0-9_\|\-\.]/', '', $this->cache_id);
419
+        return $this->name.'|'.mb_ereg_replace('/[^A-Za-z0-9_\|\-\.]/', '', $this->cache_id);
420 420
     }
421 421
 
422 422
     public function get_compile_id()
423 423
     {
424 424
         global $opt;
425 425
 
426
-        return $opt['template']['style'] . '|' . $opt['template']['locale'] . '|' . $this->compile_id;
426
+        return $opt['template']['style'].'|'.$opt['template']['locale'].'|'.$this->compile_id;
427 427
     }
428 428
 
429 429
     public function redirect($page)
@@ -445,21 +445,21 @@  discard block
 block discarded – undo
445 445
             if (substr($page, 0, 1) == '/') {
446 446
                 $page = substr($page, 1);
447 447
             }
448
-            $page = $opt['page']['absolute_url'] . $page;
448
+            $page = $opt['page']['absolute_url'].$page;
449 449
         }
450 450
 
451 451
         if ($opt['session']['mode'] == SAVE_SESSION) {
452 452
             if (defined('SID') && SID != '' && session_id() != '') {
453 453
                 if (strpos($page, '?') === false) {
454
-                    header("Location: " . $page . '?' . urlencode(session_name()) . '=' . urlencode(session_id()));
454
+                    header("Location: ".$page.'?'.urlencode(session_name()).'='.urlencode(session_id()));
455 455
                 } else {
456
-                    header("Location: " . $page . '&' . urlencode(session_name()) . '=' . urlencode(session_id()));
456
+                    header("Location: ".$page.'&'.urlencode(session_name()).'='.urlencode(session_id()));
457 457
                 }
458 458
             } else {
459
-                header("Location: " . $page);
459
+                header("Location: ".$page);
460 460
             }
461 461
         } else {
462
-            header("Location: " . $page);
462
+            header("Location: ".$page);
463 463
         }
464 464
         exit;
465 465
     }
@@ -475,8 +475,8 @@  discard block
 block discarded – undo
475 475
 
476 476
         // ok ... redirect the get-data
477 477
         $target = ($opt['page']['https']['force_login'] ? 'https' : $opt['page']['protocol'])
478
-            . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
479
-        $this->redirect('login.php?target=' . urlencode($target));
478
+            . '://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
479
+        $this->redirect('login.php?target='.urlencode($target));
480 480
     }
481 481
 
482 482
     public function assign_rs($name, $rs)
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             // Date in the past
521 521
             header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
522 522
             // always modified
523
-            header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
523
+            header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
524 524
 
525 525
             // set the cookie
526 526
             $cookie->header();
Please login to merge, or discard this patch.
htdocs/lib2/db.inc.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
         // & escaped?
186 186
         $escapesCount = 0;
187 187
         while ((($nextarg - $escapesCount - 1) > 0) && (substr($sql, $nextarg - $escapesCount - 1, 1) == '\\')) {
188
-            $escapesCount ++;
188
+            $escapesCount++;
189 189
         }
190 190
         if (($escapesCount % 2) == 1) {
191
-            $nextarg ++;
191
+            $nextarg++;
192 192
         } else {
193 193
             $nextchar = substr($sql, $nextarg + 1, 1);
194 194
             if (is_numeric($nextchar)) {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 while (preg_match('/^[0-9]{1}/', $nextchar) == 1) {
200 200
                     $arg .= $nextchar;
201 201
 
202
-                    $arglength ++;
202
+                    $arglength++;
203 203
                     $nextchar = substr($sql, $nextarg + $arglength + 1, 1);
204 204
                 }
205 205
 
@@ -225,13 +225,13 @@  discard block
 block discarded – undo
225 225
                         // strip apostroph and insert NULL
226 226
                         $filtered_sql = substr($filtered_sql, 0, strlen($filtered_sql) - 1);
227 227
                         $filtered_sql .= 'NULL';
228
-                        $sqlpos ++;
228
+                        $sqlpos++;
229 229
                     } else {
230 230
                         $filtered_sql .= 'NULL';
231 231
                     }
232 232
                 }
233 233
 
234
-                $sqlpos ++;
234
+                $sqlpos++;
235 235
             } else {
236 236
                 $arglength = 0;
237 237
                 $arg = '';
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                 while (preg_match('/^[a-zA-Z0-9_]{1}/', $nextchar) == 1) {
242 242
                     $arg .= $nextchar;
243 243
 
244
-                    $arglength ++;
244
+                    $arglength++;
245 245
                     $nextchar = substr($sql, $nextarg + $arglength + 1, 1);
246 246
                 }
247 247
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                         $filtered_sql .= '`';
264 264
                     }
265 265
 
266
-                    $filtered_sql .= sql_escape_backtick($opt['db']['placeholder']['tmpdb']) . '`.`' . sql_escape_backtick($db['temptables'][$arg]);
266
+                    $filtered_sql .= sql_escape_backtick($opt['db']['placeholder']['tmpdb']).'`.`'.sql_escape_backtick($db['temptables'][$arg]);
267 267
 
268 268
                     if (substr($sql, $nextarg + $arglength + 1, 1) != '`') {
269 269
                         $filtered_sql .= '`';
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
         $escapesCount = 0;
289 289
         while ((($nextarg - $escapesCount - 1) > 0)
290 290
             && (substr($filtered_sql, $nextarg - $escapesCount - 1, 1) == '\\')) {
291
-            $escapesCount ++;
291
+            $escapesCount++;
292 292
         }
293 293
         if (($escapesCount % 2) == 0) {
294 294
             // strip escapes of &
295
-            $filtered_sql = substr($filtered_sql, 0, $nextarg) . '&' . substr($filtered_sql, $nextarg + 2);
296
-            $nextarg --;
295
+            $filtered_sql = substr($filtered_sql, 0, $nextarg).'&'.substr($filtered_sql, $nextarg + 2);
296
+            $nextarg--;
297 297
         }
298 298
 
299 299
         $nextarg = strpos($filtered_sql, '\&', $nextarg + 2);
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
     */
311 311
 
312 312
     if (isset($db['debug']) && ($db['debug'] == true)) {
313
-        require_once $opt['rootpath'] . 'lib2/sqldebugger.class.php';
313
+        require_once $opt['rootpath'].'lib2/sqldebugger.class.php';
314 314
         $result = $sqldebugger->execute($filtered_sql, $dblink, ($dblink === $db['dblink_slave']), $db['slave_server']);
315 315
         if ($result === false) {
316 316
             sql_error($filtered_sql);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
     } else {
319 319
         // measure time
320 320
         if ($opt['db']['warn']['time'] > 0) {
321
-            require_once $opt['rootpath'] . 'lib2/bench.inc.php';
321
+            require_once $opt['rootpath'].'lib2/bench.inc.php';
322 322
             $cSqlExecution = new Cbench;
323 323
             $cSqlExecution->start();
324 324
         }
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
             $cSqlExecution->stop();
333 333
 
334 334
             if ($cSqlExecution->diff() > $opt['db']['warn']['time']) {
335
-                $ua = isset($_SERVER['HTTP_USER_AGENT']) ? "\r\n" . $_SERVER['HTTP_USER_AGENT'] : "";
336
-                sql_warn("execution took " . $cSqlExecution->diff() . " seconds" . $ua);
335
+                $ua = isset($_SERVER['HTTP_USER_AGENT']) ? "\r\n".$_SERVER['HTTP_USER_AGENT'] : "";
336
+                sql_warn("execution took ".$cSqlExecution->diff()." seconds".$ua);
337 337
             }
338 338
         }
339 339
     }
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
     }
775 775
 
776 776
     if ($db['dblink'] !== false) {
777
-        mysql_query("SET NAMES '" . mysql_real_escape_string($opt['charset']['mysql'], $db['dblink']) . "'", $db['dblink']);
777
+        mysql_query("SET NAMES '".mysql_real_escape_string($opt['charset']['mysql'], $db['dblink'])."'", $db['dblink']);
778 778
 
779 779
         //database connection established ... set the used database
780 780
         if (@mysql_select_db($opt['db']['placeholder']['db'], $db['dblink']) == false) {
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
         AND `online`= 1
838 838
         AND (TIMESTAMP(NOW())-TIMESTAMP(`last_check`)+`time_diff`<'&1')
839 839
         ORDER BY `w` DESC LIMIT 1",
840
-        - 1,
840
+        -1,
841 841
         $nMaxTimeDiff
842 842
     );
843 843
 
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
         if (mysql_select_db($opt['db']['placeholder']['db'], $db['dblink_slave']) == false)
898 898
             sql_error();
899 899
 
900
-        mysql_query("SET NAMES '" . mysql_real_escape_string($opt['charset']['mysql'], $db['dblink_slave']) . "'", $db['dblink_slave']);
900
+        mysql_query("SET NAMES '".mysql_real_escape_string($opt['charset']['mysql'], $db['dblink_slave'])."'", $db['dblink_slave']);
901 901
 
902 902
         // initialize temp tables on slave server
903 903
         $rs = sqlf_slave("SELECT `threadid`, `name` FROM `sys_temptables` WHERE `threadid`='&1'", mysql_thread_id($db['dblink_slave']));
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
     $errno = mysql_errno();
1010 1010
     $error = mysql_error();
1011 1011
     if ($sqlstatement != "") {
1012
-        $error .= "\n\nSQL statement: " . $sqlstatement;
1012
+        $error .= "\n\nSQL statement: ".$sqlstatement;
1013 1013
     }
1014 1014
 
1015 1015
     if ($db['error'] == true) {
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
         // could not load translations from database)
1019 1019
 
1020 1020
         if ($opt['db']['error']['display'] == true) {
1021
-            $errmsg = 'MySQL error recursion (' . $errno . '): ' . $error;
1021
+            $errmsg = 'MySQL error recursion ('.$errno.'): '.$error;
1022 1022
         } else {
1023 1023
             $errmsg = "";
1024 1024
         }
@@ -1033,13 +1033,13 @@  discard block
 block discarded – undo
1033 1033
     }
1034 1034
 
1035 1035
     if ($opt['db']['error']['mail'] != '') {
1036
-        $subject = '[' . $opt['page']['domain'] . '] SQL error';
1036
+        $subject = '['.$opt['page']['domain'].'] SQL error';
1037 1037
         if (admin_errormail($opt['db']['error']['mail'],
1038 1038
             $subject,
1039
-            str_replace("\n", "\r\n", $error) . "\n" . print_r(debug_backtrace(), true),
1040
-            "From: " . $opt['mail']['from'])) {
1039
+            str_replace("\n", "\r\n", $error)."\n".print_r(debug_backtrace(), true),
1040
+            "From: ".$opt['mail']['from'])) {
1041 1041
         #
1042
-            require_once $opt['rootpath'] . 'lib2/mail.class.php';
1042
+            require_once $opt['rootpath'].'lib2/mail.class.php';
1043 1043
             $mail = new mail();
1044 1044
             $mail->subject = $subject;
1045 1045
             $mail->to = $opt['db']['error']['mail'];
@@ -1058,13 +1058,13 @@  discard block
 block discarded – undo
1058 1058
     if ($opt['gui'] == GUI_HTML) {
1059 1059
         if (isset($tpl)) {
1060 1060
             if ($opt['db']['error']['display'] == true) {
1061
-                $tpl->error('MySQL error (' . $errno . '): ' . $error);
1061
+                $tpl->error('MySQL error ('.$errno.'): '.$error);
1062 1062
             } else {
1063 1063
                 $tpl->error('A database command could not be performed.');
1064 1064
             }
1065 1065
         } else {
1066 1066
             if ($opt['db']['error']['display'] == true) {
1067
-                die('<html><body>' . htmlspecialchars('MySQL error (' . $errno . '): ' . str_replace("\n,", "<br />", $error)) . '</body></html>');
1067
+                die('<html><body>'.htmlspecialchars('MySQL error ('.$errno.'): '.str_replace("\n,", "<br />", $error)).'</body></html>');
1068 1068
             } else {
1069 1069
                 die('<html><body>A database command could not be performed</body></html>');
1070 1070
             }
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
     } else {
1073 1073
         // CLI script, simple text output
1074 1074
         if ($opt['db']['error']['display'] == true) {
1075
-            die('MySQL error (' . $errno . '): ' . $error . "\n");
1075
+            die('MySQL error ('.$errno.'): '.$error."\n");
1076 1076
         } else {
1077 1077
             die("A database command could not be performed.\n");
1078 1078
         }
@@ -1084,13 +1084,13 @@  discard block
 block discarded – undo
1084 1084
     global $opt;
1085 1085
 
1086 1086
     if ($opt['db']['error']['mail'] != '') {
1087
-        $subject = '[' . $opt['page']['domain'] . '] SQL error';
1087
+        $subject = '['.$opt['page']['domain'].'] SQL error';
1088 1088
         if (admin_errormail($opt['db']['error']['mail'],
1089 1089
             $subject,
1090
-            $warnmessage . "\n" . print_r(debug_backtrace(), true),
1091
-            "From: " . $opt['mail']['from'])) {
1090
+            $warnmessage."\n".print_r(debug_backtrace(), true),
1091
+            "From: ".$opt['mail']['from'])) {
1092 1092
         #
1093
-            require_once $opt['rootpath'] . 'lib2/mail.class.php';
1093
+            require_once $opt['rootpath'].'lib2/mail.class.php';
1094 1094
             $mail = new mail();
1095 1095
             $mail->name = 'sql_warn';
1096 1096
             $mail->subject = $subject;
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
     fwrite($f, "SET NAMES 'utf8';\n");
1111 1111
 
1112 1112
     if ($truncate == true) {
1113
-        fwrite($f, "TRUNCATE TABLE `" . sql_escape($table) . "`;\n");
1113
+        fwrite($f, "TRUNCATE TABLE `".sql_escape($table)."`;\n");
1114 1114
     }
1115 1115
 
1116 1116
     while ($r = sql_fetch_assoc($rs)) {
@@ -1118,19 +1118,19 @@  discard block
 block discarded – undo
1118 1118
         $values = array();
1119 1119
 
1120 1120
         foreach ($r as $k => $v) {
1121
-            $fields[] = '`' . sql_escape($k) . '`';
1121
+            $fields[] = '`'.sql_escape($k).'`';
1122 1122
             if ($v === null) {
1123 1123
                 $values[] = "NULL";
1124 1124
             } else {
1125
-                $values[] = "'" . sql_escape($v) . "'";
1125
+                $values[] = "'".sql_escape($v)."'";
1126 1126
             }
1127 1127
         }
1128 1128
         unset($r);
1129 1129
 
1130 1130
         fwrite(
1131 1131
             $f,
1132
-            "INSERT INTO `" . sql_escape($table) . "` (" . implode(', ', $fields) . ")"
1133
-            . " VALUES (" . implode(', ', $values) . ");\n"
1132
+            "INSERT INTO `".sql_escape($table)."` (".implode(', ', $fields).")"
1133
+            . " VALUES (".implode(', ', $values).");\n"
1134 1134
         );
1135 1135
     }
1136 1136
 }
@@ -1141,14 +1141,14 @@  discard block
 block discarded – undo
1141 1141
     $rsIndex = sql("SHOW INDEX FROM `&1`", $table);
1142 1142
     while ($r = sql_fetch_assoc($rsIndex)) {
1143 1143
         if ($r['Key_name'] == 'PRIMARY') {
1144
-            $primary[] = '`' . sql_escape($r['Column_name']) . '` ASC';
1144
+            $primary[] = '`'.sql_escape($r['Column_name']).'` ASC';
1145 1145
         }
1146 1146
     }
1147 1147
     sql_free_result($rsIndex);
1148 1148
 
1149
-    $sql = "SELECT * FROM `" . sql_escape($table) . "`";
1149
+    $sql = "SELECT * FROM `".sql_escape($table)."`";
1150 1150
     if (count($primary) > 0) {
1151
-        $sql .= ' ORDER BY ' . implode(', ', $primary);
1151
+        $sql .= ' ORDER BY '.implode(', ', $primary);
1152 1152
     }
1153 1153
 
1154 1154
     $rs = sql($sql);
@@ -1194,8 +1194,8 @@  discard block
 block discarded – undo
1194 1194
     $sTableSql = preg_replace("/,\n +?(KEY )?`okapi_syncbase`.+?(,)?\n/", "\\2\n", $sTableSql);
1195 1195
 
1196 1196
     fwrite($f, "SET NAMES 'utf8';\n");
1197
-    fwrite($f, "DROP TABLE IF EXISTS `" . sql_escape($table) . "`;\n");
1198
-    fwrite($f, $sTableSql . " ;\n");
1197
+    fwrite($f, "DROP TABLE IF EXISTS `".sql_escape($table)."`;\n");
1198
+    fwrite($f, $sTableSql." ;\n");
1199 1199
 }
1200 1200
 
1201 1201
 function sql_export_structure_to_file($filename, $table)
Please login to merge, or discard this patch.