Completed
Pull Request — master (#313)
by Thomas
15:47 queued 06:00
created
htdocs/editdesc.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,9 +19,12 @@  discard block
 block discarded – undo
19 19
     require $stylepath . '/editdesc.inc.php';
20 20
 
21 21
     // check for old-style parameters
22
-    if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid']))  // Ocprop
22
+    if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid'])) {
23
+        // Ocprop
23 24
     {
24
-        $cache_id = $_REQUEST['cacheid'];  // Ocprop
25
+        $cache_id = $_REQUEST['cacheid'];
26
+    }
27
+    // Ocprop
25 28
         $desc_lang = $_REQUEST['desclang'];  // Ocprop
26 29
 
27 30
         $rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang);
@@ -87,10 +90,13 @@  discard block
 block discarded – undo
87 90
                 $show_all_langs = false;
88 91
 
89 92
                 //save to DB?
90
-                if (isset($_POST['post']))  // Ocprop
93
+                if (isset($_POST['post'])) {
94
+                    // Ocprop
91 95
                 {
92 96
                     //here we read all used information from the form if submitted
93
-                    $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1;  // Ocprop
97
+                    $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1;
98
+                }
99
+                // Ocprop
94 100
 
95 101
                     // fuer alte Versionen von OCProp
96 102
                     if (isset($_POST['submit']) && !isset($_POST['version2'])) {
@@ -147,7 +153,8 @@  discard block
 block discarded – undo
147 153
 
148 154
                     $desc = processEditorInput($oldDescMode, $descMode, $desc);
149 155
 
150
-                    if (isset($_POST['submitform']))  // Ocprop
156
+                    if (isset($_POST['submitform'])) {
157
+                        // Ocprop
151 158
                     {
152 159
                         // prüfen, ob sprache nicht schon vorhanden
153 160
                         $rs = sql(
@@ -160,6 +167,7 @@  discard block
 block discarded – undo
160 167
                             $descid,
161 168
                             $desclang
162 169
                         );
170
+                    }
163 171
                         $r = sql_fetch_array($rs);
164 172
                         if ($r['count'] > 0) {
165 173
                             tpl_errorMsg('editdesc', $error_desc_exists);
@@ -224,8 +232,7 @@  discard block
 block discarded – undo
224 232
 
225 233
                     if ($oldDescMode == 0) {
226 234
                         $desc = processEditorInput($oldDescMode, $descMode, $desc_record['desc']);
227
-                    }
228
-                    else {
235
+                    } else {
229 236
                         $desc = $desc_record['desc'];
230 237
                     }
231 238
                 }
Please login to merge, or discard this patch.
htdocs/resource2/tinymce/config/log.js.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
   if (isset($_REQUEST['lang'])) {
3 3
     $lang = $_REQUEST['lang'];
4
-  }
5
-  else {
4
+  } else {
6 5
     $lang = 'de';
7 6
   }
8 7
 ?>
Please login to merge, or discard this patch.
htdocs/resource2/tinymce/config/desc.js.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,14 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
   if (isset($_REQUEST['cacheid'])) {
3 3
     $cacheID = $_REQUEST['cacheid'];
4
-  }
5
-  else {
4
+  } else {
6 5
     $cacheID = 0;
7 6
   }
8 7
   if (isset($_REQUEST['lang'])) {
9 8
     $lang = $_REQUEST['lang'];
10
-  }
11
-  else {
9
+  } else {
12 10
     $lang = 'de';
13 11
   }
14 12
 ?>
Please login to merge, or discard this patch.
htdocs/resource2/tinymce/config/user.js.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2
-  if (isset($_REQUEST['lang']))
3
-    $lang = $_REQUEST['lang'];
4
-  else
5
-    $lang = 'de';
6
-?>
2
+  if (isset($_REQUEST['lang'])) {
3
+      $lang = $_REQUEST['lang'];
4
+  } else {
5
+      $lang = 'de';
6
+  }
7
+  ?>
7 8
 
8 9
 tinyMCE_GZ.init({
9 10
     plugins : 'advhr,contextmenu,emotions,insertdatetime,paste,table',
Please login to merge, or discard this patch.
htdocs/mailto.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
 $text = isset($_REQUEST['text']) ? $_REQUEST['text'] : '';
56 56
 if (isset($_REQUEST['emailaddress'])) {
57 57
     $bEmailaddress = ($_REQUEST['emailaddress'] == 1);
58
-}
59
-else {
58
+} else {
60 59
     $own_user = new user($login->userid);
61 60
     $bEmailaddress = $own_user->getUsermailSendAddress();
62 61
 }
Please login to merge, or discard this patch.
htdocs/translate.php 1 patch
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.
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.
Braces   +36 added lines, -16 removed lines patch added patch discarded remove patch
@@ -2340,7 +2340,9 @@  discard block
 block discarded – undo
2340 2340
         }
2341 2341
 
2342 2342
         // No input, no output, what else did you expect?
2343
-        if (empty($decoded)) return '';
2343
+        if (empty($decoded)) {
2344
+            return '';
2345
+        }
2344 2346
 
2345 2347
         // Anchors for iteration
2346 2348
         $last_begin = 0;
@@ -2429,7 +2431,8 @@  discard block
 block discarded – undo
2429 2431
 
2430 2432
         // Negotiate input and try to determine, wether it is a plain string,
2431 2433
         // an email address or something like a complete URL
2432
-        if (strpos($input, '@')) { // Maybe it is an email address
2434
+        if (strpos($input, '@')) {
2435
+// Maybe it is an email address
2433 2436
             // No no in strict mode
2434 2437
             if ($this->_strict_mode) {
2435 2438
                 throw new InvalidArgumentException('Only simple domain name parts can be handled in strict mode');
@@ -2438,10 +2441,13 @@  discard block
 block discarded – undo
2438 2441
             $arr = explode('.', $input);
2439 2442
             foreach ($arr as $k => $v) {
2440 2443
                 $conv = $this->_decode($v);
2441
-                if ($conv) $arr[$k] = $conv;
2444
+                if ($conv) {
2445
+                    $arr[$k] = $conv;
2446
+                }
2442 2447
             }
2443 2448
             $return = $email_pref . '@' . join('.', $arr);
2444
-        } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters)
2449
+        } elseif (preg_match('![:\./]!', $input)) {
2450
+// Or a complete domain name (with or without paths / parameters)
2445 2451
             // No no in strict mode
2446 2452
             if ($this->_strict_mode) {
2447 2453
                 throw new InvalidArgumentException('Only simple domain name parts can be handled in strict mode');
@@ -2452,22 +2458,28 @@  discard block
 block discarded – undo
2452 2458
                 $arr = explode('.', $parsed['host']);
2453 2459
                 foreach ($arr as $k => $v) {
2454 2460
                     $conv = $this->_decode($v);
2455
-                    if ($conv) $arr[$k] = $conv;
2461
+                    if ($conv) {
2462
+                        $arr[$k] = $conv;
2463
+                    }
2456 2464
                 }
2457 2465
                 $parsed['host'] = join('.', $arr);
2458 2466
                 if (isset($parsed['scheme'])) {
2459 2467
                     $parsed['scheme'] .= (strtolower($parsed['scheme']) == 'mailto') ? ':' : '://';
2460 2468
                 }
2461 2469
                 $return = $this->_unparse_url($parsed);
2462
-            } else { // parse_url seems to have failed, try without it
2470
+            } else {
2471
+// parse_url seems to have failed, try without it
2463 2472
                 $arr = explode('.', $input);
2464 2473
                 foreach ($arr as $k => $v) {
2465 2474
                     $conv = $this->_decode($v);
2466
-                    if ($conv) $arr[$k] = $conv;
2475
+                    if ($conv) {
2476
+                        $arr[$k] = $conv;
2477
+                    }
2467 2478
                 }
2468 2479
                 $return = join('.', $arr);
2469 2480
             }
2470
-        } else { // Otherwise we consider it being a pure domain name string
2481
+        } else {
2482
+// Otherwise we consider it being a pure domain name string
2471 2483
             $return = $this->_decode($input);
2472 2484
         }
2473 2485
         // The output is UTF-8 by default, other output formats need conversion here
@@ -3115,7 +3127,8 @@  discard block
 block discarded – undo
3115 3127
         for ($k = 0; $k < $inp_len; ++$k) {
3116 3128
             $v = ord($input{$k}); // Extract byte from input string
3117 3129
 
3118
-            if ($v < 128) { // We found an ASCII char - put into stirng as is
3130
+            if ($v < 128) {
3131
+// We found an ASCII char - put into stirng as is
3119 3132
                 $output[$out_len] = $v;
3120 3133
                 ++$out_len;
3121 3134
                 if ('add' == $mode) {
@@ -3123,23 +3136,29 @@  discard block
 block discarded – undo
3123 3136
                 }
3124 3137
                 continue;
3125 3138
             }
3126
-            if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char
3139
+            if ('next' == $mode) {
3140
+// Try to find the next start byte; determine the width of the Unicode char
3127 3141
                 $start_byte = $v;
3128 3142
                 $mode = 'add';
3129 3143
                 $test = 'range';
3130
-                if ($v >> 5 == 6) { // &110xxxxx 10xxxxx
3144
+                if ($v >> 5 == 6) {
3145
+// &110xxxxx 10xxxxx
3131 3146
                     $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left
3132 3147
                     $v = ($v - 192) << 6;
3133
-                } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx
3148
+                } elseif ($v >> 4 == 14) {
3149
+// &1110xxxx 10xxxxxx 10xxxxxx
3134 3150
                     $next_byte = 1;
3135 3151
                     $v = ($v - 224) << 12;
3136
-                } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
3152
+                } elseif ($v >> 3 == 30) {
3153
+// &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
3137 3154
                     $next_byte = 2;
3138 3155
                     $v = ($v - 240) << 18;
3139
-                } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
3156
+                } elseif ($v >> 2 == 62) {
3157
+// &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
3140 3158
                     $next_byte = 3;
3141 3159
                     $v = ($v - 248) << 24;
3142
-                } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
3160
+                } elseif ($v >> 1 == 126) {
3161
+// &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
3143 3162
                     $next_byte = 4;
3144 3163
                     $v = ($v - 252) << 30;
3145 3164
                 } else {
@@ -3158,7 +3177,8 @@  discard block
 block discarded – undo
3158 3177
                         throw new OutOfRangeException('Bogus UTF-8 character detected (out of legal range) at byte '.$k);
3159 3178
                     }
3160 3179
                 }
3161
-                if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx
3180
+                if ($v >> 6 == 2) {
3181
+// Bit mask must be 10xxxxxx
3162 3182
                     $v = ($v - 128) << ($next_byte * 6);
3163 3183
                     $output[($out_len - 1)] += $v;
3164 3184
                     --$next_byte;
Please login to merge, or discard this patch.
htdocs/lib2/db.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -894,8 +894,9 @@
 block discarded – undo
894 894
     }
895 895
 
896 896
     if ($db['dblink_slave'] !== false) {
897
-        if (mysql_select_db($opt['db']['placeholder']['db'], $db['dblink_slave']) == false)
898
-            sql_error();
897
+        if (mysql_select_db($opt['db']['placeholder']['db'], $db['dblink_slave']) == false) {
898
+                    sql_error();
899
+        }
899 900
 
900 901
         mysql_query("SET NAMES '" . mysql_real_escape_string($opt['charset']['mysql'], $db['dblink_slave']) . "'", $db['dblink_slave']);
901 902
 
Please login to merge, or discard this patch.
htdocs/okapi/services/replicate/changelog.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,13 +29,18 @@
 block discarded – undo
29 29
         require_once('replicate_common.inc.php');
30 30
 
31 31
         $since = $request->get_parameter('since');
32
-        if ($since === null) throw new ParamMissing('since');
33
-        if ((int)$since != $since) throw new InvalidParam('since');
32
+        if ($since === null) {
33
+            throw new ParamMissing('since');
34
+        }
35
+        if ((int)$since != $since) {
36
+            throw new InvalidParam('since');
37
+        }
34 38
 
35 39
         # Let's check the $since parameter.
36 40
 
37
-        if (!ReplicateCommon::check_since_param($since))
38
-            throw new BadRequest("The 'since' parameter is too old. You must update your database more frequently.");
41
+        if (!ReplicateCommon::check_since_param($since)) {
42
+                    throw new BadRequest("The 'since' parameter is too old. You must update your database more frequently.");
43
+        }
39 44
 
40 45
         # Select a best chunk for the given $since, get the chunk from the database (or cache).
41 46
 
Please login to merge, or discard this patch.