Completed
Push — master ( b16e97...cfa47d )
by Thomas
07:53
created
htdocs/src/Oc/SmartyPlugins/block.nocache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
         if (!isset($counter[$name])) {
33 33
             $counter[$name] = 0;
34 34
         }
35
-        $counter[$name] ++;
35
+        $counter[$name]++;
36 36
 
37 37
         if ($smarty->_cache_including) {
38 38
             $param = isset($smarty->_cache_info['cached_vars'][$name][$counter[$name]]) ? $smarty->_cache_info['cached_vars'][$name][$counter[$name]] : [];
Please login to merge, or discard this patch.
htdocs/src/Oc/SmartyPlugins/function.season.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
     ];
81 81
 
82 82
     $nTimestamp = time();
83
-    for ($nIndex = 0; $nIndex < count($seasons); $nIndex ++) {
83
+    for ($nIndex = 0; $nIndex < count($seasons); $nIndex++) {
84 84
         if (strtotime($seasons[$nIndex][0]) > $nTimestamp) {
85 85
             return $params['winter'];
86 86
         } //'';
Please login to merge, or discard this patch.
htdocs/translate.php 2 patches
Switch Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -86,69 +86,69 @@  discard block
 block discarded – undo
86 86
 }
87 87
 
88 88
 switch ($action) {
89
-    case 'selectlang':
90
-        break;
89
+        case 'selectlang':
90
+            break;
91 91
 
92
-    case 'verify':
93
-        verify();
94
-        break;
92
+        case 'verify':
93
+            verify();
94
+            break;
95 95
 
96
-    case 'resetids':
97
-        resetIds();
98
-        break;
96
+        case 'resetids':
97
+            resetIds();
98
+            break;
99 99
 
100
-    case 'clearcache':
101
-        clearCache();
102
-        break;
100
+        case 'clearcache':
101
+            clearCache();
102
+            break;
103 103
 
104
-    case 'export':
105
-        export();
106
-        break;
104
+        case 'export':
105
+            export();
106
+            break;
107 107
 
108
-    case 'xmlexport':
109
-        xmlexport();
110
-        break;
108
+        case 'xmlexport':
109
+            xmlexport();
110
+            break;
111 111
 
112
-    case 'xmlimport':
113
-        break;
112
+        case 'xmlimport':
113
+            break;
114 114
 
115
-    case 'xmlimport2':
116
-        xmlimport2();
117
-        break;
115
+        case 'xmlimport2':
116
+            xmlimport2();
117
+            break;
118 118
 
119
-    case 'xmlimport3':
120
-        xmlimport3();
121
-        break;
119
+        case 'xmlimport3':
120
+            xmlimport3();
121
+            break;
122 122
 
123
-    case 'textexportnew':
124
-        textexport($translang, false);
125
-        break;
123
+        case 'textexportnew':
124
+            textexport($translang, false);
125
+            break;
126 126
 
127
-    case 'textexportall':
128
-        textexport($translang, true);
129
-        break;
127
+        case 'textexportall':
128
+            textexport($translang, true);
129
+            break;
130 130
 
131
-    case 'textimport':
132
-        break;
131
+        case 'textimport':
132
+            break;
133 133
 
134
-    case 'textimport2':
135
-        textimport($translang);
136
-        break;
134
+        case 'textimport2':
135
+            textimport($translang);
136
+            break;
137 137
 
138
-    case 'edit':
139
-        if (!$access->mayTranslate($translang)) {
140
-            $tpl->error(ERROR_NO_ACCESS);
141
-        }
142
-        edit();
143
-        break;
138
+        case 'edit':
139
+            if (!$access->mayTranslate($translang)) {
140
+                $tpl->error(ERROR_NO_ACCESS);
141
+            }
142
+            edit();
143
+            break;
144 144
 
145
-    case 'copy_en':
146
-        copy_english_texts();
147
-        break;
145
+        case 'copy_en':
146
+            copy_english_texts();
147
+            break;
148 148
 
149
-    case 'listfaults':
150
-        $trans = sql(
151
-            "SELECT
149
+        case 'listfaults':
150
+            $trans = sql(
151
+                "SELECT
152 152
                 `sys_trans`.`id`,
153 153
                 `sys_trans`.`text`
154 154
              FROM `sys_trans`
@@ -156,14 +156,14 @@  discard block
 block discarded – undo
156 156
                 ON `sys_trans`.`id`=`sys_trans_ref`.`trans_id`
157 157
              WHERE ISNULL(`sys_trans_ref`.`trans_id`)
158 158
              ORDER BY `sys_trans`.`id` DESC"
159
-        );
160
-        $tpl->assign_rs('trans', $trans);
161
-        sql_free_result($trans);
162
-        break;
159
+            );
160
+            $tpl->assign_rs('trans', $trans);
161
+            sql_free_result($trans);
162
+            break;
163 163
 
164
-    case 'listall':
165
-        $trans = sql(
166
-            "SELECT
164
+        case 'listall':
165
+            $trans = sql(
166
+                "SELECT
167 167
                 `sys_trans`.`id`,
168 168
                 `sys_trans`.`text`,
169 169
                 `sys_trans_text`.`text` AS `trans`
@@ -172,48 +172,48 @@  discard block
 block discarded – undo
172 172
                 ON `sys_trans`.`id`=`sys_trans_text`.`trans_id`
173 173
                 AND `sys_trans_text`.`lang`='&1'
174 174
              ORDER BY `sys_trans`.`id` DESC",
175
-            $translang
176
-        );
177
-        $tpl->assign_rs('trans', $trans);
178
-        sql_free_result($trans);
179
-        break;
175
+                $translang
176
+            );
177
+            $tpl->assign_rs('trans', $trans);
178
+            sql_free_result($trans);
179
+            break;
180 180
 
181
-    case 'remove':
182
-        if (!$access->mayTranslate($translang)) {
183
-            $tpl->error(ERROR_NO_ACCESS);
184
-        }
185
-        remove();
186
-        break;
187
-
188
-    case 'scan':
189
-        scan();
190
-        break;
191
-
192
-    case 'scanstart':
193
-        scanStart();
194
-        break;
195
-
196
-    case 'scanfile':
197
-        $filename = isset($_REQUEST['filename']) ? $_REQUEST['filename'] : '';
198
-        scanFile($filename);
199
-        exit;
200
-
201
-    case 'quicknone':
202
-        $cookie->un_set('translate_mode');
203
-        break;
204
-
205
-    case 'quicknew':
206
-        $cookie->set('translate_mode', 'new');
207
-        break;
208
-
209
-    case 'quickall':
210
-        $cookie->set('translate_mode', 'all');
211
-        break;
212
-
213
-    default:
214
-        $action = 'listnew';
215
-        $trans = sql(
216
-            "SELECT DISTINCT
181
+        case 'remove':
182
+            if (!$access->mayTranslate($translang)) {
183
+                $tpl->error(ERROR_NO_ACCESS);
184
+            }
185
+            remove();
186
+            break;
187
+
188
+        case 'scan':
189
+            scan();
190
+            break;
191
+
192
+        case 'scanstart':
193
+            scanStart();
194
+            break;
195
+
196
+        case 'scanfile':
197
+            $filename = isset($_REQUEST['filename']) ? $_REQUEST['filename'] : '';
198
+            scanFile($filename);
199
+            exit;
200
+
201
+        case 'quicknone':
202
+            $cookie->un_set('translate_mode');
203
+            break;
204
+
205
+        case 'quicknew':
206
+            $cookie->set('translate_mode', 'new');
207
+            break;
208
+
209
+        case 'quickall':
210
+            $cookie->set('translate_mode', 'all');
211
+            break;
212
+
213
+        default:
214
+            $action = 'listnew';
215
+            $trans = sql(
216
+                "SELECT DISTINCT
217 217
                 `sys_trans`.`id`,
218 218
                 `sys_trans`.`text`
219 219
              FROM `sys_trans`
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
                 ON `sys_trans`.`id`=`sys_trans_ref`.`trans_id`
225 225
              WHERE ISNULL(`sys_trans_text`.`trans_id`) OR `sys_trans_text`.`text`=''
226 226
              ORDER BY `sys_trans`.`id` DESC",
227
-            $translang
228
-        );
229
-        $tpl->assign_rs('trans', $trans);
230
-        sql_free_result($trans);
227
+                $translang
228
+            );
229
+            $tpl->assign_rs('trans', $trans);
230
+            sql_free_result($trans);
231 231
 }
232 232
 
233 233
 $languages = [];
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-require __DIR__ . '/lib2/web.inc.php';
9
-require_once __DIR__ . '/lib2/translate.class.php';
10
-require_once __DIR__ . '/lib2/translationHandler.class.php';
8
+require __DIR__.'/lib2/web.inc.php';
9
+require_once __DIR__.'/lib2/translate.class.php';
10
+require_once __DIR__.'/lib2/translationHandler.class.php';
11 11
 
12 12
 /* config section
13 13
  */
@@ -249,11 +249,11 @@  discard block
 block discarded – undo
249 249
 {
250 250
     global $opt;
251 251
 
252
-    if (!file_exists($opt['rootpath'] . '../sql/static-data/data.sql')) {
252
+    if (!file_exists($opt['rootpath'].'../sql/static-data/data.sql')) {
253 253
         return '';
254 254
     }
255 255
 
256
-    $content = file_get_contents($opt['rootpath'] . '../sql/static-data/data.sql');
256
+    $content = file_get_contents($opt['rootpath'].'../sql/static-data/data.sql');
257 257
 
258 258
     // at the end is an INSERT of the current checksum
259 259
     // to calculate this checksum, we have to trim the end before that statement and the linefeed before
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     sql("DELETE FROM `sys_trans_text` WHERE `trans_id`='&1'", $id);
283 283
     sql("DELETE FROM `sys_trans_ref` WHERE `trans_id`='&1'", $id);
284 284
 
285
-    $tpl->redirect('translate.php?translang=' . $translang);
285
+    $tpl->redirect('translate.php?translang='.$translang);
286 286
 }
287 287
 
288 288
 function edit()
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             );
312 312
         }
313 313
         sql_free_result($rs);
314
-        $tpl->redirect('translate.php?translang=' . $translang . '&action=edit&id=' . $id);
314
+        $tpl->redirect('translate.php?translang='.$translang.'&action=edit&id='.$id);
315 315
     } else {
316 316
         if (isset($_REQUEST['submit'])) {
317 317
             $transText = isset($_REQUEST['transText']) ? $_REQUEST['transText'] : '';
@@ -347,14 +347,14 @@  discard block
 block discarded – undo
347 347
 
348 348
     // built sql string to search for texts with little difference (levensthein() would be better, but not available in MYSQL)
349 349
     $sWhereSql =
350
-        "SOUNDEX('" . sql_escape($r['text']) . "')=SOUNDEX(`sys_trans`.`text`)
351
-         OR SOUNDEX('" . sql_escape($r['text']) . "')=SOUNDEX(`sys_trans_text`.`text`)";
350
+        "SOUNDEX('".sql_escape($r['text'])."')=SOUNDEX(`sys_trans`.`text`)
351
+         OR SOUNDEX('" . sql_escape($r['text'])."')=SOUNDEX(`sys_trans_text`.`text`)";
352 352
 
353 353
     $trans = sql(
354 354
         "SELECT DISTINCT `sys_trans`.`id`, `sys_trans`.`text`
355 355
          FROM `sys_trans`
356 356
          INNER JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id`
357
-         WHERE `sys_trans`.`id`!='&1' AND (" . $sWhereSql . ")",
357
+         WHERE `sys_trans`.`id`!='&1' AND (" . $sWhereSql.")",
358 358
         $id
359 359
     );
360 360
     $tpl->assign_rs('trans', $trans);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     $translationHandler->createMessageFiles();
389 389
 
390
-    $tpl->redirect('translate.php?translang=' . $translang);
390
+    $tpl->redirect('translate.php?translang='.$translang);
391 391
 }
392 392
 
393 393
 function unlinkFiles($relbasedir, $ext)
@@ -398,12 +398,12 @@  discard block
 block discarded – undo
398 398
         $relbasedir .= '/';
399 399
     }
400 400
 
401
-    if ($opt['rootpath'] . $relbasedir) {
402
-        if ($dh = opendir($opt['rootpath'] . $relbasedir)) {
401
+    if ($opt['rootpath'].$relbasedir) {
402
+        if ($dh = opendir($opt['rootpath'].$relbasedir)) {
403 403
             while (($file = readdir($dh)) !== false) {
404
-                if ($file != '.' && $file != '..' && is_file($opt['rootpath'] . $relbasedir . $file)) {
405
-                    if (substr($file, - (strlen($ext) + 1), strlen($ext) + 1) == '.' . $ext) {
406
-                        unlink($opt['rootpath'] . $relbasedir . $file);
404
+                if ($file != '.' && $file != '..' && is_file($opt['rootpath'].$relbasedir.$file)) {
405
+                    if (substr($file, - (strlen($ext) + 1), strlen($ext) + 1) == '.'.$ext) {
406
+                        unlink($opt['rootpath'].$relbasedir.$file);
407 407
                     }
408 408
                 }
409 409
             }
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     $lastId = sql_value("SELECT MAX(`id`) FROM `sys_trans`", 0);
479 479
     sql("ALTER TABLE `sys_trans` AUTO_INCREMENT = &1", $lastId + 1);
480 480
 
481
-    $tpl->redirect('translate.php?translang=' . $translang);
481
+    $tpl->redirect('translate.php?translang='.$translang);
482 482
 }
483 483
 
484 484
 function useId($freeId)
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
 
501 501
     foreach ($transIdCols as $col) {
502 502
         sql(
503
-            "UPDATE `" . $col['table'] . "`
504
-             SET `" . $col['trans_id'] . "`='&1'
505
-             WHERE `" . $col['trans_id'] . "`='&2'",
503
+            "UPDATE `".$col['table']."`
504
+             SET `" . $col['trans_id']."`='&1'
505
+             WHERE `" . $col['trans_id']."`='&2'",
506 506
             $newId,
507 507
             $oldId
508 508
         );
@@ -513,9 +513,9 @@  discard block
 block discarded – undo
513 513
 {
514 514
     global $opt, $tpl, $translang;
515 515
 
516
-    $structure = enumSqlFiles($opt['rootpath'] . '../sql/tables');
516
+    $structure = enumSqlFiles($opt['rootpath'].'../sql/tables');
517 517
     foreach ($structure AS $sTable) {
518
-        sql_export_structure_to_file($opt['rootpath'] . '../sql/tables/' . $sTable . '.sql', $sTable);
518
+        sql_export_structure_to_file($opt['rootpath'].'../sql/tables/'.$sTable.'.sql', $sTable);
519 519
     }
520 520
 
521 521
     // static data tables
@@ -551,21 +551,21 @@  discard block
 block discarded – undo
551 551
     $stab[] = 'towns';
552 552
     $stab[] = 'watches_waitingtypes';
553 553
 
554
-    sql_export_tables_to_file($opt['rootpath'] . '../sql/static-data/data.sql', $stab);
554
+    sql_export_tables_to_file($opt['rootpath'].'../sql/static-data/data.sql', $stab);
555 555
 
556 556
     $checksum = calcDataSqlChecksum(false);
557
-    $f = fopen($opt['rootpath'] . '../sql/static-data/data.sql', 'a');
557
+    $f = fopen($opt['rootpath'].'../sql/static-data/data.sql', 'a');
558 558
     fwrite(
559 559
         $f,
560 560
         "INSERT INTO `sysconfig` (`name`, `value`)"
561
-        . " VALUES ('datasql_checksum', '" . sql_escape($checksum) . "')"
562
-        . " ON DUPLICATE KEY UPDATE `value`='" . sql_escape($checksum) . "';\n"
561
+        . " VALUES ('datasql_checksum', '".sql_escape($checksum)."')"
562
+        . " ON DUPLICATE KEY UPDATE `value`='".sql_escape($checksum)."';\n"
563 563
     );
564 564
     fclose($f);
565 565
 
566 566
     setSysConfig('datasql_checksum', $checksum);
567 567
 
568
-    $tpl->redirect('translate.php?translang=' . $translang);
568
+    $tpl->redirect('translate.php?translang='.$translang);
569 569
 }
570 570
 
571 571
 function enumSqlFiles($dir)
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
         $hDir = opendir($dir);
595 595
         if ($hDir !== false) {
596 596
             while (($file = readdir($hDir)) !== false) {
597
-                if (is_file($dir . '/' . $file)) {
597
+                if (is_file($dir.'/'.$file)) {
598 598
                     if ((substr($file, - 4) == '.tpl') || (substr($file, - 4) == '.php')) {
599
-                        $files[] = $dir . '/' . $file;
599
+                        $files[] = $dir.'/'.$file;
600 600
                     }
601 601
                 }
602 602
             }
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
         $writer->writeAttribute('id', $r['id']);
691 691
 
692 692
         $writer->writeElement('code', $r['text']);
693
-        for ($n = 0; $n < count($lang); $n ++) {
693
+        for ($n = 0; $n < count($lang); $n++) {
694 694
             $writer->writeElement(
695 695
                 $lang[$n],
696 696
                 sql_value(
@@ -712,9 +712,9 @@  discard block
 block discarded – undo
712 712
         while ($rUsage = sql_fetch_assoc($rsUsage)) {
713 713
             $line = '';
714 714
             if ($rUsage['line'] != 0) {
715
-                $line = ' (' . $rUsage['line'] . ')';
715
+                $line = ' ('.$rUsage['line'].')';
716 716
             }
717
-            $writer->writeElement('usage', $rUsage['resource_name'] . $line);
717
+            $writer->writeElement('usage', $rUsage['resource_name'].$line);
718 718
         }
719 719
         sql_free_result($rsUsage);
720 720
 
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
     $scanlang = [];
740 740
     foreach ($opt['locale'] AS $k => $v) {
741
-        if (isset($_REQUEST['lang' . $k]) && ($_REQUEST['lang' . $k] == '1')) {
741
+        if (isset($_REQUEST['lang'.$k]) && ($_REQUEST['lang'.$k] == '1')) {
742 742
             $scanlang[] = $k;
743 743
         }
744 744
     }
@@ -818,15 +818,15 @@  discard block
 block discarded – undo
818 818
 
819 819
     $nCount = isset($_REQUEST['count']) ? $_REQUEST['count'] + 0 : 0;
820 820
 
821
-    for ($nIndex = 1; $nIndex <= $nCount; $nIndex ++) {
822
-        if (isset($_REQUEST['useitem' . $nIndex]) && ($_REQUEST['useitem' . $nIndex] == '1')) {
823
-            $sCode = base64_decode($_REQUEST['code' . $nIndex]);
821
+    for ($nIndex = 1; $nIndex <= $nCount; $nIndex++) {
822
+        if (isset($_REQUEST['useitem'.$nIndex]) && ($_REQUEST['useitem'.$nIndex] == '1')) {
823
+            $sCode = base64_decode($_REQUEST['code'.$nIndex]);
824 824
             $transId = sql_value("SELECT `id` FROM `sys_trans` WHERE `text`='&1'", 0, $sCode);
825 825
 
826 826
             if ($transId != 0) {
827 827
                 foreach ($opt['locale'] AS $k => $v) {
828
-                    if (isset($_REQUEST[$k . $nIndex . 'new'])) {
829
-                        $sText = base64_decode($_REQUEST[$k . $nIndex . 'new']);
828
+                    if (isset($_REQUEST[$k.$nIndex.'new'])) {
829
+                        $sText = base64_decode($_REQUEST[$k.$nIndex.'new']);
830 830
 
831 831
                         sql(
832 832
                             "INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`)
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
         }
843 843
     }
844 844
 
845
-    $tpl->redirect('translate.php?translang=' . $translang);
845
+    $tpl->redirect('translate.php?translang='.$translang);
846 846
 }
847 847
 
848 848
 function textexport($translang, $all)
@@ -872,9 +872,9 @@  discard block
 block discarded – undo
872 872
             $translang
873 873
         );
874 874
         if (($all) || (mb_strlen($translated) == 0)) {
875
-            $thisline = $r['id'] . "\r\n";
876
-            $thisline .= $r['text'] . "\r\n";
877
-            $thisline .= $translated . "\r\n";
875
+            $thisline = $r['id']."\r\n";
876
+            $thisline .= $r['text']."\r\n";
877
+            $thisline .= $translated."\r\n";
878 878
             $thisline .= "\r\n";
879 879
             echo($thisline);
880 880
         }
@@ -1010,8 +1010,8 @@  discard block
 block discarded – undo
1010 1010
     }
1011 1011
 
1012 1012
     while (($file = readdir($hDir)) !== false) {
1013
-        if ($file != '.' && $file != '..' && is_dir($basedir . $file)) {
1014
-            addClassesDirectoriesToDirlist($basedir . $file);
1013
+        if ($file != '.' && $file != '..' && is_dir($basedir.$file)) {
1014
+            addClassesDirectoriesToDirlist($basedir.$file);
1015 1015
         }
1016 1016
     }
1017 1017
     closedir($hDir);
@@ -1026,9 +1026,9 @@  discard block
 block discarded – undo
1026 1026
         if (!isset($col['verify']) || $col['verify']) {
1027 1027
             $rs = sql(
1028 1028
                 "SELECT
1029
-                    `" . $col['text'] . "` `text`,
1030
-                    `" . $col['trans_id'] . "` `trans_id`
1031
-                 FROM `" . $col['table'] . "`"
1029
+                    `" . $col['text']."` `text`,
1030
+                    `" . $col['trans_id']."` `trans_id`
1031
+                 FROM `" . $col['table']."`"
1032 1032
             );
1033 1033
             while ($r = sql_fetch_assoc($rs)) {
1034 1034
                 $st = sql_value(
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
                 if ($en != $r['text'] || $st != $r['text']) {
1049 1049
                     $inconsistencies[] = [
1050 1050
                         'id' => $r['trans_id'],
1051
-                        'col' => $col['table'] . '.' . $col['text'],
1051
+                        'col' => $col['table'].'.'.$col['text'],
1052 1052
                         'org_text' => $r['text'],
1053 1053
                         'sys_trans' => $st,
1054 1054
                         'en_text' => $en,
Please login to merge, or discard this patch.
htdocs/lib2/logic/gis.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         // number of points in the polygon
30 30
         $n = count($polygon);
31 31
         $poly1 = $polygon[0];
32
-        for ($i = 1; $i <= $n; $i ++) {
32
+        for ($i = 1; $i <= $n; $i++) {
33 33
             $poly1XY = explode(' ', $poly1);
34 34
             $poly1x = $poly1XY[0];
35 35
             $poly1y = $poly1XY[1];
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                         if ($poly1y != $poly2y) {
45 45
                             $xinters = ($py - $poly1y) * ($poly2x - $poly1x) / ($poly2y - $poly1y) + $poly1x;
46 46
                             if ($poly1x == $poly2x || $px <= $xinters) {
47
-                                $counter ++;
47
+                                $counter++;
48 48
                             }
49 49
                         }
50 50
                     }
Please login to merge, or discard this patch.
htdocs/lib2/logic/cracklib.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
     // min. 4 different chars
36 36
     $chars = array();
37
-    for ($i = 0; $i < mb_strlen($pw); $i ++) {
37
+    for ($i = 0; $i < mb_strlen($pw); $i++) {
38 38
         $chars[mb_substr($pw, $i, 1)] = true;
39 39
     }
40 40
 
Please login to merge, or discard this patch.
htdocs/lib2/Net/IDNA2.php 2 patches
Switch Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -2273,38 +2273,38 @@  discard block
 block discarded – undo
2273 2273
 
2274 2274
         foreach ($option as $k => $v) {
2275 2275
             switch ($k) {
2276
-            case 'encoding':
2277
-                switch ($v) {
2278
-                case 'utf8':
2279
-                case 'ucs4_string':
2280
-                case 'ucs4_array':
2281
-                    $this->_api_encoding = $v;
2282
-                    break;
2276
+                case 'encoding':
2277
+                    switch ($v) {
2278
+                        case 'utf8':
2279
+                        case 'ucs4_string':
2280
+                        case 'ucs4_array':
2281
+                            $this->_api_encoding = $v;
2282
+                            break;
2283 2283
 
2284
-                default:
2285
-                    throw new InvalidArgumentException('Set Parameter: Unknown parameter '.$v.' for option '.$k);
2286
-                }
2284
+                        default:
2285
+                            throw new InvalidArgumentException('Set Parameter: Unknown parameter '.$v.' for option '.$k);
2286
+                    }
2287 2287
 
2288 2288
                 break;
2289 2289
 
2290
-            case 'overlong':
2291
-                $this->_allow_overlong = ($v) ? true : false;
2292
-                break;
2290
+                case 'overlong':
2291
+                    $this->_allow_overlong = ($v) ? true : false;
2292
+                    break;
2293 2293
 
2294
-            case 'strict':
2295
-                $this->_strict_mode = ($v) ? true : false;
2296
-                break;
2294
+                case 'strict':
2295
+                    $this->_strict_mode = ($v) ? true : false;
2296
+                    break;
2297 2297
 
2298
-            case 'version':
2299
-                if (in_array($v, array('2003', '2008'))) {
2300
-                    $this->_version = $v;
2301
-                } else {
2302
-                    throw new InvalidArgumentException('Set Parameter: Invalid parameter '.$v.' for option '.$k);
2303
-                }
2304
-                break;
2298
+                case 'version':
2299
+                    if (in_array($v, array('2003', '2008'))) {
2300
+                        $this->_version = $v;
2301
+                    } else {
2302
+                        throw new InvalidArgumentException('Set Parameter: Invalid parameter '.$v.' for option '.$k);
2303
+                    }
2304
+                    break;
2305 2305
 
2306
-            default:
2307
-                return false;
2306
+                default:
2307
+                    return false;
2308 2308
             }
2309 2309
         }
2310 2310
 
@@ -2328,15 +2328,15 @@  discard block
 block discarded – undo
2328 2328
         // Forcing conversion of input to UCS4 array
2329 2329
         // If one time encoding is given, use this, else the objects property
2330 2330
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
2331
-        case 'utf8':
2332
-            $decoded = $this->_utf8_to_ucs4($decoded);
2333
-            break;
2334
-        case 'ucs4_string':
2335
-            $decoded = $this->_ucs4_string_to_ucs4($decoded);
2336
-        case 'ucs4_array': // No break; before this line. Catch case, but do nothing
2337
-            break;
2338
-        default:
2339
-            throw new InvalidArgumentException('Unsupported input format');
2331
+            case 'utf8':
2332
+                $decoded = $this->_utf8_to_ucs4($decoded);
2333
+                break;
2334
+            case 'ucs4_string':
2335
+                $decoded = $this->_ucs4_string_to_ucs4($decoded);
2336
+            case 'ucs4_array': // No break; before this line. Catch case, but do nothing
2337
+                break;
2338
+            default:
2339
+                throw new InvalidArgumentException('Unsupported input format');
2340 2340
         }
2341 2341
 
2342 2342
         // No input, no output, what else did you expect?
@@ -2350,35 +2350,35 @@  discard block
 block discarded – undo
2350 2350
         foreach ($decoded as $k => $v) {
2351 2351
             // Make sure to use just the plain dot
2352 2352
             switch($v) {
2353
-            case 0x3002:
2354
-            case 0xFF0E:
2355
-            case 0xFF61:
2356
-                $decoded[$k] = 0x2E;
2357
-                // It's right, no break here
2358
-                // The codepoints above have to be converted to dots anyway
2359
-
2360
-            // Stumbling across an anchoring character
2361
-            case 0x2E:
2362
-            case 0x2F:
2363
-            case 0x3A:
2364
-            case 0x3F:
2365
-            case 0x40:
2366
-                // Neither email addresses nor URLs allowed in strict mode
2367
-                if ($this->_strict_mode) {
2368
-                    throw new InvalidArgumentException('Neither email addresses nor URLs are allowed in strict mode.');
2369
-                }
2370
-                // Skip first char
2371
-                if ($k) {
2372
-                    $encoded = '';
2373
-                    $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin)));
2374
-                    if ($encoded) {
2375
-                        $output .= $encoded;
2376
-                    } else {
2377
-                        $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin)));
2353
+                case 0x3002:
2354
+                case 0xFF0E:
2355
+                case 0xFF61:
2356
+                    $decoded[$k] = 0x2E;
2357
+                    // It's right, no break here
2358
+                    // The codepoints above have to be converted to dots anyway
2359
+
2360
+                // Stumbling across an anchoring character
2361
+                case 0x2E:
2362
+                case 0x2F:
2363
+                case 0x3A:
2364
+                case 0x3F:
2365
+                case 0x40:
2366
+                    // Neither email addresses nor URLs allowed in strict mode
2367
+                    if ($this->_strict_mode) {
2368
+                        throw new InvalidArgumentException('Neither email addresses nor URLs are allowed in strict mode.');
2378 2369
                     }
2379
-                    $output .= chr($decoded[$k]);
2380
-                }
2381
-                $last_begin = $k + 1;
2370
+                    // Skip first char
2371
+                    if ($k) {
2372
+                        $encoded = '';
2373
+                        $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin)));
2374
+                        if ($encoded) {
2375
+                            $output .= $encoded;
2376
+                        } else {
2377
+                            $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin)));
2378
+                        }
2379
+                        $output .= chr($decoded[$k]);
2380
+                    }
2381
+                    $last_begin = $k + 1;
2382 2382
             }
2383 2383
         }
2384 2384
         // Catch the rest of the string
@@ -2416,12 +2416,12 @@  discard block
 block discarded – undo
2416 2416
         // Optionally set
2417 2417
         if ($one_time_encoding) {
2418 2418
             switch ($one_time_encoding) {
2419
-            case 'utf8':
2420
-            case 'ucs4_string':
2421
-            case 'ucs4_array':
2422
-                break;
2423
-            default:
2424
-                throw new InvalidArgumentException('Unknown encoding '.$one_time_encoding);
2419
+                case 'utf8':
2420
+                case 'ucs4_string':
2421
+                case 'ucs4_array':
2422
+                    break;
2423
+                default:
2424
+                    throw new InvalidArgumentException('Unknown encoding '.$one_time_encoding);
2425 2425
             }
2426 2426
         }
2427 2427
         // Make sure to drop any newline characters around
@@ -2473,17 +2473,17 @@  discard block
 block discarded – undo
2473 2473
         // The output is UTF-8 by default, other output formats need conversion here
2474 2474
         // If one time encoding is given, use this, else the objects property
2475 2475
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
2476
-        case 'utf8':
2477
-            return $return;
2478
-            break;
2479
-        case 'ucs4_string':
2480
-            return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
2481
-            break;
2482
-        case 'ucs4_array':
2483
-            return $this->_utf8_to_ucs4($return);
2484
-            break;
2485
-        default:
2486
-            throw new InvalidArgumentException('Unsupported output format');
2476
+            case 'utf8':
2477
+                return $return;
2478
+                break;
2479
+            case 'ucs4_string':
2480
+                return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
2481
+                break;
2482
+            case 'ucs4_array':
2483
+                return $this->_utf8_to_ucs4($return);
2484
+                break;
2485
+            default:
2486
+                throw new InvalidArgumentException('Unsupported output format');
2487 2487
         }
2488 2488
     }
2489 2489
 
Please login to merge, or discard this patch.
Spacing   +49 added lines, -53 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 //
24 24
 
25 25
 // }}}
26
-require_once __DIR__ . '/IDNA2/Exception.php';
27
-require_once __DIR__ . '/IDNA2/Exception/Nameprep.php';
26
+require_once __DIR__.'/IDNA2/Exception.php';
27
+require_once __DIR__.'/IDNA2/Exception/Nameprep.php';
28 28
 // adjusted paths for OC distribution
29 29
 
30 30
 /**
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
      * @access private
273 273
      */
274 274
     private static $_np_prohibit_ranges = array(
275
-        array(0x80,     0x9F    ),
276
-        array(0x2060,   0x206F  ),
277
-        array(0x1D173,  0x1D17A ),
278
-        array(0xE000,   0xF8FF  ),
279
-        array(0xF0000,  0xFFFFD ),
275
+        array(0x80, 0x9F),
276
+        array(0x2060, 0x206F),
277
+        array(0x1D173, 0x1D17A),
278
+        array(0xE000, 0xF8FF),
279
+        array(0xF0000, 0xFFFFD),
280 280
         array(0x100000, 0x10FFFD),
281
-        array(0xFDD0,   0xFDEF  ),
282
-        array(0xD800,   0xDFFF  ),
283
-        array(0x2FF0,   0x2FFB  ),
284
-        array(0xE0020,  0xE007F )
281
+        array(0xFDD0, 0xFDEF),
282
+        array(0xD800, 0xDFFF),
283
+        array(0x2FF0, 0x2FFB),
284
+        array(0xE0020, 0xE007F)
285 285
     );
286 286
 
287 287
     /**
@@ -2328,8 +2328,7 @@  discard block
 block discarded – undo
2328 2328
         // Forcing conversion of input to UCS4 array
2329 2329
         // If one time encoding is given, use this, else the objects property
2330 2330
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
2331
-        case 'utf8':
2332
-            $decoded = $this->_utf8_to_ucs4($decoded);
2331
+        case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded);
2333 2332
             break;
2334 2333
         case 'ucs4_string':
2335 2334
             $decoded = $this->_ucs4_string_to_ucs4($decoded);
@@ -2349,7 +2348,7 @@  discard block
 block discarded – undo
2349 2348
 
2350 2349
         foreach ($decoded as $k => $v) {
2351 2350
             // Make sure to use just the plain dot
2352
-            switch($v) {
2351
+            switch ($v) {
2353 2352
             case 0x3002:
2354 2353
             case 0xFF0E:
2355 2354
             case 0xFF61:
@@ -2370,11 +2369,11 @@  discard block
 block discarded – undo
2370 2369
                 // Skip first char
2371 2370
                 if ($k) {
2372 2371
                     $encoded = '';
2373
-                    $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin)));
2372
+                    $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k) - $last_begin)));
2374 2373
                     if ($encoded) {
2375 2374
                         $output .= $encoded;
2376 2375
                     } else {
2377
-                        $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin)));
2376
+                        $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k) - $last_begin)));
2378 2377
                     }
2379 2378
                     $output .= chr($decoded[$k]);
2380 2379
                 }
@@ -2385,11 +2384,11 @@  discard block
 block discarded – undo
2385 2384
         if ($last_begin) {
2386 2385
             $inp_len = sizeof($decoded);
2387 2386
             $encoded = '';
2388
-            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
2387
+            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
2389 2388
             if ($encoded) {
2390 2389
                 $output .= $encoded;
2391 2390
             } else {
2392
-                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
2391
+                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
2393 2392
             }
2394 2393
             return $output;
2395 2394
         }
@@ -2440,7 +2439,7 @@  discard block
 block discarded – undo
2440 2439
                 $conv = $this->_decode($v);
2441 2440
                 if ($conv) $arr[$k] = $conv;
2442 2441
             }
2443
-            $return = $email_pref . '@' . join('.', $arr);
2442
+            $return = $email_pref.'@'.join('.', $arr);
2444 2443
         } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters)
2445 2444
             // No no in strict mode
2446 2445
             if ($this->_strict_mode) {
@@ -2473,8 +2472,7 @@  discard block
 block discarded – undo
2473 2472
         // The output is UTF-8 by default, other output formats need conversion here
2474 2473
         // If one time encoding is given, use this, else the objects property
2475 2474
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
2476
-        case 'utf8':
2477
-            return $return;
2475
+        case 'utf8' : return $return;
2478 2476
             break;
2479 2477
         case 'ucs4_string':
2480 2478
             return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
@@ -2507,20 +2505,20 @@  discard block
 block discarded – undo
2507 2505
         if (!empty($parts_arr['user'])) {
2508 2506
             $ret_url .= $parts_arr['user'];
2509 2507
             if (!empty($parts_arr['pass'])) {
2510
-                $ret_url .= ':' . $parts_arr['pass'];
2508
+                $ret_url .= ':'.$parts_arr['pass'];
2511 2509
             }
2512 2510
             $ret_url .= '@';
2513 2511
         }
2514 2512
         $ret_url .= $parts_arr['host'];
2515 2513
         if (!empty($parts_arr['port'])) {
2516
-            $ret_url .= ':' . $parts_arr['port'];
2514
+            $ret_url .= ':'.$parts_arr['port'];
2517 2515
         }
2518 2516
         $ret_url .= $parts_arr['path'];
2519 2517
         if (!empty($parts_arr['query'])) {
2520
-            $ret_url .= '?' . $parts_arr['query'];
2518
+            $ret_url .= '?'.$parts_arr['query'];
2521 2519
         }
2522 2520
         if (!empty($parts_arr['fragment'])) {
2523
-            $ret_url .= '#' . $parts_arr['fragment'];
2521
+            $ret_url .= '#'.$parts_arr['fragment'];
2524 2522
         }
2525 2523
         return $ret_url;
2526 2524
     }
@@ -2598,7 +2596,7 @@  discard block
 block discarded – undo
2598 2596
         }
2599 2597
 
2600 2598
         // Start with the prefix; copy it to output
2601
-        $encoded = $this->_punycode_prefix . $encoded;
2599
+        $encoded = $this->_punycode_prefix.$encoded;
2602 2600
 
2603 2601
         // If we have basic code points in output, add an hyphen to the end
2604 2602
         if ($codecount) {
@@ -2629,9 +2627,8 @@  discard block
 block discarded – undo
2629 2627
                     $delta++;
2630 2628
                 } else if ($decoded[$i] == $cur_code) {
2631 2629
                     for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) {
2632
-                        $t = ($k <= $bias)?
2633
-                            $this->_tmin :
2634
-                            (($k >= $bias + $this->_tmax)? $this->_tmax : $k - $bias);
2630
+                        $t = ($k <= $bias) ?
2631
+                            $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
2635 2632
 
2636 2633
                         if ($q < $t) {
2637 2634
                             break;
@@ -2668,11 +2665,11 @@  discard block
 block discarded – undo
2668 2665
     private function _decode($encoded)
2669 2666
     {
2670 2667
         // We do need to find the Punycode prefix
2671
-        if (!preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $encoded)) {
2668
+        if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) {
2672 2669
             return false;
2673 2670
         }
2674 2671
 
2675
-        $encode_test = preg_replace('!^' . preg_quote($this->_punycode_prefix, '!') . '!', '', $encoded);
2672
+        $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded);
2676 2673
 
2677 2674
         // If nothing left after removing the prefix, it is hopeless
2678 2675
         if (!$encode_test) {
@@ -2699,14 +2696,13 @@  discard block
 block discarded – undo
2699 2696
         $idx      = 0;
2700 2697
         $char     = $this->_initial_n;
2701 2698
 
2702
-        for ($enco_idx = ($delim_pos)? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
2703
-            for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) {
2699
+        for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
2700
+            for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) {
2704 2701
                 $digit = $this->_decodeDigit($encoded{$enco_idx++});
2705 2702
                 $idx += $digit * $w;
2706 2703
 
2707 2704
                 $t = ($k <= $bias) ?
2708
-                    $this->_tmin :
2709
-                    (($k >= $bias + $this->_tmax)? $this->_tmax : ($k - $bias));
2705
+                    $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
2710 2706
 
2711 2707
                 if ($digit < $t) {
2712 2708
                     break;
@@ -2717,7 +2713,7 @@  discard block
 block discarded – undo
2717 2713
 
2718 2714
             $bias      = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first);
2719 2715
             $is_first  = false;
2720
-            $char     += (int) ($idx / ($deco_len + 1));
2716
+            $char     += (int)($idx / ($deco_len + 1));
2721 2717
             $idx      %= ($deco_len + 1);
2722 2718
 
2723 2719
             if ($deco_len > 0) {
@@ -2745,14 +2741,14 @@  discard block
 block discarded – undo
2745 2741
      */
2746 2742
     private function _adapt($delta, $npoints, $is_first)
2747 2743
     {
2748
-        $delta = (int) ($is_first ? ($delta / $this->_damp) : ($delta / 2));
2749
-        $delta += (int) ($delta / $npoints);
2744
+        $delta = (int)($is_first ? ($delta / $this->_damp) : ($delta / 2));
2745
+        $delta += (int)($delta / $npoints);
2750 2746
 
2751 2747
         for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) {
2752
-            $delta = (int) ($delta / ($this->_base - $this->_tmin));
2748
+            $delta = (int)($delta / ($this->_base - $this->_tmin));
2753 2749
         }
2754 2750
 
2755
-        return (int) ($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew));
2751
+        return (int)($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew));
2756 2752
     }
2757 2753
 
2758 2754
     /**
@@ -2779,7 +2775,7 @@  discard block
 block discarded – undo
2779 2775
     private function _decodeDigit($cp)
2780 2776
     {
2781 2777
         $cp = ord($cp);
2782
-        return ($cp - 48 < 10)? $cp - 22 : (($cp - 65 < 26)? $cp - 65 : (($cp - 97 < 26)? $cp - 97 : $this->_base));
2778
+        return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->_base));
2783 2779
     }
2784 2780
 
2785 2781
     /**
@@ -2807,12 +2803,12 @@  discard block
 block discarded – undo
2807 2803
 
2808 2804
             // Try to find prohibited input
2809 2805
             if (in_array($v, self::$_np_prohibit) || in_array($v, self::$_general_prohibited)) {
2810
-                throw new Net_IDNA2_Exception_Nameprep('Prohibited input U+' . sprintf('%08X', $v));
2806
+                throw new Net_IDNA2_Exception_Nameprep('Prohibited input U+'.sprintf('%08X', $v));
2811 2807
             }
2812 2808
 
2813 2809
             foreach (self::$_np_prohibit_ranges as $range) {
2814 2810
                 if ($range[0] <= $v && $v <= $range[1]) {
2815
-                    throw new Net_IDNA2_Exception_Nameprep('Prohibited input U+' . sprintf('%08X', $v));
2811
+                    throw new Net_IDNA2_Exception_Nameprep('Prohibited input U+'.sprintf('%08X', $v));
2816 2812
                 }
2817 2813
             }
2818 2814
 
@@ -2862,7 +2858,7 @@  discard block
 block discarded – undo
2862 2858
                     // Rewind the for loop by one, since there can be more possible compositions
2863 2859
                     $i--;
2864 2860
                     $out_len--;
2865
-                    $last_class = ($i == $last_starter)? 0 : $this->_getCombiningClass($output[$i - 1]);
2861
+                    $last_class = ($i == $last_starter) ? 0 : $this->_getCombiningClass($output[$i - 1]);
2866 2862
 
2867 2863
                     continue;
2868 2864
                 }
@@ -2899,7 +2895,7 @@  discard block
 block discarded – undo
2899 2895
 
2900 2896
         $result   = array();
2901 2897
         $T        = $this->_tbase + $sindex % $this->_tcount;
2902
-        $result[] = (int)($this->_lbase +  $sindex / $this->_ncount);
2898
+        $result[] = (int)($this->_lbase + $sindex / $this->_ncount);
2903 2899
         $result[] = (int)($this->_vbase + ($sindex % $this->_ncount) / $this->_tcount);
2904 2900
 
2905 2901
         if ($T != $this->_tbase) {
@@ -2985,7 +2981,7 @@  discard block
 block discarded – undo
2985 2981
      */
2986 2982
     private function _getCombiningClass($char)
2987 2983
     {
2988
-        return isset(self::$_np_norm_combcls[$char])? self::$_np_norm_combcls[$char] : 0;
2984
+        return isset(self::$_np_norm_combcls[$char]) ? self::$_np_norm_combcls[$char] : 0;
2989 2985
     }
2990 2986
 
2991 2987
     /**
@@ -3146,7 +3142,7 @@  discard block
 block discarded – undo
3146 3142
                     throw new UnexpectedValueException('This might be UTF-8, but I don\'t understand it at byte '.$k);
3147 3143
                 }
3148 3144
                 if ('add' == $mode) {
3149
-                    $output[$out_len] = (int) $v;
3145
+                    $output[$out_len] = (int)$v;
3150 3146
                     ++$out_len;
3151 3147
                     continue;
3152 3148
                 }
@@ -3205,14 +3201,14 @@  discard block
 block discarded – undo
3205 3201
                 // 4 bytes
3206 3202
                 $output .= chr(240 + ($v >> 18))
3207 3203
                     . chr(128 + (($v >> 12) & 63))
3208
-                    . chr(128 + (($v >>  6) & 63))
3204
+                    . chr(128 + (($v >> 6) & 63))
3209 3205
                     . chr(128 + ($v & 63));
3210 3206
             } else if ($v < 1 << 26) {
3211 3207
                 // 5 bytes
3212 3208
                 $output .= chr(248 + ($v >> 24))
3213 3209
                     . chr(128 + (($v >> 18) & 63))
3214 3210
                     . chr(128 + (($v >> 12) & 63))
3215
-                    . chr(128 + (($v >>  6) & 63))
3211
+                    . chr(128 + (($v >> 6) & 63))
3216 3212
                     . chr(128 + ($v & 63));
3217 3213
             } else if ($v < 1 << 31) {
3218 3214
                 // 6 bytes
@@ -3220,7 +3216,7 @@  discard block
 block discarded – undo
3220 3216
                     . chr(128 + (($v >> 24) & 63))
3221 3217
                     . chr(128 + (($v >> 18) & 63))
3222 3218
                     . chr(128 + (($v >> 12) & 63))
3223
-                    . chr(128 + (($v >>  6) & 63))
3219
+                    . chr(128 + (($v >> 6) & 63))
3224 3220
                     . chr(128 + ($v & 63));
3225 3221
             } else {
3226 3222
                 throw new UnexpectedValueException('Conversion from UCS-4 to UTF-8 failed: malformed input');
@@ -3245,7 +3241,7 @@  discard block
 block discarded – undo
3245 3241
         // Take array values and split output to 4 bytes per value
3246 3242
         // The bit mask is 255, which reads &11111111
3247 3243
         foreach ($input as $v) {
3248
-            $output .= ($v & (255 << 24) >> 24) . ($v & (255 << 16) >> 16) . ($v & (255 << 8) >> 8) . ($v & 255);
3244
+            $output .= ($v & (255 << 24) >> 24).($v & (255 << 16) >> 16).($v & (255 << 8) >> 8).($v & 255);
3249 3245
         }
3250 3246
         return $output;
3251 3247
     }
@@ -3280,7 +3276,7 @@  discard block
 block discarded – undo
3280 3276
                 $out_len++;
3281 3277
                 $output[$out_len] = 0;
3282 3278
             }
3283
-            $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
3279
+            $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4)));
3284 3280
         }
3285 3281
         return $output;
3286 3282
     }
@@ -3331,7 +3327,7 @@  discard block
 block discarded – undo
3331 3327
         $return = '';
3332 3328
 
3333 3329
         for ($i = $w; $i > -1; $i--) {
3334
-            $return .= ($octet & (1 << $i))? '1' : '0';
3330
+            $return .= ($octet & (1 << $i)) ? '1' : '0';
3335 3331
         }
3336 3332
 
3337 3333
         return $return;
Please login to merge, or discard this patch.
htdocs/lib2/pager.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
             $to_page = min($last_page, max($first_page, $current_page - $lrspan) + $this->max_pages_shown - 1);
60 60
             $from_page = max($first_page, $to_page - $this->max_pages_shown + 1);
61 61
 
62
-            for ($page = $from_page; $page <= $to_page; $page ++) {
62
+            for ($page = $from_page; $page <= $to_page; $page++) {
63 63
                 if ($page == $current_page) {
64 64
                     $pages[$page] = false;
65 65
                 } else {
Please login to merge, or discard this patch.
htdocs/lib2/login.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@
 block discarded – undo
20 20
  *
21 21
  ***************************************************************************/
22 22
 
23
-define('LOGIN_UNKNOWN_ERROR', - 1);     // unkown error occured
24
-define('LOGIN_OK', 0);                 // login succeeded
25
-define('LOGIN_BADUSERPW', 1);          // bad username or password
26
-define('LOGIN_TOOMUCHLOGINS', 2);      // too many logins in short time
27
-define('LOGIN_USERNOTACTIVE', 3);      // the useraccount locked
23
+define('LOGIN_UNKNOWN_ERROR', - 1); // unkown error occured
24
+define('LOGIN_OK', 0); // login succeeded
25
+define('LOGIN_BADUSERPW', 1); // bad username or password
26
+define('LOGIN_TOOMUCHLOGINS', 2); // too many logins in short time
27
+define('LOGIN_USERNOTACTIVE', 3); // the useraccount locked
28 28
 define('LOGIN_EMPTY_USERPASSWORD', 4); // given username/password was empty
29
-define('LOGIN_LOGOUT_OK', 5);          // logout was successfull
29
+define('LOGIN_LOGOUT_OK', 5); // logout was successfull
30 30
 
31 31
 // login times in seconds
32 32
 define('LOGIN_TIME', 60 * 60);
Please login to merge, or discard this patch.
htdocs/ignore.php 2 patches
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 }
30 30
 
31 31
 switch ($action) {
32
-    case 'addignore':
33
-        sql("INSERT IGNORE INTO `cache_ignore` (`cache_id`, `user_id`) VALUES ('&1', '&2')", $cache_id, $login->userid);
34
-        break;
35
-    case 'removeignore':
36
-        sql("DELETE FROM `cache_ignore` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $login->userid);
37
-        break;
32
+        case 'addignore':
33
+            sql("INSERT IGNORE INTO `cache_ignore` (`cache_id`, `user_id`) VALUES ('&1', '&2')", $cache_id, $login->userid);
34
+            break;
35
+        case 'removeignore':
36
+            sql("DELETE FROM `cache_ignore` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $login->userid);
37
+            break;
38 38
 }
39 39
 
40 40
 // clear cached map result, so that the change directly appears on the map
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-require __DIR__ . '/lib2/web.inc.php';
8
+require __DIR__.'/lib2/web.inc.php';
9 9
 
10 10
 $cache_id = isset($_GET['cacheid']) ? $_GET['cacheid'] + 0 : 0;
11 11
 $action = isset($_GET['action']) ? $_GET['action'] : '';
12
-$target = isset($_GET['target']) ? $_GET['target'] : 'viewcache.php?cacheid=' . $cache_id;
12
+$target = isset($_GET['target']) ? $_GET['target'] : 'viewcache.php?cacheid='.$cache_id;
13 13
 
14 14
 $login->verify();
15 15
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $map_result_id = sql_value(
42 42
     "SELECT `result_id`
43 43
      FROM `map2_result`
44
-     WHERE INSTR(sqlquery,\"`user_id`='" . sql_escape($login->userid) . "'\")
44
+     WHERE INSTR(sqlquery,\"`user_id`='" . sql_escape($login->userid)."'\")
45 45
      LIMIT 1",
46 46
     0
47 47
 );
Please login to merge, or discard this patch.