@@ -871,7 +871,7 @@ |
||
871 | 871 | // Intercept cookie? |
872 | 872 | call_integration_hook('integrate_cookie', array($name, $value, $expire, $path, $domain, $secure, $httponly, $samesite)); |
873 | 873 | |
874 | - if(PHP_VERSION_ID < 70300) |
|
874 | + if (PHP_VERSION_ID < 70300) |
|
875 | 875 | return setcookie($name, $value, $expire, $path . ';samesite=' . $samesite, $domain, $secure, $httponly); |
876 | 876 | else |
877 | 877 | return setcookie($name, $value, array( |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | } |
189 | 189 | |
190 | - $unnotified = array_filter($this->members['watching'], function ($member) { |
|
190 | + $unnotified = array_filter($this->members['watching'], function($member) { |
|
191 | 191 | return empty($member['sent']); |
192 | 192 | }); |
193 | 193 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if ($type == 'edit' || !empty($this->_details['respawns'])) |
197 | 197 | { |
198 | 198 | // Notifications about modified posts only go to members who were mentioned or quoted |
199 | - $this->members['watching'] = $type == 'edit' ? array(): $unnotified; |
|
199 | + $this->members['watching'] = $type == 'edit' ? array() : $unnotified; |
|
200 | 200 | |
201 | 201 | // If this post has no quotes or mentions, just delete any obsolete alerts and bail out. |
202 | 202 | if (empty($this->members['quoted']) && empty($this->members['mentioned'])) |
@@ -512,8 +512,7 @@ discard block |
||
512 | 512 | if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($this->prefs[$member_id])) |
513 | 513 | { |
514 | 514 | $pref = !empty($this->prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ? |
515 | - $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : |
|
516 | - (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
515 | + $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
517 | 516 | |
518 | 517 | $message_type = 'notification_' . $type; |
519 | 518 | |
@@ -532,8 +531,7 @@ discard block |
||
532 | 531 | elseif ($type == 'topic') |
533 | 532 | { |
534 | 533 | $pref = !empty($this->prefs[$member_id]['board_notify_' . $topicOptions['board']]) ? |
535 | - $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : |
|
536 | - (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
534 | + $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
537 | 535 | |
538 | 536 | $content_type = 'board'; |
539 | 537 |
@@ -170,11 +170,14 @@ discard block |
||
170 | 170 | |
171 | 171 | // If this user subscribes both to the topic and the board there will be two records returned. |
172 | 172 | // Copy board/topic data to the new record or it will be lost. |
173 | - if (!empty($this->members['watching'][$row['id_member']])) { |
|
174 | - if ($this->members['watching'][$row['id_member']]['id_board'] > 0) { |
|
173 | + if (!empty($this->members['watching'][$row['id_member']])) |
|
174 | + { |
|
175 | + if ($this->members['watching'][$row['id_member']]['id_board'] > 0) |
|
176 | + { |
|
175 | 177 | $row['id_board'] = $this->members['watching'][$row['id_member']]['id_board']; |
176 | 178 | } |
177 | - if ($this->members['watching'][$row['id_member']]['id_topic'] > 0) { |
|
179 | + if ($this->members['watching'][$row['id_member']]['id_topic'] > 0) |
|
180 | + { |
|
178 | 181 | $row['id_topic'] = $this->members['watching'][$row['id_member']]['id_topic']; |
179 | 182 | } |
180 | 183 | } |
@@ -191,7 +194,8 @@ discard block |
||
191 | 194 | foreach ($this->members[$member_type] as $member_id => $member_data) |
192 | 195 | { |
193 | 196 | // The member receiving the alert has ignored the member mentioning them. |
194 | - if (!empty($member_data['mentioned_by']['ignored'])) { |
|
197 | + if (!empty($member_data['mentioned_by']['ignored'])) |
|
198 | + { |
|
195 | 199 | unset($this->members[$member_type][$member_id], $msgOptions[$member_type . '_members'][$member_id]); |
196 | 200 | } |
197 | 201 | |
@@ -202,7 +206,8 @@ discard block |
||
202 | 206 | } |
203 | 207 | } |
204 | 208 | |
205 | - $unnotified = array_filter($this->members['watching'], function ($member) { |
|
209 | + $unnotified = array_filter($this->members['watching'], function ($member) |
|
210 | + { |
|
206 | 211 | return empty($member['sent']); |
207 | 212 | }); |
208 | 213 |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | // Filter out any redundant separators before we start the loop |
759 | 759 | $context['config_vars'] = array_filter( |
760 | 760 | $context['config_vars'], |
761 | - function ($v) use ($context) |
|
761 | + function($v) use ($context) |
|
762 | 762 | { |
763 | 763 | static $config_vars, $prev; |
764 | 764 | |
@@ -1659,7 +1659,7 @@ discard block |
||
1659 | 1659 | echo ' |
1660 | 1660 | <form action="' . $scripturl . '?action=admin;area=search" method="post" accept-charset="' . $context['character_set'] . '" class="admin_search"> |
1661 | 1661 | <span class="main_icons filter centericon"></span> |
1662 | - <input type="search" name="search_term" placeholder="', $txt['admin_search'], '"', isset($context['search_term']) ? ' value="' . $context['search_term'] . '"' : '','> |
|
1662 | + <input type="search" name="search_term" placeholder="', $txt['admin_search'], '"', isset($context['search_term']) ? ' value="' . $context['search_term'] . '"' : '', '> |
|
1663 | 1663 | <select name="search_type"> |
1664 | 1664 | <option value="internal"', (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] == 'internal' ? ' selected' : ''), '>', $txt['admin_search_type_internal'], '</option> |
1665 | 1665 | <option value="member"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'member' ? ' selected' : ''), '>', $txt['admin_search_type_member'], '</option> |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | require_once($sourcedir . '/Subs-Compat.php'); |
83 | 83 | |
84 | 84 | // If $maintenance is set specifically to 2, then we're upgrading or something. |
85 | -if (!empty($maintenance) && 2 === $maintenance) |
|
85 | +if (!empty($maintenance) && 2 === $maintenance) |
|
86 | 86 | { |
87 | 87 | display_maintenance_message(); |
88 | 88 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @param string $class The fully-qualified class name. |
100 | 100 | */ |
101 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
101 | +spl_autoload_register(function($class) use ($sourcedir) |
|
102 | 102 | { |
103 | 103 | $classMap = array( |
104 | 104 | 'ReCaptcha\\' => 'ReCaptcha/', |
@@ -165,8 +165,7 @@ |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | // No access if you don't have permission to see this attachment. |
168 | - if |
|
169 | - ( |
|
168 | + if ( |
|
170 | 169 | // This was from SMF or a hook didn't claim it. |
171 | 170 | ( |
172 | 171 | empty($file['source']) |
@@ -191,8 +191,7 @@ |
||
191 | 191 | ) |
192 | 192 | // We are not previewing an attachment. |
193 | 193 | && !isset($_SESSION['attachments_can_preview'][$attachId]) |
194 | - ) |
|
195 | - { |
|
194 | + ) { |
|
196 | 195 | send_http_status(404, 'File Not Found'); |
197 | 196 | die('404 File Not Found'); |
198 | 197 | } |
@@ -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 | |
@@ -530,7 +541,8 @@ discard block |
||
530 | 541 | |
531 | 542 | $labels = explode('.', $domain); |
532 | 543 | |
533 | - foreach ($labels as $l => $label) { |
|
544 | + foreach ($labels as $l => $label) |
|
545 | + { |
|
534 | 546 | $label = preg_replace('/[' . $regexes['ignored'] . ']/u', '', $label); |
535 | 547 | |
536 | 548 | $label = utf8_normalize_c(strtr($label, $maps)); |
@@ -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']); |
@@ -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; |
@@ -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); |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | // 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 |
1109 | 1109 | // https://wiki.php.net/rfc/improve_unserialize_error_handling |
1110 | 1110 | try { |
1111 | - set_error_handler(static function ($severity, $message, $file, $line) { |
|
1111 | + set_error_handler(static function($severity, $message, $file, $line) { |
|
1112 | 1112 | throw new \ErrorException($message, 0, $severity, $file, $line); |
1113 | 1113 | }); |
1114 | 1114 | $ser_test = @unserialize($modSettings['attachmentUploadDir']); |
@@ -1137,7 +1137,7 @@ discard block |
||
1137 | 1137 | // An array already? |
1138 | 1138 | elseif (is_array($modSettings['attachmentUploadDir'])) |
1139 | 1139 | { |
1140 | - foreach($modSettings['attachmentUploadDir'] AS $dir) |
|
1140 | + foreach ($modSettings['attachmentUploadDir'] AS $dir) |
|
1141 | 1141 | if (!empty($dir) && !is_dir($dir)) |
1142 | 1142 | $attdr_problem_found = true; |
1143 | 1143 | } |
@@ -1146,7 +1146,7 @@ discard block |
||
1146 | 1146 | { |
1147 | 1147 | if (is_array($ser_test)) |
1148 | 1148 | { |
1149 | - foreach($ser_test AS $dir) |
|
1149 | + foreach ($ser_test AS $dir) |
|
1150 | 1150 | { |
1151 | 1151 | if (!empty($dir) && !is_dir($dir)) |
1152 | 1152 | $attdr_problem_found = true; |
@@ -1163,7 +1163,7 @@ discard block |
||
1163 | 1163 | { |
1164 | 1164 | if (is_array($json_test)) |
1165 | 1165 | { |
1166 | - foreach($json_test AS $dir) |
|
1166 | + foreach ($json_test AS $dir) |
|
1167 | 1167 | { |
1168 | 1168 | if (!is_dir($dir)) |
1169 | 1169 | $attdr_problem_found = true; |
@@ -3163,94 +3163,94 @@ discard block |
||
3163 | 3163 | // Translation table for the character sets not native for MySQL. |
3164 | 3164 | $translation_tables = array( |
3165 | 3165 | 'windows-1255' => array( |
3166 | - '0x81' => '\'\'', '0x8A' => '\'\'', '0x8C' => '\'\'', |
|
3167 | - '0x8D' => '\'\'', '0x8E' => '\'\'', '0x8F' => '\'\'', |
|
3168 | - '0x90' => '\'\'', '0x9A' => '\'\'', '0x9C' => '\'\'', |
|
3169 | - '0x9D' => '\'\'', '0x9E' => '\'\'', '0x9F' => '\'\'', |
|
3170 | - '0xCA' => '\'\'', '0xD9' => '\'\'', '0xDA' => '\'\'', |
|
3171 | - '0xDB' => '\'\'', '0xDC' => '\'\'', '0xDD' => '\'\'', |
|
3172 | - '0xDE' => '\'\'', '0xDF' => '\'\'', '0xFB' => '0xD792', |
|
3173 | - '0xFC' => '0xE282AC', '0xFF' => '0xD6B2', '0xC2' => '0xFF', |
|
3174 | - '0x80' => '0xFC', '0xE2' => '0xFB', '0xA0' => '0xC2A0', |
|
3175 | - '0xA1' => '0xC2A1', '0xA2' => '0xC2A2', '0xA3' => '0xC2A3', |
|
3176 | - '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3177 | - '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3178 | - '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3179 | - '0xAF' => '0xC2AF', '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', |
|
3180 | - '0xB2' => '0xC2B2', '0xB3' => '0xC2B3', '0xB4' => '0xC2B4', |
|
3181 | - '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3182 | - '0xB8' => '0xC2B8', '0xB9' => '0xC2B9', '0xBB' => '0xC2BB', |
|
3183 | - '0xBC' => '0xC2BC', '0xBD' => '0xC2BD', '0xBE' => '0xC2BE', |
|
3184 | - '0xBF' => '0xC2BF', '0xD7' => '0xD7B3', '0xD1' => '0xD781', |
|
3185 | - '0xD4' => '0xD7B0', '0xD5' => '0xD7B1', '0xD6' => '0xD7B2', |
|
3186 | - '0xE0' => '0xD790', '0xEA' => '0xD79A', '0xEC' => '0xD79C', |
|
3187 | - '0xED' => '0xD79D', '0xEE' => '0xD79E', '0xEF' => '0xD79F', |
|
3188 | - '0xF0' => '0xD7A0', '0xF1' => '0xD7A1', '0xF2' => '0xD7A2', |
|
3189 | - '0xF3' => '0xD7A3', '0xF5' => '0xD7A5', '0xF6' => '0xD7A6', |
|
3190 | - '0xF7' => '0xD7A7', '0xF8' => '0xD7A8', '0xF9' => '0xD7A9', |
|
3191 | - '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3192 | - '0x86' => '0xE280A0', '0x87' => '0xE280A1', '0x89' => '0xE280B0', |
|
3193 | - '0x8B' => '0xE280B9', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3194 | - '0x95' => '0xE280A2', '0x97' => '0xE28094', '0x99' => '0xE284A2', |
|
3195 | - '0xC0' => '0xD6B0', '0xC1' => '0xD6B1', '0xC3' => '0xD6B3', |
|
3196 | - '0xC4' => '0xD6B4', '0xC5' => '0xD6B5', '0xC6' => '0xD6B6', |
|
3197 | - '0xC7' => '0xD6B7', '0xC8' => '0xD6B8', '0xC9' => '0xD6B9', |
|
3198 | - '0xCB' => '0xD6BB', '0xCC' => '0xD6BC', '0xCD' => '0xD6BD', |
|
3199 | - '0xCE' => '0xD6BE', '0xCF' => '0xD6BF', '0xD0' => '0xD780', |
|
3200 | - '0xD2' => '0xD782', '0xE3' => '0xD793', '0xE4' => '0xD794', |
|
3201 | - '0xE5' => '0xD795', '0xE7' => '0xD797', '0xE9' => '0xD799', |
|
3202 | - '0xFD' => '0xE2808E', '0xFE' => '0xE2808F', '0x92' => '0xE28099', |
|
3203 | - '0x83' => '0xC692', '0xD3' => '0xD783', '0x88' => '0xCB86', |
|
3204 | - '0x98' => '0xCB9C', '0x91' => '0xE28098', '0x96' => '0xE28093', |
|
3205 | - '0xBA' => '0xC3B7', '0x9B' => '0xE280BA', '0xAA' => '0xC397', |
|
3206 | - '0xA4' => '0xE282AA', '0xE1' => '0xD791', '0xE6' => '0xD796', |
|
3207 | - '0xE8' => '0xD798', '0xEB' => '0xD79B', '0xF4' => '0xD7A4', |
|
3166 | + '0x81' => '\'\'', '0x8A' => '\'\'', '0x8C' => '\'\'', |
|
3167 | + '0x8D' => '\'\'', '0x8E' => '\'\'', '0x8F' => '\'\'', |
|
3168 | + '0x90' => '\'\'', '0x9A' => '\'\'', '0x9C' => '\'\'', |
|
3169 | + '0x9D' => '\'\'', '0x9E' => '\'\'', '0x9F' => '\'\'', |
|
3170 | + '0xCA' => '\'\'', '0xD9' => '\'\'', '0xDA' => '\'\'', |
|
3171 | + '0xDB' => '\'\'', '0xDC' => '\'\'', '0xDD' => '\'\'', |
|
3172 | + '0xDE' => '\'\'', '0xDF' => '\'\'', '0xFB' => '0xD792', |
|
3173 | + '0xFC' => '0xE282AC', '0xFF' => '0xD6B2', '0xC2' => '0xFF', |
|
3174 | + '0x80' => '0xFC', '0xE2' => '0xFB', '0xA0' => '0xC2A0', |
|
3175 | + '0xA1' => '0xC2A1', '0xA2' => '0xC2A2', '0xA3' => '0xC2A3', |
|
3176 | + '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3177 | + '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3178 | + '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3179 | + '0xAF' => '0xC2AF', '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', |
|
3180 | + '0xB2' => '0xC2B2', '0xB3' => '0xC2B3', '0xB4' => '0xC2B4', |
|
3181 | + '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3182 | + '0xB8' => '0xC2B8', '0xB9' => '0xC2B9', '0xBB' => '0xC2BB', |
|
3183 | + '0xBC' => '0xC2BC', '0xBD' => '0xC2BD', '0xBE' => '0xC2BE', |
|
3184 | + '0xBF' => '0xC2BF', '0xD7' => '0xD7B3', '0xD1' => '0xD781', |
|
3185 | + '0xD4' => '0xD7B0', '0xD5' => '0xD7B1', '0xD6' => '0xD7B2', |
|
3186 | + '0xE0' => '0xD790', '0xEA' => '0xD79A', '0xEC' => '0xD79C', |
|
3187 | + '0xED' => '0xD79D', '0xEE' => '0xD79E', '0xEF' => '0xD79F', |
|
3188 | + '0xF0' => '0xD7A0', '0xF1' => '0xD7A1', '0xF2' => '0xD7A2', |
|
3189 | + '0xF3' => '0xD7A3', '0xF5' => '0xD7A5', '0xF6' => '0xD7A6', |
|
3190 | + '0xF7' => '0xD7A7', '0xF8' => '0xD7A8', '0xF9' => '0xD7A9', |
|
3191 | + '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3192 | + '0x86' => '0xE280A0', '0x87' => '0xE280A1', '0x89' => '0xE280B0', |
|
3193 | + '0x8B' => '0xE280B9', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3194 | + '0x95' => '0xE280A2', '0x97' => '0xE28094', '0x99' => '0xE284A2', |
|
3195 | + '0xC0' => '0xD6B0', '0xC1' => '0xD6B1', '0xC3' => '0xD6B3', |
|
3196 | + '0xC4' => '0xD6B4', '0xC5' => '0xD6B5', '0xC6' => '0xD6B6', |
|
3197 | + '0xC7' => '0xD6B7', '0xC8' => '0xD6B8', '0xC9' => '0xD6B9', |
|
3198 | + '0xCB' => '0xD6BB', '0xCC' => '0xD6BC', '0xCD' => '0xD6BD', |
|
3199 | + '0xCE' => '0xD6BE', '0xCF' => '0xD6BF', '0xD0' => '0xD780', |
|
3200 | + '0xD2' => '0xD782', '0xE3' => '0xD793', '0xE4' => '0xD794', |
|
3201 | + '0xE5' => '0xD795', '0xE7' => '0xD797', '0xE9' => '0xD799', |
|
3202 | + '0xFD' => '0xE2808E', '0xFE' => '0xE2808F', '0x92' => '0xE28099', |
|
3203 | + '0x83' => '0xC692', '0xD3' => '0xD783', '0x88' => '0xCB86', |
|
3204 | + '0x98' => '0xCB9C', '0x91' => '0xE28098', '0x96' => '0xE28093', |
|
3205 | + '0xBA' => '0xC3B7', '0x9B' => '0xE280BA', '0xAA' => '0xC397', |
|
3206 | + '0xA4' => '0xE282AA', '0xE1' => '0xD791', '0xE6' => '0xD796', |
|
3207 | + '0xE8' => '0xD798', '0xEB' => '0xD79B', '0xF4' => '0xD7A4', |
|
3208 | 3208 | '0xFA' => '0xD7AA', |
3209 | 3209 | ), |
3210 | 3210 | 'windows-1253' => array( |
3211 | - '0x81' => '\'\'', '0x88' => '\'\'', '0x8A' => '\'\'', |
|
3212 | - '0x8C' => '\'\'', '0x8D' => '\'\'', '0x8E' => '\'\'', |
|
3213 | - '0x8F' => '\'\'', '0x90' => '\'\'', '0x98' => '\'\'', |
|
3214 | - '0x9A' => '\'\'', '0x9C' => '\'\'', '0x9D' => '\'\'', |
|
3215 | - '0x9E' => '\'\'', '0x9F' => '\'\'', '0xAA' => '\'\'', |
|
3216 | - '0xD2' => '0xE282AC', '0xFF' => '0xCE92', '0xCE' => '0xCE9E', |
|
3217 | - '0xB8' => '0xCE88', '0xBA' => '0xCE8A', '0xBC' => '0xCE8C', |
|
3218 | - '0xBE' => '0xCE8E', '0xBF' => '0xCE8F', '0xC0' => '0xCE90', |
|
3219 | - '0xC8' => '0xCE98', '0xCA' => '0xCE9A', '0xCC' => '0xCE9C', |
|
3220 | - '0xCD' => '0xCE9D', '0xCF' => '0xCE9F', '0xDA' => '0xCEAA', |
|
3221 | - '0xE8' => '0xCEB8', '0xEA' => '0xCEBA', '0xEC' => '0xCEBC', |
|
3222 | - '0xEE' => '0xCEBE', '0xEF' => '0xCEBF', '0xC2' => '0xFF', |
|
3223 | - '0xBD' => '0xC2BD', '0xED' => '0xCEBD', '0xB2' => '0xC2B2', |
|
3224 | - '0xA0' => '0xC2A0', '0xA3' => '0xC2A3', '0xA4' => '0xC2A4', |
|
3225 | - '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3226 | - '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3227 | - '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3228 | - '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', '0xB3' => '0xC2B3', |
|
3229 | - '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3230 | - '0xBB' => '0xC2BB', '0xE2' => '0xCEB2', '0x80' => '0xD2', |
|
3231 | - '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3232 | - '0x86' => '0xE280A0', '0xA1' => '0xCE85', '0xA2' => '0xCE86', |
|
3233 | - '0x87' => '0xE280A1', '0x89' => '0xE280B0', '0xB9' => '0xCE89', |
|
3234 | - '0x8B' => '0xE280B9', '0x91' => '0xE28098', '0x99' => '0xE284A2', |
|
3235 | - '0x92' => '0xE28099', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3236 | - '0x95' => '0xE280A2', '0x96' => '0xE28093', '0x97' => '0xE28094', |
|
3237 | - '0x9B' => '0xE280BA', '0xAF' => '0xE28095', '0xB4' => '0xCE84', |
|
3238 | - '0xC1' => '0xCE91', '0xC3' => '0xCE93', '0xC4' => '0xCE94', |
|
3239 | - '0xC5' => '0xCE95', '0xC6' => '0xCE96', '0x83' => '0xC692', |
|
3240 | - '0xC7' => '0xCE97', '0xC9' => '0xCE99', '0xCB' => '0xCE9B', |
|
3241 | - '0xD0' => '0xCEA0', '0xD1' => '0xCEA1', '0xD3' => '0xCEA3', |
|
3242 | - '0xD4' => '0xCEA4', '0xD5' => '0xCEA5', '0xD6' => '0xCEA6', |
|
3243 | - '0xD7' => '0xCEA7', '0xD8' => '0xCEA8', '0xD9' => '0xCEA9', |
|
3244 | - '0xDB' => '0xCEAB', '0xDC' => '0xCEAC', '0xDD' => '0xCEAD', |
|
3245 | - '0xDE' => '0xCEAE', '0xDF' => '0xCEAF', '0xE0' => '0xCEB0', |
|
3246 | - '0xE1' => '0xCEB1', '0xE3' => '0xCEB3', '0xE4' => '0xCEB4', |
|
3247 | - '0xE5' => '0xCEB5', '0xE6' => '0xCEB6', '0xE7' => '0xCEB7', |
|
3248 | - '0xE9' => '0xCEB9', '0xEB' => '0xCEBB', '0xF0' => '0xCF80', |
|
3249 | - '0xF1' => '0xCF81', '0xF2' => '0xCF82', '0xF3' => '0xCF83', |
|
3250 | - '0xF4' => '0xCF84', '0xF5' => '0xCF85', '0xF6' => '0xCF86', |
|
3251 | - '0xF7' => '0xCF87', '0xF8' => '0xCF88', '0xF9' => '0xCF89', |
|
3252 | - '0xFA' => '0xCF8A', '0xFB' => '0xCF8B', '0xFC' => '0xCF8C', |
|
3253 | - '0xFD' => '0xCF8D', '0xFE' => '0xCF8E', |
|
3211 | + '0x81' => '\'\'', '0x88' => '\'\'', '0x8A' => '\'\'', |
|
3212 | + '0x8C' => '\'\'', '0x8D' => '\'\'', '0x8E' => '\'\'', |
|
3213 | + '0x8F' => '\'\'', '0x90' => '\'\'', '0x98' => '\'\'', |
|
3214 | + '0x9A' => '\'\'', '0x9C' => '\'\'', '0x9D' => '\'\'', |
|
3215 | + '0x9E' => '\'\'', '0x9F' => '\'\'', '0xAA' => '\'\'', |
|
3216 | + '0xD2' => '0xE282AC', '0xFF' => '0xCE92', '0xCE' => '0xCE9E', |
|
3217 | + '0xB8' => '0xCE88', '0xBA' => '0xCE8A', '0xBC' => '0xCE8C', |
|
3218 | + '0xBE' => '0xCE8E', '0xBF' => '0xCE8F', '0xC0' => '0xCE90', |
|
3219 | + '0xC8' => '0xCE98', '0xCA' => '0xCE9A', '0xCC' => '0xCE9C', |
|
3220 | + '0xCD' => '0xCE9D', '0xCF' => '0xCE9F', '0xDA' => '0xCEAA', |
|
3221 | + '0xE8' => '0xCEB8', '0xEA' => '0xCEBA', '0xEC' => '0xCEBC', |
|
3222 | + '0xEE' => '0xCEBE', '0xEF' => '0xCEBF', '0xC2' => '0xFF', |
|
3223 | + '0xBD' => '0xC2BD', '0xED' => '0xCEBD', '0xB2' => '0xC2B2', |
|
3224 | + '0xA0' => '0xC2A0', '0xA3' => '0xC2A3', '0xA4' => '0xC2A4', |
|
3225 | + '0xA5' => '0xC2A5', '0xA6' => '0xC2A6', '0xA7' => '0xC2A7', |
|
3226 | + '0xA8' => '0xC2A8', '0xA9' => '0xC2A9', '0xAB' => '0xC2AB', |
|
3227 | + '0xAC' => '0xC2AC', '0xAD' => '0xC2AD', '0xAE' => '0xC2AE', |
|
3228 | + '0xB0' => '0xC2B0', '0xB1' => '0xC2B1', '0xB3' => '0xC2B3', |
|
3229 | + '0xB5' => '0xC2B5', '0xB6' => '0xC2B6', '0xB7' => '0xC2B7', |
|
3230 | + '0xBB' => '0xC2BB', '0xE2' => '0xCEB2', '0x80' => '0xD2', |
|
3231 | + '0x82' => '0xE2809A', '0x84' => '0xE2809E', '0x85' => '0xE280A6', |
|
3232 | + '0x86' => '0xE280A0', '0xA1' => '0xCE85', '0xA2' => '0xCE86', |
|
3233 | + '0x87' => '0xE280A1', '0x89' => '0xE280B0', '0xB9' => '0xCE89', |
|
3234 | + '0x8B' => '0xE280B9', '0x91' => '0xE28098', '0x99' => '0xE284A2', |
|
3235 | + '0x92' => '0xE28099', '0x93' => '0xE2809C', '0x94' => '0xE2809D', |
|
3236 | + '0x95' => '0xE280A2', '0x96' => '0xE28093', '0x97' => '0xE28094', |
|
3237 | + '0x9B' => '0xE280BA', '0xAF' => '0xE28095', '0xB4' => '0xCE84', |
|
3238 | + '0xC1' => '0xCE91', '0xC3' => '0xCE93', '0xC4' => '0xCE94', |
|
3239 | + '0xC5' => '0xCE95', '0xC6' => '0xCE96', '0x83' => '0xC692', |
|
3240 | + '0xC7' => '0xCE97', '0xC9' => '0xCE99', '0xCB' => '0xCE9B', |
|
3241 | + '0xD0' => '0xCEA0', '0xD1' => '0xCEA1', '0xD3' => '0xCEA3', |
|
3242 | + '0xD4' => '0xCEA4', '0xD5' => '0xCEA5', '0xD6' => '0xCEA6', |
|
3243 | + '0xD7' => '0xCEA7', '0xD8' => '0xCEA8', '0xD9' => '0xCEA9', |
|
3244 | + '0xDB' => '0xCEAB', '0xDC' => '0xCEAC', '0xDD' => '0xCEAD', |
|
3245 | + '0xDE' => '0xCEAE', '0xDF' => '0xCEAF', '0xE0' => '0xCEB0', |
|
3246 | + '0xE1' => '0xCEB1', '0xE3' => '0xCEB3', '0xE4' => '0xCEB4', |
|
3247 | + '0xE5' => '0xCEB5', '0xE6' => '0xCEB6', '0xE7' => '0xCEB7', |
|
3248 | + '0xE9' => '0xCEB9', '0xEB' => '0xCEBB', '0xF0' => '0xCF80', |
|
3249 | + '0xF1' => '0xCF81', '0xF2' => '0xCF82', '0xF3' => '0xCF83', |
|
3250 | + '0xF4' => '0xCF84', '0xF5' => '0xCF85', '0xF6' => '0xCF86', |
|
3251 | + '0xF7' => '0xCF87', '0xF8' => '0xCF88', '0xF9' => '0xCF89', |
|
3252 | + '0xFA' => '0xCF8A', '0xFB' => '0xCF8B', '0xFC' => '0xCF8C', |
|
3253 | + '0xFD' => '0xCF8D', '0xFE' => '0xCF8E', |
|
3254 | 3254 | ), |
3255 | 3255 | ); |
3256 | 3256 | |
@@ -3268,7 +3268,7 @@ discard block |
||
3268 | 3268 | db_extend(); |
3269 | 3269 | $queryTables = $smcFunc['db_list_tables'](false, $db_prefix . '%'); |
3270 | 3270 | |
3271 | - $queryTables = array_values(array_filter($queryTables, function($v){ |
|
3271 | + $queryTables = array_values(array_filter($queryTables, function($v) { |
|
3272 | 3272 | return stripos($v, 'backup_') !== 0; |
3273 | 3273 | })); |
3274 | 3274 | |
@@ -3514,7 +3514,7 @@ discard block |
||
3514 | 3514 | // This bit fixes incorrect string lengths, which can happen if the character encoding was changed (e.g. conversion to UTF-8) |
3515 | 3515 | $new_string = preg_replace_callback( |
3516 | 3516 | '~\bs:(\d+):"(.*?)";(?=$|[bidsaO]:|[{}}]|N;)~s', |
3517 | - function ($matches) |
|
3517 | + function($matches) |
|
3518 | 3518 | { |
3519 | 3519 | return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";'; |
3520 | 3520 | }, |
@@ -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(); |
@@ -1107,22 +1109,30 @@ discard block |
||
1107 | 1109 | |
1108 | 1110 | // 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 |
1109 | 1111 | // https://wiki.php.net/rfc/improve_unserialize_error_handling |
1110 | - try { |
|
1111 | - set_error_handler(static function ($severity, $message, $file, $line) { |
|
1112 | + try |
|
1113 | + { |
|
1114 | + set_error_handler(static function ($severity, $message, $file, $line) |
|
1115 | + { |
|
1112 | 1116 | throw new \ErrorException($message, 0, $severity, $file, $line); |
1113 | 1117 | }); |
1114 | 1118 | $ser_test = @unserialize($modSettings['attachmentUploadDir']); |
1115 | - } catch (\Throwable $e) { |
|
1119 | + } |
|
1120 | + catch (\Throwable $e) |
|
1121 | + { |
|
1116 | 1122 | $ser_test = false; |
1117 | 1123 | } |
1118 | - finally { |
|
1124 | + finally |
|
1125 | + { |
|
1119 | 1126 | restore_error_handler(); |
1120 | 1127 | } |
1121 | 1128 | |
1122 | 1129 | // Json is simple, it can be caught. |
1123 | - try { |
|
1130 | + try |
|
1131 | + { |
|
1124 | 1132 | $json_test = @json_decode($modSettings['attachmentUploadDir'], true); |
1125 | - } catch (\Throwable $e) { |
|
1133 | + } |
|
1134 | + catch (\Throwable $e) |
|
1135 | + { |
|
1126 | 1136 | $json_test = null; |
1127 | 1137 | } |
1128 | 1138 | |
@@ -3268,7 +3278,8 @@ discard block |
||
3268 | 3278 | db_extend(); |
3269 | 3279 | $queryTables = $smcFunc['db_list_tables'](false, $db_prefix . '%'); |
3270 | 3280 | |
3271 | - $queryTables = array_values(array_filter($queryTables, function($v){ |
|
3281 | + $queryTables = array_values(array_filter($queryTables, function($v) |
|
3282 | + { |
|
3272 | 3283 | return stripos($v, 'backup_') !== 0; |
3273 | 3284 | })); |
3274 | 3285 |
@@ -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 |
@@ -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'])) |
@@ -348,7 +348,8 @@ |
||
348 | 348 | |
349 | 349 | $message = $txt[$e->getMessage()] ?? $e->getMessage(); |
350 | 350 | |
351 | - if (!empty($modSettings['enableErrorLogging'])) { |
|
351 | + if (!empty($modSettings['enableErrorLogging'])) |
|
352 | + { |
|
352 | 353 | log_error($message, 'general', $e->getFile(), $e->getLine()); |
353 | 354 | } |
354 | 355 |