@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | if ($c === $n) { |
243 | 243 | $q = $delta; |
244 | - for ($k = static::BASE;; $k += static::BASE) { |
|
244 | + for ($k = static::BASE; ; $k += static::BASE) { |
|
245 | 245 | $t = $this->calculateThreshold($k, $bias); |
246 | 246 | if ($q < $t) { |
247 | 247 | break; |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $oldi = $i; |
345 | 345 | $w = 1; |
346 | 346 | |
347 | - for ($k = static::BASE;; $k += static::BASE) |
|
347 | + for ($k = static::BASE; ; $k += static::BASE) |
|
348 | 348 | { |
349 | 349 | if (!isset($input[$pos]) || !isset(static::$decodeTable[$input[$pos]])) |
350 | 350 | return false; |
@@ -157,12 +157,14 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | $parts = explode('.', $preprocessed); |
160 | - foreach ($parts as $p => &$part) { |
|
160 | + foreach ($parts as $p => &$part) |
|
161 | + { |
|
161 | 162 | $part = $this->encodePart($part); |
162 | 163 | |
163 | 164 | $validation_status = $this->validateLabel($part, true); |
164 | 165 | |
165 | - switch ($validation_status) { |
|
166 | + switch ($validation_status) |
|
167 | + { |
|
166 | 168 | case self::IDNA_ERROR_LABEL_TOO_LONG: |
167 | 169 | case self::IDNA_ERROR_LEADING_HYPHEN: |
168 | 170 | case self::IDNA_ERROR_TRAILING_HYPHEN: |
@@ -215,13 +217,16 @@ discard block |
||
215 | 217 | $h = $b = count($codePoints['basic']); |
216 | 218 | |
217 | 219 | $output = ''; |
218 | - foreach ($codePoints['basic'] as $code) { |
|
220 | + foreach ($codePoints['basic'] as $code) |
|
221 | + { |
|
219 | 222 | $output .= $this->codePointToChar($code); |
220 | 223 | } |
221 | - if ($input === $output) { |
|
224 | + if ($input === $output) |
|
225 | + { |
|
222 | 226 | return $output; |
223 | 227 | } |
224 | - if ($b > 0) { |
|
228 | + if ($b > 0) |
|
229 | + { |
|
225 | 230 | $output .= static::DELIMITER; |
226 | 231 | } |
227 | 232 | |
@@ -230,20 +235,26 @@ discard block |
||
230 | 235 | |
231 | 236 | $i = 0; |
232 | 237 | $length = mb_strlen($input, $this->encoding); |
233 | - while ($h < $length) { |
|
238 | + while ($h < $length) |
|
239 | + { |
|
234 | 240 | $m = $codePoints['nonBasic'][$i++]; |
235 | 241 | $delta = $delta + ($m - $n) * ($h + 1); |
236 | 242 | $n = $m; |
237 | 243 | |
238 | - foreach ($codePoints['all'] as $c) { |
|
239 | - if ($c < $n || $c < static::INITIAL_N) { |
|
244 | + foreach ($codePoints['all'] as $c) |
|
245 | + { |
|
246 | + if ($c < $n || $c < static::INITIAL_N) |
|
247 | + { |
|
240 | 248 | $delta++; |
241 | 249 | } |
242 | - if ($c === $n) { |
|
250 | + if ($c === $n) |
|
251 | + { |
|
243 | 252 | $q = $delta; |
244 | - for ($k = static::BASE;; $k += static::BASE) { |
|
253 | + for ($k = static::BASE;; $k += static::BASE) |
|
254 | + { |
|
245 | 255 | $t = $this->calculateThreshold($k, $bias); |
246 | - if ($q < $t) { |
|
256 | + if ($q < $t) |
|
257 | + { |
|
247 | 258 | break; |
248 | 259 | } |
249 | 260 |
@@ -121,7 +121,7 @@ |
||
121 | 121 | |
122 | 122 | $files = array_unique(array_merge($always_update, array_filter( |
123 | 123 | explode("\n", shell_exec('git diff --name-only v' . $prev_version . '...HEAD')), |
124 | - function ($filename) |
|
124 | + function($filename) |
|
125 | 125 | { |
126 | 126 | return file_exists($filename) && strpos(mime_content_type($filename), 'text/') === 0; |
127 | 127 | } |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | } |
930 | 930 | } |
931 | 931 | // This sort works decently well to ensure widely used scripts are ranked before rare scripts. |
932 | -uasort($funcs['utf8_regex_joining_type']['data'], function ($a, $b) |
|
932 | +uasort($funcs['utf8_regex_joining_type']['data'], function($a, $b) |
|
933 | 933 | { |
934 | 934 | if ($a['stats']['age'] == $b['stats']['age']) |
935 | 935 | { |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | } |
1005 | 1005 | } |
1006 | 1006 | // Again, sort commonly used scripts before rare scripts. |
1007 | -uasort($funcs['utf8_regex_indic']['data'], function ($a, $b) |
|
1007 | +uasort($funcs['utf8_regex_indic']['data'], function($a, $b) |
|
1008 | 1008 | { |
1009 | 1009 | if ($a['stats']['age'] == $b['stats']['age']) |
1010 | 1010 | { |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | |
1286 | 1286 | $func_text = rtrim($func_text); |
1287 | 1287 | |
1288 | - $func_text .= $nextline . implode(' .' . $nextline, array_map(function ($v) { return var_export($v, true); }, $value)); |
|
1288 | + $func_text .= $nextline . implode(' .' . $nextline, array_map(function($v) { return var_export($v, true); }, $value)); |
|
1289 | 1289 | } |
1290 | 1290 | else |
1291 | 1291 | { |
@@ -1285,7 +1285,9 @@ |
||
1285 | 1285 | |
1286 | 1286 | $func_text = rtrim($func_text); |
1287 | 1287 | |
1288 | - $func_text .= $nextline . implode(' .' . $nextline, array_map(function ($v) { return var_export($v, true); }, $value)); |
|
1288 | + $func_text .= $nextline . implode(' .' . $nextline, array_map(function ($v) |
|
1289 | + { |
|
1290 | +return var_export($v, true); }, $value)); |
|
1289 | 1291 | } |
1290 | 1292 | else |
1291 | 1293 | { |
@@ -1092,7 +1092,7 @@ |
||
1092 | 1092 | // PHP currently has a terrible handling with unserialize in which errors are fatal and not catchable. Lets borrow some code from the RFC that intends to fix this |
1093 | 1093 | // https://wiki.php.net/rfc/improve_unserialize_error_handling |
1094 | 1094 | try { |
1095 | - set_error_handler(static function ($severity, $message, $file, $line) { |
|
1095 | + set_error_handler(static function ($severity, $message, $file, $line) { |
|
1096 | 1096 | throw new \ErrorException($message, 0, $severity, $file, $line); |
1097 | 1097 | }); |
1098 | 1098 | $ser_test = @unserialize($modSettings['attachmentUploadDir']); |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $to = explode('/', $lang_dir); |
547 | 547 | $relPath = $to; |
548 | 548 | |
549 | - foreach($from as $depth => $dir) |
|
549 | + foreach ($from as $depth => $dir) |
|
550 | 550 | { |
551 | 551 | if ($dir === $to[$depth]) |
552 | 552 | array_shift($relPath); |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | // PHP currently has a terrible handling with unserialize in which errors are fatal and not catchable. Lets borrow some code from the RFC that intends to fix this |
1093 | 1093 | // https://wiki.php.net/rfc/improve_unserialize_error_handling |
1094 | 1094 | try { |
1095 | - set_error_handler(static function ($severity, $message, $file, $line) { |
|
1095 | + set_error_handler(static function($severity, $message, $file, $line) { |
|
1096 | 1096 | throw new \ErrorException($message, 0, $severity, $file, $line); |
1097 | 1097 | }); |
1098 | 1098 | $ser_test = @unserialize($modSettings['attachmentUploadDir']); |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | // An array already? |
1122 | 1122 | elseif (is_array($modSettings['attachmentUploadDir'])) |
1123 | 1123 | { |
1124 | - foreach($modSettings['attachmentUploadDir'] AS $dir) |
|
1124 | + foreach ($modSettings['attachmentUploadDir'] AS $dir) |
|
1125 | 1125 | if (!empty($dir) && !is_dir($dir)) |
1126 | 1126 | $attdr_problem_found = true; |
1127 | 1127 | } |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | { |
1131 | 1131 | if (is_array($ser_test)) |
1132 | 1132 | { |
1133 | - foreach($ser_test AS $dir) |
|
1133 | + foreach ($ser_test AS $dir) |
|
1134 | 1134 | { |
1135 | 1135 | if (!empty($dir) && !is_dir($dir)) |
1136 | 1136 | $attdr_problem_found = true; |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | { |
1148 | 1148 | if (is_array($json_test)) |
1149 | 1149 | { |
1150 | - foreach($json_test AS $dir) |
|
1150 | + foreach ($json_test AS $dir) |
|
1151 | 1151 | { |
1152 | 1152 | if (!is_dir($dir)) |
1153 | 1153 | $attdr_problem_found = true; |
@@ -3147,94 +3147,94 @@ discard block |
||
3147 | 3147 | // Translation table for the character sets not native for MySQL. |
3148 | 3148 | $translation_tables = array( |
3149 | 3149 | 'windows-1255' => array( |
3150 | - '0x81' => '\'\'', '0x8A' => '\'\'', '0x8C' => '\'\'', |
|
3151 | - '0x8D' => '\'\'', '0x8E' => '\'\'', '0x8F' => '\'\'', |
|
3152 | - '0x90' => '\'\'', '0x9A' => '\'\'', '0x9C' => '\'\'', |
|
3153 | - '0x9D' => '\'\'', '0x9E' => '\'\'', '0x9F' => '\'\'', |
|
3154 | - '0xCA' => '\'\'', '0xD9' => '\'\'', '0xDA' => '\'\'', |
|
3155 | - '0xDB' => '\'\'', '0xDC' => '\'\'', '0xDD' => '\'\'', |
|
3156 | - '0xDE' => '\'\'', '0xDF' => '\'\'', '0xFB' => '0xD792', |
|
3157 | - '0xFC' => '0xE282AC', '0xFF' => '0xD6B2', '0xC2' => '0xFF', |
|
3158 | - '0x80' => '0xFC', '0xE2' => '0xFB', '0xA0' => '0xC2A0', |
|
3159 | - '0xA1' => '0xC2A1', '0xA2' => '0xC2A2', '0xA3' => '0xC2A3', |
|
3160 | - '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3161 | - '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3162 | - '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3163 | - '0xAF' => '0xC2AF', '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', |
|
3164 | - '0xB2' => '0xC2B2', '0xB3' => '0xC2B3', '0xB4' => '0xC2B4', |
|
3165 | - '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3166 | - '0xB8' => '0xC2B8', '0xB9' => '0xC2B9', '0xBB' => '0xC2BB', |
|
3167 | - '0xBC' => '0xC2BC', '0xBD' => '0xC2BD', '0xBE' => '0xC2BE', |
|
3168 | - '0xBF' => '0xC2BF', '0xD7' => '0xD7B3', '0xD1' => '0xD781', |
|
3169 | - '0xD4' => '0xD7B0', '0xD5' => '0xD7B1', '0xD6' => '0xD7B2', |
|
3170 | - '0xE0' => '0xD790', '0xEA' => '0xD79A', '0xEC' => '0xD79C', |
|
3171 | - '0xED' => '0xD79D', '0xEE' => '0xD79E', '0xEF' => '0xD79F', |
|
3172 | - '0xF0' => '0xD7A0', '0xF1' => '0xD7A1', '0xF2' => '0xD7A2', |
|
3173 | - '0xF3' => '0xD7A3', '0xF5' => '0xD7A5', '0xF6' => '0xD7A6', |
|
3174 | - '0xF7' => '0xD7A7', '0xF8' => '0xD7A8', '0xF9' => '0xD7A9', |
|
3175 | - '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3176 | - '0x86' => '0xE280A0', '0x87' => '0xE280A1', '0x89' => '0xE280B0', |
|
3177 | - '0x8B' => '0xE280B9', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3178 | - '0x95' => '0xE280A2', '0x97' => '0xE28094', '0x99' => '0xE284A2', |
|
3179 | - '0xC0' => '0xD6B0', '0xC1' => '0xD6B1', '0xC3' => '0xD6B3', |
|
3180 | - '0xC4' => '0xD6B4', '0xC5' => '0xD6B5', '0xC6' => '0xD6B6', |
|
3181 | - '0xC7' => '0xD6B7', '0xC8' => '0xD6B8', '0xC9' => '0xD6B9', |
|
3182 | - '0xCB' => '0xD6BB', '0xCC' => '0xD6BC', '0xCD' => '0xD6BD', |
|
3183 | - '0xCE' => '0xD6BE', '0xCF' => '0xD6BF', '0xD0' => '0xD780', |
|
3184 | - '0xD2' => '0xD782', '0xE3' => '0xD793', '0xE4' => '0xD794', |
|
3185 | - '0xE5' => '0xD795', '0xE7' => '0xD797', '0xE9' => '0xD799', |
|
3186 | - '0xFD' => '0xE2808E', '0xFE' => '0xE2808F', '0x92' => '0xE28099', |
|
3187 | - '0x83' => '0xC692', '0xD3' => '0xD783', '0x88' => '0xCB86', |
|
3188 | - '0x98' => '0xCB9C', '0x91' => '0xE28098', '0x96' => '0xE28093', |
|
3189 | - '0xBA' => '0xC3B7', '0x9B' => '0xE280BA', '0xAA' => '0xC397', |
|
3190 | - '0xA4' => '0xE282AA', '0xE1' => '0xD791', '0xE6' => '0xD796', |
|
3191 | - '0xE8' => '0xD798', '0xEB' => '0xD79B', '0xF4' => '0xD7A4', |
|
3150 | + '0x81' => '\'\'', '0x8A' => '\'\'', '0x8C' => '\'\'', |
|
3151 | + '0x8D' => '\'\'', '0x8E' => '\'\'', '0x8F' => '\'\'', |
|
3152 | + '0x90' => '\'\'', '0x9A' => '\'\'', '0x9C' => '\'\'', |
|
3153 | + '0x9D' => '\'\'', '0x9E' => '\'\'', '0x9F' => '\'\'', |
|
3154 | + '0xCA' => '\'\'', '0xD9' => '\'\'', '0xDA' => '\'\'', |
|
3155 | + '0xDB' => '\'\'', '0xDC' => '\'\'', '0xDD' => '\'\'', |
|
3156 | + '0xDE' => '\'\'', '0xDF' => '\'\'', '0xFB' => '0xD792', |
|
3157 | + '0xFC' => '0xE282AC', '0xFF' => '0xD6B2', '0xC2' => '0xFF', |
|
3158 | + '0x80' => '0xFC', '0xE2' => '0xFB', '0xA0' => '0xC2A0', |
|
3159 | + '0xA1' => '0xC2A1', '0xA2' => '0xC2A2', '0xA3' => '0xC2A3', |
|
3160 | + '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3161 | + '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3162 | + '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3163 | + '0xAF' => '0xC2AF', '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', |
|
3164 | + '0xB2' => '0xC2B2', '0xB3' => '0xC2B3', '0xB4' => '0xC2B4', |
|
3165 | + '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3166 | + '0xB8' => '0xC2B8', '0xB9' => '0xC2B9', '0xBB' => '0xC2BB', |
|
3167 | + '0xBC' => '0xC2BC', '0xBD' => '0xC2BD', '0xBE' => '0xC2BE', |
|
3168 | + '0xBF' => '0xC2BF', '0xD7' => '0xD7B3', '0xD1' => '0xD781', |
|
3169 | + '0xD4' => '0xD7B0', '0xD5' => '0xD7B1', '0xD6' => '0xD7B2', |
|
3170 | + '0xE0' => '0xD790', '0xEA' => '0xD79A', '0xEC' => '0xD79C', |
|
3171 | + '0xED' => '0xD79D', '0xEE' => '0xD79E', '0xEF' => '0xD79F', |
|
3172 | + '0xF0' => '0xD7A0', '0xF1' => '0xD7A1', '0xF2' => '0xD7A2', |
|
3173 | + '0xF3' => '0xD7A3', '0xF5' => '0xD7A5', '0xF6' => '0xD7A6', |
|
3174 | + '0xF7' => '0xD7A7', '0xF8' => '0xD7A8', '0xF9' => '0xD7A9', |
|
3175 | + '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3176 | + '0x86' => '0xE280A0', '0x87' => '0xE280A1', '0x89' => '0xE280B0', |
|
3177 | + '0x8B' => '0xE280B9', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3178 | + '0x95' => '0xE280A2', '0x97' => '0xE28094', '0x99' => '0xE284A2', |
|
3179 | + '0xC0' => '0xD6B0', '0xC1' => '0xD6B1', '0xC3' => '0xD6B3', |
|
3180 | + '0xC4' => '0xD6B4', '0xC5' => '0xD6B5', '0xC6' => '0xD6B6', |
|
3181 | + '0xC7' => '0xD6B7', '0xC8' => '0xD6B8', '0xC9' => '0xD6B9', |
|
3182 | + '0xCB' => '0xD6BB', '0xCC' => '0xD6BC', '0xCD' => '0xD6BD', |
|
3183 | + '0xCE' => '0xD6BE', '0xCF' => '0xD6BF', '0xD0' => '0xD780', |
|
3184 | + '0xD2' => '0xD782', '0xE3' => '0xD793', '0xE4' => '0xD794', |
|
3185 | + '0xE5' => '0xD795', '0xE7' => '0xD797', '0xE9' => '0xD799', |
|
3186 | + '0xFD' => '0xE2808E', '0xFE' => '0xE2808F', '0x92' => '0xE28099', |
|
3187 | + '0x83' => '0xC692', '0xD3' => '0xD783', '0x88' => '0xCB86', |
|
3188 | + '0x98' => '0xCB9C', '0x91' => '0xE28098', '0x96' => '0xE28093', |
|
3189 | + '0xBA' => '0xC3B7', '0x9B' => '0xE280BA', '0xAA' => '0xC397', |
|
3190 | + '0xA4' => '0xE282AA', '0xE1' => '0xD791', '0xE6' => '0xD796', |
|
3191 | + '0xE8' => '0xD798', '0xEB' => '0xD79B', '0xF4' => '0xD7A4', |
|
3192 | 3192 | '0xFA' => '0xD7AA', |
3193 | 3193 | ), |
3194 | 3194 | 'windows-1253' => array( |
3195 | - '0x81' => '\'\'', '0x88' => '\'\'', '0x8A' => '\'\'', |
|
3196 | - '0x8C' => '\'\'', '0x8D' => '\'\'', '0x8E' => '\'\'', |
|
3197 | - '0x8F' => '\'\'', '0x90' => '\'\'', '0x98' => '\'\'', |
|
3198 | - '0x9A' => '\'\'', '0x9C' => '\'\'', '0x9D' => '\'\'', |
|
3199 | - '0x9E' => '\'\'', '0x9F' => '\'\'', '0xAA' => '\'\'', |
|
3200 | - '0xD2' => '0xE282AC', '0xFF' => '0xCE92', '0xCE' => '0xCE9E', |
|
3201 | - '0xB8' => '0xCE88', '0xBA' => '0xCE8A', '0xBC' => '0xCE8C', |
|
3202 | - '0xBE' => '0xCE8E', '0xBF' => '0xCE8F', '0xC0' => '0xCE90', |
|
3203 | - '0xC8' => '0xCE98', '0xCA' => '0xCE9A', '0xCC' => '0xCE9C', |
|
3204 | - '0xCD' => '0xCE9D', '0xCF' => '0xCE9F', '0xDA' => '0xCEAA', |
|
3205 | - '0xE8' => '0xCEB8', '0xEA' => '0xCEBA', '0xEC' => '0xCEBC', |
|
3206 | - '0xEE' => '0xCEBE', '0xEF' => '0xCEBF', '0xC2' => '0xFF', |
|
3207 | - '0xBD' => '0xC2BD', '0xED' => '0xCEBD', '0xB2' => '0xC2B2', |
|
3208 | - '0xA0' => '0xC2A0', '0xA3' => '0xC2A3', '0xA4' => '0xC2A4', |
|
3209 | - '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3210 | - '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3211 | - '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3212 | - '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', '0xB3' => '0xC2B3', |
|
3213 | - '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3214 | - '0xBB' => '0xC2BB', '0xE2' => '0xCEB2', '0x80' => '0xD2', |
|
3215 | - '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3216 | - '0x86' => '0xE280A0', '0xA1' => '0xCE85', '0xA2' => '0xCE86', |
|
3217 | - '0x87' => '0xE280A1', '0x89' => '0xE280B0', '0xB9' => '0xCE89', |
|
3218 | - '0x8B' => '0xE280B9', '0x91' => '0xE28098', '0x99' => '0xE284A2', |
|
3219 | - '0x92' => '0xE28099', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3220 | - '0x95' => '0xE280A2', '0x96' => '0xE28093', '0x97' => '0xE28094', |
|
3221 | - '0x9B' => '0xE280BA', '0xAF' => '0xE28095', '0xB4' => '0xCE84', |
|
3222 | - '0xC1' => '0xCE91', '0xC3' => '0xCE93', '0xC4' => '0xCE94', |
|
3223 | - '0xC5' => '0xCE95', '0xC6' => '0xCE96', '0x83' => '0xC692', |
|
3224 | - '0xC7' => '0xCE97', '0xC9' => '0xCE99', '0xCB' => '0xCE9B', |
|
3225 | - '0xD0' => '0xCEA0', '0xD1' => '0xCEA1', '0xD3' => '0xCEA3', |
|
3226 | - '0xD4' => '0xCEA4', '0xD5' => '0xCEA5', '0xD6' => '0xCEA6', |
|
3227 | - '0xD7' => '0xCEA7', '0xD8' => '0xCEA8', '0xD9' => '0xCEA9', |
|
3228 | - '0xDB' => '0xCEAB', '0xDC' => '0xCEAC', '0xDD' => '0xCEAD', |
|
3229 | - '0xDE' => '0xCEAE', '0xDF' => '0xCEAF', '0xE0' => '0xCEB0', |
|
3230 | - '0xE1' => '0xCEB1', '0xE3' => '0xCEB3', '0xE4' => '0xCEB4', |
|
3231 | - '0xE5' => '0xCEB5', '0xE6' => '0xCEB6', '0xE7' => '0xCEB7', |
|
3232 | - '0xE9' => '0xCEB9', '0xEB' => '0xCEBB', '0xF0' => '0xCF80', |
|
3233 | - '0xF1' => '0xCF81', '0xF2' => '0xCF82', '0xF3' => '0xCF83', |
|
3234 | - '0xF4' => '0xCF84', '0xF5' => '0xCF85', '0xF6' => '0xCF86', |
|
3235 | - '0xF7' => '0xCF87', '0xF8' => '0xCF88', '0xF9' => '0xCF89', |
|
3236 | - '0xFA' => '0xCF8A', '0xFB' => '0xCF8B', '0xFC' => '0xCF8C', |
|
3237 | - '0xFD' => '0xCF8D', '0xFE' => '0xCF8E', |
|
3195 | + '0x81' => '\'\'', '0x88' => '\'\'', '0x8A' => '\'\'', |
|
3196 | + '0x8C' => '\'\'', '0x8D' => '\'\'', '0x8E' => '\'\'', |
|
3197 | + '0x8F' => '\'\'', '0x90' => '\'\'', '0x98' => '\'\'', |
|
3198 | + '0x9A' => '\'\'', '0x9C' => '\'\'', '0x9D' => '\'\'', |
|
3199 | + '0x9E' => '\'\'', '0x9F' => '\'\'', '0xAA' => '\'\'', |
|
3200 | + '0xD2' => '0xE282AC', '0xFF' => '0xCE92', '0xCE' => '0xCE9E', |
|
3201 | + '0xB8' => '0xCE88', '0xBA' => '0xCE8A', '0xBC' => '0xCE8C', |
|
3202 | + '0xBE' => '0xCE8E', '0xBF' => '0xCE8F', '0xC0' => '0xCE90', |
|
3203 | + '0xC8' => '0xCE98', '0xCA' => '0xCE9A', '0xCC' => '0xCE9C', |
|
3204 | + '0xCD' => '0xCE9D', '0xCF' => '0xCE9F', '0xDA' => '0xCEAA', |
|
3205 | + '0xE8' => '0xCEB8', '0xEA' => '0xCEBA', '0xEC' => '0xCEBC', |
|
3206 | + '0xEE' => '0xCEBE', '0xEF' => '0xCEBF', '0xC2' => '0xFF', |
|
3207 | + '0xBD' => '0xC2BD', '0xED' => '0xCEBD', '0xB2' => '0xC2B2', |
|
3208 | + '0xA0' => '0xC2A0', '0xA3' => '0xC2A3', '0xA4' => '0xC2A4', |
|
3209 | + '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3210 | + '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3211 | + '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3212 | + '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', '0xB3' => '0xC2B3', |
|
3213 | + '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3214 | + '0xBB' => '0xC2BB', '0xE2' => '0xCEB2', '0x80' => '0xD2', |
|
3215 | + '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3216 | + '0x86' => '0xE280A0', '0xA1' => '0xCE85', '0xA2' => '0xCE86', |
|
3217 | + '0x87' => '0xE280A1', '0x89' => '0xE280B0', '0xB9' => '0xCE89', |
|
3218 | + '0x8B' => '0xE280B9', '0x91' => '0xE28098', '0x99' => '0xE284A2', |
|
3219 | + '0x92' => '0xE28099', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3220 | + '0x95' => '0xE280A2', '0x96' => '0xE28093', '0x97' => '0xE28094', |
|
3221 | + '0x9B' => '0xE280BA', '0xAF' => '0xE28095', '0xB4' => '0xCE84', |
|
3222 | + '0xC1' => '0xCE91', '0xC3' => '0xCE93', '0xC4' => '0xCE94', |
|
3223 | + '0xC5' => '0xCE95', '0xC6' => '0xCE96', '0x83' => '0xC692', |
|
3224 | + '0xC7' => '0xCE97', '0xC9' => '0xCE99', '0xCB' => '0xCE9B', |
|
3225 | + '0xD0' => '0xCEA0', '0xD1' => '0xCEA1', '0xD3' => '0xCEA3', |
|
3226 | + '0xD4' => '0xCEA4', '0xD5' => '0xCEA5', '0xD6' => '0xCEA6', |
|
3227 | + '0xD7' => '0xCEA7', '0xD8' => '0xCEA8', '0xD9' => '0xCEA9', |
|
3228 | + '0xDB' => '0xCEAB', '0xDC' => '0xCEAC', '0xDD' => '0xCEAD', |
|
3229 | + '0xDE' => '0xCEAE', '0xDF' => '0xCEAF', '0xE0' => '0xCEB0', |
|
3230 | + '0xE1' => '0xCEB1', '0xE3' => '0xCEB3', '0xE4' => '0xCEB4', |
|
3231 | + '0xE5' => '0xCEB5', '0xE6' => '0xCEB6', '0xE7' => '0xCEB7', |
|
3232 | + '0xE9' => '0xCEB9', '0xEB' => '0xCEBB', '0xF0' => '0xCF80', |
|
3233 | + '0xF1' => '0xCF81', '0xF2' => '0xCF82', '0xF3' => '0xCF83', |
|
3234 | + '0xF4' => '0xCF84', '0xF5' => '0xCF85', '0xF6' => '0xCF86', |
|
3235 | + '0xF7' => '0xCF87', '0xF8' => '0xCF88', '0xF9' => '0xCF89', |
|
3236 | + '0xFA' => '0xCF8A', '0xFB' => '0xCF8B', '0xFC' => '0xCF8C', |
|
3237 | + '0xFD' => '0xCF8D', '0xFE' => '0xCF8E', |
|
3238 | 3238 | ), |
3239 | 3239 | ); |
3240 | 3240 | |
@@ -3494,7 +3494,7 @@ discard block |
||
3494 | 3494 | // This bit fixes incorrect string lengths, which can happen if the character encoding was changed (e.g. conversion to UTF-8) |
3495 | 3495 | $new_string = preg_replace_callback( |
3496 | 3496 | '~\bs:(\d+):"(.*?)";(?=$|[bidsaO]:|[{}}]|N;)~s', |
3497 | - function ($matches) |
|
3497 | + function($matches) |
|
3498 | 3498 | { |
3499 | 3499 | return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";'; |
3500 | 3500 | }, |
@@ -41,7 +41,8 @@ discard block |
||
41 | 41 | 'mysql' => array( |
42 | 42 | 'name' => 'MySQL', |
43 | 43 | 'version' => '5.6.0', |
44 | - 'version_check' => function() { |
|
44 | + 'version_check' => function() |
|
45 | + { |
|
45 | 46 | global $db_connection; |
46 | 47 | if (!function_exists('mysqli_fetch_row')) |
47 | 48 | return false; |
@@ -52,7 +53,8 @@ discard block |
||
52 | 53 | 'postgresql' => array( |
53 | 54 | 'name' => 'PostgreSQL', |
54 | 55 | 'version' => '9.6', |
55 | - 'version_check' => function() { |
|
56 | + 'version_check' => function() |
|
57 | + { |
|
56 | 58 | if (!function_exists('pg_version')) |
57 | 59 | return false; |
58 | 60 | $version = pg_version(); |
@@ -1091,22 +1093,30 @@ discard block |
||
1091 | 1093 | |
1092 | 1094 | // PHP currently has a terrible handling with unserialize in which errors are fatal and not catchable. Lets borrow some code from the RFC that intends to fix this |
1093 | 1095 | // https://wiki.php.net/rfc/improve_unserialize_error_handling |
1094 | - try { |
|
1095 | - set_error_handler(static function ($severity, $message, $file, $line) { |
|
1096 | + try |
|
1097 | + { |
|
1098 | + set_error_handler(static function ($severity, $message, $file, $line) |
|
1099 | + { |
|
1096 | 1100 | throw new \ErrorException($message, 0, $severity, $file, $line); |
1097 | 1101 | }); |
1098 | 1102 | $ser_test = @unserialize($modSettings['attachmentUploadDir']); |
1099 | - } catch (\Throwable $e) { |
|
1103 | + } |
|
1104 | + catch (\Throwable $e) |
|
1105 | + { |
|
1100 | 1106 | $ser_test = false; |
1101 | 1107 | } |
1102 | - finally { |
|
1108 | + finally |
|
1109 | + { |
|
1103 | 1110 | restore_error_handler(); |
1104 | 1111 | } |
1105 | 1112 | |
1106 | 1113 | // Json is simple, it can be caught. |
1107 | - try { |
|
1114 | + try |
|
1115 | + { |
|
1108 | 1116 | $json_test = @json_decode($modSettings['attachmentUploadDir'], true); |
1109 | - } catch (\Throwable $e) { |
|
1117 | + } |
|
1118 | + catch (\Throwable $e) |
|
1119 | + { |
|
1110 | 1120 | $json_test = null; |
1111 | 1121 | } |
1112 | 1122 |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | // An array already? |
1122 | 1122 | elseif (is_array($modSettings['attachmentUploadDir'])) |
1123 | 1123 | { |
1124 | - foreach($modSettings['attachmentUploadDir'] AS $dir) |
|
1124 | + foreach($modSettings['attachmentUploadDir'] as $dir) |
|
1125 | 1125 | if (!empty($dir) && !is_dir($dir)) |
1126 | 1126 | $attdr_problem_found = true; |
1127 | 1127 | } |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | { |
1131 | 1131 | if (is_array($ser_test)) |
1132 | 1132 | { |
1133 | - foreach($ser_test AS $dir) |
|
1133 | + foreach($ser_test as $dir) |
|
1134 | 1134 | { |
1135 | 1135 | if (!empty($dir) && !is_dir($dir)) |
1136 | 1136 | $attdr_problem_found = true; |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | { |
1148 | 1148 | if (is_array($json_test)) |
1149 | 1149 | { |
1150 | - foreach($json_test AS $dir) |
|
1150 | + foreach($json_test as $dir) |
|
1151 | 1151 | { |
1152 | 1152 | if (!is_dir($dir)) |
1153 | 1153 | $attdr_problem_found = true; |
@@ -3309,7 +3309,7 @@ discard block |
||
3309 | 3309 | // Deleting an existing label? |
3310 | 3310 | elseif (isset($_POST['delete'], $_POST['delete_label'])) |
3311 | 3311 | { |
3312 | - foreach ($_POST['delete_label'] AS $label => $dummy) |
|
3312 | + foreach ($_POST['delete_label'] as $label => $dummy) |
|
3313 | 3313 | { |
3314 | 3314 | if (array_key_exists($label, $the_labels)) |
3315 | 3315 | { |
@@ -3353,7 +3353,7 @@ discard block |
||
3353 | 3353 | if (!empty($labels_to_add)) |
3354 | 3354 | { |
3355 | 3355 | $inserts = array(); |
3356 | - foreach ($labels_to_add AS $label) |
|
3356 | + foreach ($labels_to_add as $label) |
|
3357 | 3357 | $inserts[] = array($user_info['id'], $label); |
3358 | 3358 | |
3359 | 3359 | $smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array()); |
@@ -3362,7 +3362,7 @@ discard block |
||
3362 | 3362 | // Update existing labels as needed |
3363 | 3363 | if (!empty($label_updates)) |
3364 | 3364 | { |
3365 | - foreach ($label_updates AS $id => $name) |
|
3365 | + foreach ($label_updates as $id => $name) |
|
3366 | 3366 | { |
3367 | 3367 | $smcFunc['db_query']('', ' |
3368 | 3368 | UPDATE {db_prefix}pm_labels |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $combining_classes = utf8_combining_classes(); |
548 | 548 | |
549 | 549 | // Replace characters with decomposed forms. |
550 | - for ($i=0; $i < count($chars); $i++) |
|
550 | + for ($i = 0; $i < count($chars); $i++) |
|
551 | 551 | { |
552 | 552 | // Hangul characters. |
553 | 553 | // See "Hangul Syllable Decomposition" in the Unicode standard, ch. 3.12. |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | { |
583 | 583 | $temp = $chars[$i]; |
584 | 584 | $chars[$i] = $chars[$i - 1]; |
585 | - $chars[$i -1] = $temp; |
|
585 | + $chars[$i - 1] = $temp; |
|
586 | 586 | |
587 | 587 | // Backtrack and check again. |
588 | 588 | if ($i > 1) |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | |
827 | 827 | // Use placeholders to preserve known emoji from further processing. |
828 | 828 | // Regex source is https://unicode.org/reports/tr51/#EBNF_and_Regex |
829 | - $string = preg_replace_callback( |
|
829 | + $string = preg_replace_callback( |
|
830 | 830 | '/' . |
831 | 831 | // Flag emojis |
832 | 832 | '[' . $prop_classes['Regional_Indicator'] . ']{2}' . |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | ')?' . |
856 | 856 | ')*' . |
857 | 857 | '/u', |
858 | - function ($matches) use (&$placeholders) |
|
858 | + function($matches) use (&$placeholders) |
|
859 | 859 | { |
860 | 860 | // Skip lone ASCII characters that are not actually part of an emoji sequence. |
861 | 861 | // This can happen because the digits 0-9 and the '*' and '#' characters are |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | // Use placeholders for sanctioned variation selectors. |
887 | 887 | $string = preg_replace_callback( |
888 | 888 | $patterns, |
889 | - function ($matches) use (&$placeholders) |
|
889 | + function($matches) use (&$placeholders) |
|
890 | 890 | { |
891 | 891 | $placeholders[$matches[0]] = "\xEE\xB3\x9B" . md5($matches[0]) . "\xEE\xB3\x9C"; |
892 | 892 | return $placeholders[$matches[0]]; |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | // Do the thing. |
967 | 967 | $string = preg_replace_callback( |
968 | 968 | '/' . $pattern . '/u', |
969 | - function ($matches) use ($placeholders) |
|
969 | + function($matches) use ($placeholders) |
|
970 | 970 | { |
971 | 971 | return strtr($matches[0], $placeholders); |
972 | 972 | }, |
@@ -219,7 +219,7 @@ |
||
219 | 219 | |
220 | 220 | // Send a custom header if we have a custom message. |
221 | 221 | if (isset($_REQUEST['js']) || isset($_REQUEST['xml']) || isset($_RQEUEST['ajax'])) |
222 | - header('X-SMF-errormsg: ' . $error_message); |
|
222 | + header('X-SMF-errormsg: ' . $error_message); |
|
223 | 223 | |
224 | 224 | // If we have no theme stuff we can't have the language file... |
225 | 225 | if (empty($context['theme_loaded'])) |