@@ -498,7 +498,7 @@ |
||
498 | 498 | log_error(sprintf($txt['smiley_set_dir_not_found'], $set_names[array_search($set, $context['smiley_sets'])])); |
499 | 499 | |
500 | 500 | $context['smiley_sets'] = array_filter($context['smiley_sets'], function($v) use ($set) |
501 | - { |
|
501 | + { |
|
502 | 502 | return $v != $set; |
503 | 503 | }); |
504 | 504 | } |
@@ -742,7 +742,7 @@ |
||
742 | 742 | |
743 | 743 | // Filter out any redundant separators before we start the loop |
744 | 744 | $context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context) |
745 | - { |
|
745 | + { |
|
746 | 746 | static $config_vars, $prev; |
747 | 747 | |
748 | 748 | $at_start = is_null($config_vars); |
@@ -1965,7 +1965,9 @@ |
||
1965 | 1965 | // Remove anything that isn't actually new from our list of files |
1966 | 1966 | foreach ($to_unset as $key => $ids) |
1967 | 1967 | { |
1968 | - if (array_reduce($ids, function ($carry, $item) { return $carry * $item; }, true) == true) |
|
1968 | + if (array_reduce($ids, function ($carry, $item) |
|
1969 | + { |
|
1970 | +return $carry * $item; }, true) == true) |
|
1969 | 1971 | unset($smiley_files[$key]); |
1970 | 1972 | } |
1971 | 1973 |
@@ -1254,7 +1254,6 @@ |
||
1254 | 1254 | |
1255 | 1255 | return array($charset, $string, 'base64'); |
1256 | 1256 | } |
1257 | - |
|
1258 | 1257 | else |
1259 | 1258 | return array($charset, $string, '7bit'); |
1260 | 1259 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | // Set a list of common functions. |
83 | 83 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
84 | 84 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
85 | - { |
|
85 | + { |
|
86 | 86 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
87 | 87 | return $string; |
88 | 88 | } : function($string) |
@@ -2131,7 +2131,6 @@ discard block |
||
2131 | 2131 | loadLanguage('index+Modifications'); |
2132 | 2132 | $context['template_layers'] = array(); |
2133 | 2133 | } |
2134 | - |
|
2135 | 2134 | else |
2136 | 2135 | { |
2137 | 2136 | // Custom templates to load, or just default? |
@@ -2509,14 +2508,12 @@ discard block |
||
2509 | 2508 | $fileUrl = $settings['default_theme_url'] . '/css/' . $fileName; |
2510 | 2509 | $filePath = $settings['default_theme_dir'] . '/css/' . $fileName; |
2511 | 2510 | } |
2512 | - |
|
2513 | 2511 | else |
2514 | 2512 | { |
2515 | 2513 | $fileUrl = false; |
2516 | 2514 | $filePath = false; |
2517 | 2515 | } |
2518 | 2516 | } |
2519 | - |
|
2520 | 2517 | else |
2521 | 2518 | { |
2522 | 2519 | $fileUrl = $settings[$themeRef . '_url'] . '/css/' . $fileName; |
@@ -2623,14 +2620,12 @@ discard block |
||
2623 | 2620 | $fileUrl = $settings['default_theme_url'] . '/scripts/' . $fileName; |
2624 | 2621 | $filePath = $settings['default_theme_dir'] . '/scripts/' . $fileName; |
2625 | 2622 | } |
2626 | - |
|
2627 | 2623 | else |
2628 | 2624 | { |
2629 | 2625 | $fileUrl = false; |
2630 | 2626 | $filePath = false; |
2631 | 2627 | } |
2632 | 2628 | } |
2633 | - |
|
2634 | 2629 | else |
2635 | 2630 | { |
2636 | 2631 | $fileUrl = $settings[$themeRef . '_url'] . '/scripts/' . $fileName; |
@@ -3205,7 +3205,9 @@ |
||
3205 | 3205 | return $string; |
3206 | 3206 | |
3207 | 3207 | // This bit fixes incorrect string lengths, which can happen if the character encoding was changed (e.g. conversion to UTF-8) |
3208 | - $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) {return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
3208 | + $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) |
|
3209 | + { |
|
3210 | +return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
3209 | 3211 | |
3210 | 3212 | // @todo Add more possible fixes here. For example, fix incorrect array lengths, try to handle truncated strings gracefully, etc. |
3211 | 3213 |
@@ -1824,7 +1824,7 @@ |
||
1824 | 1824 | { |
1825 | 1825 | // Make sure this is an array of integers |
1826 | 1826 | $excluded_groups = array_filter((array) $excluded_groups, function ($v) |
1827 | - { |
|
1827 | + { |
|
1828 | 1828 | return is_int($v) || is_string($v) && (string) intval($v) === $v; |
1829 | 1829 | }); |
1830 | 1830 |
@@ -100,18 +100,22 @@ |
||
100 | 100 | $tempTab++; |
101 | 101 | $context['tabindex'] = $tempTab; |
102 | 102 | |
103 | - foreach ($context['richedit_buttons'] as $name => $button) { |
|
104 | - if ($name == 'spell_check') { |
|
103 | + foreach ($context['richedit_buttons'] as $name => $button) |
|
104 | + { |
|
105 | + if ($name == 'spell_check') |
|
106 | + { |
|
105 | 107 | $button['onclick'] = 'oEditorHandle_' . $editor_id . '.spellCheckStart();'; |
106 | 108 | } |
107 | 109 | |
108 | - if ($name == 'preview') { |
|
110 | + if ($name == 'preview') |
|
111 | + { |
|
109 | 112 | $button['value'] = isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $button['value']; |
110 | 113 | $button['onclick'] = $editor_context['preview_type'] == 2 ? '' : 'return submitThisOnce(this);'; |
111 | 114 | $button['show'] = $editor_context['preview_type']; |
112 | 115 | } |
113 | 116 | |
114 | - if ($button['show']) { |
|
117 | + if ($button['show']) |
|
118 | + { |
|
115 | 119 | echo ' |
116 | 120 | <input type="', $button['type'], '"', $button['type'] == 'hidden' ? ' id="' . $name . '"' : '', ' name="', $name, '" value="', $button['value'], '"', $button['type'] != 'hidden' ? ' tabindex="' . --$tempTab . '"' : '', !empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : '', !empty($button['accessKey']) ? ' accesskey="' . $button['accessKey'] . '"' : '', $button['type'] != 'hidden' ? ' class="button"' : '', '>'; |
117 | 121 | } |
@@ -302,7 +302,6 @@ discard block |
||
302 | 302 | $condition = 'id_member IN ({array_int:members})'; |
303 | 303 | $parameters['members'] = $members; |
304 | 304 | } |
305 | - |
|
306 | 305 | elseif ($members === null) |
307 | 306 | $condition = '1=1'; |
308 | 307 | |
@@ -2156,7 +2155,7 @@ discard block |
||
2156 | 2155 | 'tag' => 'cowsay', |
2157 | 2156 | 'parameters' => array( |
2158 | 2157 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
2159 | - { |
|
2158 | + { |
|
2160 | 2159 | static $css_added; |
2161 | 2160 | |
2162 | 2161 | if (empty($css_added)) |
@@ -2173,7 +2172,7 @@ discard block |
||
2173 | 2172 | }, |
2174 | 2173 | ), |
2175 | 2174 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
2176 | - { |
|
2175 | + { |
|
2177 | 2176 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2178 | 2177 | }, |
2179 | 2178 | ), |
@@ -3280,7 +3279,7 @@ discard block |
||
3280 | 3279 | |
3281 | 3280 | // Replace away! |
3282 | 3281 | $message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements) |
3283 | - { |
|
3282 | + { |
|
3284 | 3283 | return $smileyPregReplacements[$matches[1]]; |
3285 | 3284 | }, $message); |
3286 | 3285 | } |
@@ -4067,7 +4066,6 @@ discard block |
||
4067 | 4066 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
4068 | 4067 | $minSeed = $js_file['options']['seed']; |
4069 | 4068 | } |
4070 | - |
|
4071 | 4069 | else |
4072 | 4070 | { |
4073 | 4071 | echo ' |
@@ -6255,7 +6253,6 @@ discard block |
||
6255 | 6253 | $isWritable = true; |
6256 | 6254 | break; |
6257 | 6255 | } |
6258 | - |
|
6259 | 6256 | else |
6260 | 6257 | @chmod($file, $val); |
6261 | 6258 | } |
@@ -7135,7 +7132,6 @@ discard block |
||
7135 | 7132 | |
7136 | 7133 | $length += array_length($value, $deep_count); |
7137 | 7134 | } |
7138 | - |
|
7139 | 7135 | else |
7140 | 7136 | $length += strlen($value); |
7141 | 7137 | } |