@@ -149,16 +149,16 @@ discard block |
||
149 | 149 | { |
150 | 150 | global $context, $txt; |
151 | 151 | |
152 | - if (!in_array($txt[self::CLASS_KEY .'_settings'], $config_vars)) |
|
152 | + if (!in_array($txt[self::CLASS_KEY . '_settings'], $config_vars)) |
|
153 | 153 | { |
154 | - $config_vars[] = $txt[self::CLASS_KEY .'_settings']; |
|
154 | + $config_vars[] = $txt[self::CLASS_KEY . '_settings']; |
|
155 | 155 | $config_vars[] = array( |
156 | 156 | self::CLASS_KEY, |
157 | - $txt[self::CLASS_KEY .'_servers'], |
|
157 | + $txt[self::CLASS_KEY . '_servers'], |
|
158 | 158 | 'file', |
159 | 159 | 'text', |
160 | 160 | 0, |
161 | - 'subtext' => $txt[self::CLASS_KEY .'_servers_subtext']); |
|
161 | + 'subtext' => $txt[self::CLASS_KEY . '_servers_subtext']); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | if (!isset($context['settings_post_javascript'])) |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $context['settings_post_javascript'] .= ' |
168 | 168 | $("#cache_accelerator").change(function (e) { |
169 | 169 | var cache_type = e.currentTarget.value; |
170 | - $("#'. self::CLASS_KEY .'").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
170 | + $("#'. self::CLASS_KEY . '").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
171 | 171 | });'; |
172 | 172 | } |
173 | 173 |
@@ -1721,7 +1721,7 @@ discard block |
||
1721 | 1721 | { |
1722 | 1722 | // Avoid double separators and empty titled sections |
1723 | 1723 | $empty_section = true; |
1724 | - for ($j=$i+1; $j < count($context['theme_options']); $j++) |
|
1724 | + for ($j = $i + 1; $j < count($context['theme_options']); $j++) |
|
1725 | 1725 | { |
1726 | 1726 | // Found another separator, so we're done |
1727 | 1727 | if (!is_array($context['theme_options'][$j])) |
@@ -2700,8 +2700,7 @@ discard block |
||
2700 | 2700 | foreach ($context['post_errors'] as $error) |
2701 | 2701 | { |
2702 | 2702 | $text_key_error = $error == 'password_short' ? |
2703 | - sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : |
|
2704 | - (isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : ''); |
|
2703 | + sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : (isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : ''); |
|
2705 | 2704 | |
2706 | 2705 | echo ' |
2707 | 2706 | <li>', isset($txt['profile_error_' . $error]) ? $text_key_error : $error, '</li>'; |
@@ -807,7 +807,8 @@ |
||
807 | 807 | { |
808 | 808 | $context['spider_logs']['rows'][$k]['data']['viewing']['value'] = $txt[$new_url['label']]; |
809 | 809 | $context['spider_logs']['rows'][$k]['data']['viewing']['class'] = $new_url['class']; |
810 | - } else |
|
810 | + } |
|
811 | + else |
|
811 | 812 | $context['spider_logs']['rows'][$k]['data']['viewing']['value'] = $new_url; |
812 | 813 | } |
813 | 814 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | require_once($sourcedir . '/Security.php'); |
79 | 79 | |
80 | 80 | // If $maintenance is set specifically to 2, then we're upgrading or something. |
81 | -if (!empty($maintenance) && 2 === $maintenance) |
|
81 | +if (!empty($maintenance) && 2 === $maintenance) |
|
82 | 82 | { |
83 | 83 | display_maintenance_message(); |
84 | 84 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @param string $class The fully-qualified class name. |
96 | 96 | */ |
97 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
97 | +spl_autoload_register(function($class) use ($sourcedir) |
|
98 | 98 | { |
99 | 99 | $classMap = array( |
100 | 100 | 'ReCaptcha\\' => 'ReCaptcha/', |
@@ -340,7 +340,7 @@ |
||
340 | 340 | WHERE t.id_board = {int:current_board} ' |
341 | 341 | . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' |
342 | 342 | AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . (!empty($message_index_topic_wheres) ? ' |
343 | - AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : ''). ' |
|
343 | + AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : '') . ' |
|
344 | 344 | ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' |
345 | 345 | LIMIT {int:maxindex} |
346 | 346 | OFFSET {int:start} '; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | { |
379 | 379 | $val = 'CASE '; |
380 | 380 | foreach ($members as $k => $v) |
381 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
381 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
382 | 382 | |
383 | 383 | $val = $val . ' END'; |
384 | 384 | $type = 'raw'; |
@@ -1041,11 +1041,11 @@ discard block |
||
1041 | 1041 | // Anything that isn't a specification, punctuation mark, or whitespace. |
1042 | 1042 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
1043 | 1043 | // A series of punctuation marks (except %), possibly separated by whitespace. |
1044 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1044 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1045 | 1045 | // Unwanted trailing punctuation and whitespace. |
1046 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1046 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1047 | 1047 | // Unwanted opening punctuation and whitespace. |
1048 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1048 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1049 | 1049 | ), |
1050 | 1050 | array( |
1051 | 1051 | '', |
@@ -1443,7 +1443,7 @@ discard block |
||
1443 | 1443 | $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img"></a>'; |
1444 | 1444 | else |
1445 | 1445 | { |
1446 | - $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': ''; |
|
1446 | + $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
|
1447 | 1447 | $height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : ''; |
1448 | 1448 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>'; |
1449 | 1449 | } |
@@ -1454,7 +1454,7 @@ discard block |
||
1454 | 1454 | $width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"' : ''; |
1455 | 1455 | $height = !empty($params['{height}']) ? ' height="' . $params['{height}'] . '"' : ''; |
1456 | 1456 | |
1457 | - $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1457 | + $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
1458 | 1458 | } |
1459 | 1459 | // Audio. |
1460 | 1460 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | $width = 'max-width:100%; width: ' . (!empty($params['{width}']) ? $params['{width}'] : '400') . 'px;'; |
1463 | 1463 | $height = !empty($params['{height}']) ? 'height: ' . $params['{height}'] . 'px;' : ''; |
1464 | 1464 | |
1465 | - $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="'. $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
1465 | + $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="' . $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
1466 | 1466 | } |
1467 | 1467 | // Anything else. |
1468 | 1468 | else |
@@ -1631,7 +1631,7 @@ discard block |
||
1631 | 1631 | 'type' => 'unparsed_commas_content', |
1632 | 1632 | 'test' => '\d+,\d+\]', |
1633 | 1633 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1634 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1634 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1635 | 1635 | { |
1636 | 1636 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1637 | 1637 | if (empty($scheme)) |
@@ -1744,8 +1744,8 @@ discard block |
||
1744 | 1744 | else |
1745 | 1745 | $url = get_proxied_url($url); |
1746 | 1746 | |
1747 | - $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}']. '"' : ' alt=""'; |
|
1748 | - $title = !empty($params['{title}']) ? ' title="' . $params['{title}']. '"' : ''; |
|
1747 | + $alt = !empty($params['{alt}']) ? ' alt="' . $params['{alt}'] . '"' : ' alt=""'; |
|
1748 | + $title = !empty($params['{title}']) ? ' title="' . $params['{title}'] . '"' : ''; |
|
1749 | 1749 | |
1750 | 1750 | $data = isset($disabled[$tag['tag']]) ? $url : '<img src="' . $url . '"' . $alt . $title . $params['{width}'] . $params['{height}'] . ' class="bbc_img' . (!empty($params['{width}']) || !empty($params['{height}']) ? ' resized' : '') . '" loading="lazy">'; |
1751 | 1751 | }, |
@@ -2159,12 +2159,12 @@ discard block |
||
2159 | 2159 | $codes[] = array( |
2160 | 2160 | 'tag' => 'cowsay', |
2161 | 2161 | 'parameters' => array( |
2162 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2162 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2163 | 2163 | { |
2164 | 2164 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2165 | 2165 | }, |
2166 | 2166 | ), |
2167 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2167 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2168 | 2168 | { |
2169 | 2169 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2170 | 2170 | }, |
@@ -3813,7 +3813,7 @@ discard block |
||
3813 | 3813 | if ($fp != false) |
3814 | 3814 | { |
3815 | 3815 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
3816 | - fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: '. SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
3816 | + fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: ' . SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
3817 | 3817 | |
3818 | 3818 | // Read in the HTTP/1.1 or whatever. |
3819 | 3819 | $test = substr(fgets($fp, 11), -1); |
@@ -4430,7 +4430,7 @@ discard block |
||
4430 | 4430 | $toMinify = array(); |
4431 | 4431 | $normal = array(); |
4432 | 4432 | |
4433 | - uasort($context['css_files'], function ($a, $b) |
|
4433 | + uasort($context['css_files'], function($a, $b) |
|
4434 | 4434 | { |
4435 | 4435 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4436 | 4436 | }); |
@@ -5727,7 +5727,7 @@ discard block |
||
5727 | 5727 | { |
5728 | 5728 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5729 | 5729 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5730 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5730 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5731 | 5731 | if ($keep_alive) |
5732 | 5732 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5733 | 5733 | else |
@@ -5737,7 +5737,7 @@ discard block |
||
5737 | 5737 | { |
5738 | 5738 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5739 | 5739 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5740 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5740 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5741 | 5741 | if ($keep_alive) |
5742 | 5742 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5743 | 5743 | else |
@@ -5986,13 +5986,13 @@ discard block |
||
5986 | 5986 | |
5987 | 5987 | // UTF-8 occurences of MS special characters |
5988 | 5988 | $findchars_utf8 = array( |
5989 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
5990 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
5991 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
5992 | - "\xe2\x80\x98", // left single curly quote |
|
5993 | - "\xe2\x80\x99", // right single curly quote |
|
5994 | - "\xe2\x80\x9c", // left double curly quote |
|
5995 | - "\xe2\x80\x9d", // right double curly quote |
|
5989 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
5990 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
5991 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
5992 | + "\xe2\x80\x98", // left single curly quote |
|
5993 | + "\xe2\x80\x99", // right single curly quote |
|
5994 | + "\xe2\x80\x9c", // left double curly quote |
|
5995 | + "\xe2\x80\x9d", // right double curly quote |
|
5996 | 5996 | ); |
5997 | 5997 | |
5998 | 5998 | // windows 1252 / iso equivalents |
@@ -6008,13 +6008,13 @@ discard block |
||
6008 | 6008 | |
6009 | 6009 | // safe replacements |
6010 | 6010 | $replacechars = array( |
6011 | - ',', // ‚ |
|
6012 | - ',,', // „ |
|
6013 | - '...', // … |
|
6014 | - "'", // ‘ |
|
6015 | - "'", // ’ |
|
6016 | - '"', // “ |
|
6017 | - '"', // ” |
|
6011 | + ',', // ‚ |
|
6012 | + ',,', // „ |
|
6013 | + '...', // … |
|
6014 | + "'", // ‘ |
|
6015 | + "'", // ’ |
|
6016 | + '"', // “ |
|
6017 | + '"', // ” |
|
6018 | 6018 | ); |
6019 | 6019 | |
6020 | 6020 | if ($context['utf8']) |
@@ -6359,7 +6359,7 @@ discard block |
||
6359 | 6359 | $desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : ''); |
6360 | 6360 | |
6361 | 6361 | // We don't want abbreviations like '+03' or '-11'. |
6362 | - $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) { |
|
6362 | + $abbrs = array_filter($tzvalue['abbrs'], function($abbr) { |
|
6363 | 6363 | return !strspn($abbr, '+-'); |
6364 | 6364 | }); |
6365 | 6365 | $abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array(); |
@@ -7323,7 +7323,7 @@ discard block |
||
7323 | 7323 | EXISTS ( |
7324 | 7324 | SELECT bpv.id_board |
7325 | 7325 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7326 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
7326 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
7327 | 7327 | AND bpv.deny = 0 |
7328 | 7328 | AND bpv.id_board = b.id_board |
7329 | 7329 | )'; |
@@ -7333,7 +7333,7 @@ discard block |
||
7333 | 7333 | AND NOT EXISTS ( |
7334 | 7334 | SELECT bpv.id_board |
7335 | 7335 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
7336 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
7336 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
7337 | 7337 | AND bpv.deny = 1 |
7338 | 7338 | AND bpv.id_board = b.id_board |
7339 | 7339 | )'; |
@@ -7638,8 +7638,8 @@ discard block |
||
7638 | 7638 | $i = 0; |
7639 | 7639 | while (empty($done)) |
7640 | 7640 | { |
7641 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7642 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7641 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7642 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7643 | 7643 | else |
7644 | 7644 | $done = true; |
7645 | 7645 | } |
@@ -7649,8 +7649,8 @@ discard block |
||
7649 | 7649 | $i = 0; |
7650 | 7650 | while (empty($done)) |
7651 | 7651 | { |
7652 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7653 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7652 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7653 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7654 | 7654 | else |
7655 | 7655 | $done = true; |
7656 | 7656 | } |
@@ -280,7 +280,6 @@ discard block |
||
280 | 280 | $condition = 'id_member IN ({array_int:members})'; |
281 | 281 | $parameters['members'] = $members; |
282 | 282 | } |
283 | - |
|
284 | 283 | elseif ($members === null) |
285 | 284 | $condition = '1=1'; |
286 | 285 | |
@@ -383,11 +382,9 @@ discard block |
||
383 | 382 | $val = $val . ' END'; |
384 | 383 | $type = 'raw'; |
385 | 384 | } |
386 | - |
|
387 | 385 | else |
388 | 386 | $val = alert_count($members, true); |
389 | 387 | } |
390 | - |
|
391 | 388 | elseif ($type == 'int' && ($val === '+' || $val === '-')) |
392 | 389 | { |
393 | 390 | $val = $var . ' ' . $val . ' 1'; |
@@ -2160,12 +2157,12 @@ discard block |
||
2160 | 2157 | 'tag' => 'cowsay', |
2161 | 2158 | 'parameters' => array( |
2162 | 2159 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
2163 | - { |
|
2160 | + { |
|
2164 | 2161 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2165 | 2162 | }, |
2166 | 2163 | ), |
2167 | 2164 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
2168 | - { |
|
2165 | + { |
|
2169 | 2166 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2170 | 2167 | }, |
2171 | 2168 | ), |
@@ -2494,7 +2491,8 @@ discard block |
||
2494 | 2491 | |
2495 | 2492 | foreach (array('path', 'query', 'fragment') as $part) |
2496 | 2493 | { |
2497 | - switch ($part) { |
|
2494 | + switch ($part) |
|
2495 | + { |
|
2498 | 2496 | case 'path': |
2499 | 2497 | $part_disallowed_chars = '<>' . $bracket_quote_chars . $space_chars . $excluded_trailing_chars . '/#&'; |
2500 | 2498 | $part_excluded_trailing_chars = str_replace('?', '', $excluded_trailing_chars); |
@@ -2807,7 +2805,9 @@ discard block |
||
2807 | 2805 | $look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2)); |
2808 | 2806 | |
2809 | 2807 | // A closing tag that doesn't match any open tags? Skip it. |
2810 | - if (!in_array($look_for, array_map(function($code) { return $code['tag']; }, $open_tags))) |
|
2808 | + if (!in_array($look_for, array_map(function($code) |
|
2809 | + { |
|
2810 | +return $code['tag']; }, $open_tags))) |
|
2811 | 2811 | continue; |
2812 | 2812 | |
2813 | 2813 | $to_close = array(); |
@@ -3537,7 +3537,7 @@ discard block |
||
3537 | 3537 | |
3538 | 3538 | // Replace away! |
3539 | 3539 | $message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements) |
3540 | - { |
|
3540 | + { |
|
3541 | 3541 | return $smileyPregReplacements[$matches[1]]; |
3542 | 3542 | }, $message); |
3543 | 3543 | } |
@@ -4348,7 +4348,6 @@ discard block |
||
4348 | 4348 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
4349 | 4349 | $minSeed = $js_file['options']['seed']; |
4350 | 4350 | } |
4351 | - |
|
4352 | 4351 | else |
4353 | 4352 | { |
4354 | 4353 | echo ' |
@@ -6274,7 +6273,8 @@ discard block |
||
6274 | 6273 | $zones[$tzkey]['tzid'] = $tzid; |
6275 | 6274 | $zones[$tzkey]['dst_type'] = count($tzinfo) > 1 ? 1 : ($tzinfo[0]['isdst'] ? 2 : 0); |
6276 | 6275 | |
6277 | - foreach ($tzinfo as $transition) { |
|
6276 | + foreach ($tzinfo as $transition) |
|
6277 | + { |
|
6278 | 6278 | $zones[$tzkey]['abbrs'][] = $transition['abbr']; |
6279 | 6279 | } |
6280 | 6280 | |
@@ -6359,7 +6359,8 @@ discard block |
||
6359 | 6359 | $desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : ''); |
6360 | 6360 | |
6361 | 6361 | // We don't want abbreviations like '+03' or '-11'. |
6362 | - $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) { |
|
6362 | + $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) |
|
6363 | + { |
|
6363 | 6364 | return !strspn($abbr, '+-'); |
6364 | 6365 | }); |
6365 | 6366 | $abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array(); |
@@ -6760,7 +6761,6 @@ discard block |
||
6760 | 6761 | $isWritable = true; |
6761 | 6762 | break; |
6762 | 6763 | } |
6763 | - |
|
6764 | 6764 | else |
6765 | 6765 | @chmod($file, $val); |
6766 | 6766 | } |
@@ -756,7 +756,7 @@ |
||
756 | 756 | } |
757 | 757 | |
758 | 758 | // Filter out any redundant separators before we start the loop |
759 | - $context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context) |
|
759 | + $context['config_vars'] = array_filter($context['config_vars'], function($v) use ($context) |
|
760 | 760 | { |
761 | 761 | static $config_vars, $prev; |
762 | 762 |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | // Figure out the filename we'll tell the browser. |
470 | 470 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
471 | 471 | $included_desc = array_map( |
472 | - function ($datatype) use ($txt) |
|
472 | + function($datatype) use ($txt) |
|
473 | 473 | { |
474 | 474 | return $txt[$datatype]; |
475 | 475 | }, |
@@ -789,9 +789,9 @@ discard block |
||
789 | 789 | $xslt_variables = array(); |
790 | 790 | |
791 | 791 | // Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function. |
792 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile'; |
|
793 | - $xslt_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform'; |
|
794 | - $html_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml'; |
|
792 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile'; |
|
793 | + $xslt_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform'; |
|
794 | + $html_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml'; |
|
795 | 795 | |
796 | 796 | require_once($sourcedir . DIRECTORY_SEPARATOR . 'News.php'); |
797 | 797 | |
@@ -1696,14 +1696,14 @@ discard block |
||
1696 | 1696 | |
1697 | 1697 | if (!empty($context['export_css_header'])) |
1698 | 1698 | { |
1699 | - $stylesheet['css_js'] .= ' |
|
1699 | + $stylesheet['css_js'] .= ' |
|
1700 | 1700 | <style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]> |
1701 | 1701 | </style>'; |
1702 | 1702 | } |
1703 | 1703 | |
1704 | 1704 | if (!empty($context['export_javascript_vars'])) |
1705 | 1705 | { |
1706 | - $stylesheet['css_js'] .= ' |
|
1706 | + $stylesheet['css_js'] .= ' |
|
1707 | 1707 | <script><![CDATA['; |
1708 | 1708 | |
1709 | 1709 | foreach ($context['export_javascript_vars'] as $var => $val) |
@@ -1739,7 +1739,7 @@ discard block |
||
1739 | 1739 | |
1740 | 1740 | if (!empty($context['export_javascript_inline']['standard'])) |
1741 | 1741 | { |
1742 | - $stylesheet['css_js'] .= ' |
|
1742 | + $stylesheet['css_js'] .= ' |
|
1743 | 1743 | <script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]> |
1744 | 1744 | </script>'; |
1745 | 1745 | } |
@@ -1751,7 +1751,7 @@ discard block |
||
1751 | 1751 | |
1752 | 1752 | $stylesheet['css_js'] .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer'])); |
1753 | 1753 | |
1754 | - $stylesheet['css_js'] .= "\n" . '});'. "\n" . ']]> |
|
1754 | + $stylesheet['css_js'] .= "\n" . '});' . "\n" . ']]> |
|
1755 | 1755 | </script>'; |
1756 | 1756 | } |
1757 | 1757 | |
@@ -1832,7 +1832,7 @@ discard block |
||
1832 | 1832 | $css_to_minify = array(); |
1833 | 1833 | $normal_css_files = array(); |
1834 | 1834 | |
1835 | - usort($context['css_files'], function ($a, $b) |
|
1835 | + usort($context['css_files'], function($a, $b) |
|
1836 | 1836 | { |
1837 | 1837 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
1838 | 1838 | }); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $feed_meta = array( |
205 | 205 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
206 | 206 | 'desc' => sentence_list(array_map( |
207 | - function ($datatype) use ($txt) |
|
207 | + function($datatype) use ($txt) |
|
208 | 208 | { |
209 | 209 | return $txt[$datatype]; |
210 | 210 | }, |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | 'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"', |
727 | 727 | ), |
728 | 728 | $returnContext |
729 | - ) . $hidden_orig_link . '</span>' ; |
|
729 | + ) . $hidden_orig_link . '</span>'; |
|
730 | 730 | } |
731 | 731 | elseif (strpos($currentAttachment['mime_type'], 'video/') === 0) |
732 | 732 | { |