@@ -3204,7 +3204,9 @@ |
||
| 3204 | 3204 | return $string; |
| 3205 | 3205 | |
| 3206 | 3206 | // This bit fixes incorrect string lengths, which can happen if the character encoding was changed (e.g. conversion to UTF-8) |
| 3207 | - $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) {return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
| 3207 | + $new_string = preg_replace_callback('~\bs:(\d+):"(.*?)";(?=$|[bidsa]:|[{}]|N;)~s', function ($matches) |
|
| 3208 | + { |
|
| 3209 | +return 's:' . strlen($matches[2]) . ':"' . $matches[2] . '";';}, $string); |
|
| 3208 | 3210 | |
| 3209 | 3211 | // @todo Add more possible fixes here. For example, fix incorrect array lengths, try to handle truncated strings gracefully, etc. |
| 3210 | 3212 | |
@@ -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 | } |
@@ -222,7 +222,6 @@ |
||
| 222 | 222 | |
| 223 | 223 | $this->_validLikes['can_like'] = ($this->_user['id'] == $topicOwner ? 'cannot_like_content' : (allowedTo('likes_like') ? true : 'cannot_like_content')); |
| 224 | 224 | } |
| 225 | - |
|
| 226 | 225 | else |
| 227 | 226 | { |
| 228 | 227 | // Modders: This will give you whatever the user offers up in terms of liking, e.g. $this->_type=msg, $this->_content=1 |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * @return bool Always returns true. |
| 25 | 25 | */ |
| 26 | 26 | public function execute() |
| 27 | - { |
|
| 27 | + { |
|
| 28 | 28 | global $sourcedir, $smcFunc, $language, $modSettings, $scripturl; |
| 29 | 29 | |
| 30 | 30 | // Do we have any group moderators? |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | // Set a list of common functions. |
| 99 | 99 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
| 100 | 100 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
| 101 | - { |
|
| 101 | + { |
|
| 102 | 102 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
| 103 | 103 | return $string; |
| 104 | 104 | } : function($string) |
@@ -2176,7 +2176,6 @@ discard block |
||
| 2176 | 2176 | loadLanguage('index+Modifications'); |
| 2177 | 2177 | $context['template_layers'] = array(); |
| 2178 | 2178 | } |
| 2179 | - |
|
| 2180 | 2179 | else |
| 2181 | 2180 | { |
| 2182 | 2181 | // Custom templates to load, or just default? |
@@ -2555,14 +2554,12 @@ discard block |
||
| 2555 | 2554 | $fileUrl = $settings['default_theme_url'] . '/css/' . $fileName; |
| 2556 | 2555 | $filePath = $settings['default_theme_dir'] . '/css/' . $fileName; |
| 2557 | 2556 | } |
| 2558 | - |
|
| 2559 | 2557 | else |
| 2560 | 2558 | { |
| 2561 | 2559 | $fileUrl = false; |
| 2562 | 2560 | $filePath = false; |
| 2563 | 2561 | } |
| 2564 | 2562 | } |
| 2565 | - |
|
| 2566 | 2563 | else |
| 2567 | 2564 | { |
| 2568 | 2565 | $fileUrl = $settings[$themeRef . '_url'] . '/css/' . $fileName; |
@@ -2670,14 +2667,12 @@ discard block |
||
| 2670 | 2667 | $fileUrl = $settings['default_theme_url'] . '/scripts/' . $fileName; |
| 2671 | 2668 | $filePath = $settings['default_theme_dir'] . '/scripts/' . $fileName; |
| 2672 | 2669 | } |
| 2673 | - |
|
| 2674 | 2670 | else |
| 2675 | 2671 | { |
| 2676 | 2672 | $fileUrl = false; |
| 2677 | 2673 | $filePath = false; |
| 2678 | 2674 | } |
| 2679 | 2675 | } |
| 2680 | - |
|
| 2681 | 2676 | else |
| 2682 | 2677 | { |
| 2683 | 2678 | $fileUrl = $settings[$themeRef . '_url'] . '/scripts/' . $fileName; |
@@ -2293,7 +2293,6 @@ |
||
| 2293 | 2293 | list ($hookData['class'], $hookData['method']) = explode('::', $modFunc); |
| 2294 | 2294 | $hookData['pureFunc'] = $hookData['method']; |
| 2295 | 2295 | } |
| 2296 | - |
|
| 2297 | 2296 | else |
| 2298 | 2297 | $hookData['pureFunc'] = $modFunc; |
| 2299 | 2298 | |
@@ -974,7 +974,7 @@ |
||
| 974 | 974 | { |
| 975 | 975 | $row = $smcFunc['db_fetch_assoc']($result); |
| 976 | 976 | if ($row['standard_conforming_strings'] !== 'on') |
| 977 | - { |
|
| 977 | + { |
|
| 978 | 978 | $incontext['continue'] = 0; |
| 979 | 979 | $incontext['error'] = $txt['error_pg_scs']; |
| 980 | 980 | } |
@@ -306,7 +306,6 @@ discard block |
||
| 306 | 306 | $condition = 'id_member IN ({array_int:members})'; |
| 307 | 307 | $parameters['members'] = $members; |
| 308 | 308 | } |
| 309 | - |
|
| 310 | 309 | elseif ($members === null) |
| 311 | 310 | $condition = '1=1'; |
| 312 | 311 | |
@@ -2198,7 +2197,7 @@ discard block |
||
| 2198 | 2197 | 'tag' => 'cowsay', |
| 2199 | 2198 | 'parameters' => array( |
| 2200 | 2199 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
| 2201 | - { |
|
| 2200 | + { |
|
| 2202 | 2201 | static $css_added; |
| 2203 | 2202 | |
| 2204 | 2203 | if (empty($css_added)) |
@@ -2215,7 +2214,7 @@ discard block |
||
| 2215 | 2214 | }, |
| 2216 | 2215 | ), |
| 2217 | 2216 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
| 2218 | - { |
|
| 2217 | + { |
|
| 2219 | 2218 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2220 | 2219 | }, |
| 2221 | 2220 | ), |
@@ -3313,7 +3312,7 @@ discard block |
||
| 3313 | 3312 | |
| 3314 | 3313 | // Replace away! |
| 3315 | 3314 | $message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements) |
| 3316 | - { |
|
| 3315 | + { |
|
| 3317 | 3316 | return $smileyPregReplacements[$matches[1]]; |
| 3318 | 3317 | }, $message); |
| 3319 | 3318 | } |
@@ -4100,7 +4099,6 @@ discard block |
||
| 4100 | 4099 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
| 4101 | 4100 | $minSeed = $js_file['options']['seed']; |
| 4102 | 4101 | } |
| 4103 | - |
|
| 4104 | 4102 | else |
| 4105 | 4103 | { |
| 4106 | 4104 | echo ' |
@@ -6282,7 +6280,6 @@ discard block |
||
| 6282 | 6280 | $isWritable = true; |
| 6283 | 6281 | break; |
| 6284 | 6282 | } |
| 6285 | - |
|
| 6286 | 6283 | else |
| 6287 | 6284 | @chmod($file, $val); |
| 6288 | 6285 | } |
@@ -7214,7 +7211,6 @@ discard block |
||
| 7214 | 7211 | |
| 7215 | 7212 | $length += array_length($value, $deep_count); |
| 7216 | 7213 | } |
| 7217 | - |
|
| 7218 | 7214 | else |
| 7219 | 7215 | $length += strlen($value); |
| 7220 | 7216 | } |
@@ -1261,7 +1261,6 @@ discard block |
||
| 1261 | 1261 | |
| 1262 | 1262 | continue; |
| 1263 | 1263 | } |
| 1264 | - |
|
| 1265 | 1264 | else |
| 1266 | 1265 | { |
| 1267 | 1266 | $fh = @fopen($path . '/.htaccess', 'w'); |
@@ -1273,7 +1272,6 @@ discard block |
||
| 1273 | 1272 | Deny from all' . $close); |
| 1274 | 1273 | fclose($fh); |
| 1275 | 1274 | } |
| 1276 | - |
|
| 1277 | 1275 | else |
| 1278 | 1276 | $errors[] = 'htaccess_cannot_create_file'; |
| 1279 | 1277 | } |
@@ -1284,7 +1282,6 @@ discard block |
||
| 1284 | 1282 | |
| 1285 | 1283 | continue; |
| 1286 | 1284 | } |
| 1287 | - |
|
| 1288 | 1285 | else |
| 1289 | 1286 | { |
| 1290 | 1287 | $fh = @fopen($path . '/index.php', 'w'); |
@@ -1311,7 +1308,6 @@ discard block |
||
| 1311 | 1308 | ?' . '>'); |
| 1312 | 1309 | fclose($fh); |
| 1313 | 1310 | } |
| 1314 | - |
|
| 1315 | 1311 | else |
| 1316 | 1312 | $errors[] = 'index-php_cannot_create_file'; |
| 1317 | 1313 | } |