@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | require_once($sourcedir . '/Load.php'); |
| 76 | 76 | |
| 77 | 77 | // If $maintenance is set specifically to 2, then we're upgrading or something. |
| 78 | -if (!empty($maintenance) && 2 === $maintenance) |
|
| 78 | +if (!empty($maintenance) && 2 === $maintenance) |
|
| 79 | 79 | display_maintenance_message(); |
| 80 | 80 | |
| 81 | 81 | // Create a variable to store some SMF specific functions in. |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @param string $class The fully-qualified class name. |
| 127 | 127 | */ |
| 128 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
| 128 | +spl_autoload_register(function($class) use ($sourcedir) |
|
| 129 | 129 | { |
| 130 | 130 | $classMap = array( |
| 131 | 131 | 'ReCaptcha\\' => 'ReCaptcha/', |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | '{db_prefix}log_notify', |
| 283 | 283 | array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'), |
| 284 | 284 | array($user_info['id'], $log['id_topic'], 0), |
| 285 | - array('id_member','id_topic', 'id_board') |
|
| 285 | + array('id_member', 'id_topic', 'id_board') |
|
| 286 | 286 | ); |
| 287 | 287 | } |
| 288 | 288 | else |
@@ -869,7 +869,6 @@ |
||
| 869 | 869 | $can_approve_boards = boardsAllowedTo('approve_posts'); |
| 870 | 870 | $onlyApproved = $can_approve_boards !== array(0) && !in_array($_REQUEST['targetboard'], $can_approve_boards); |
| 871 | 871 | } |
| 872 | - |
|
| 873 | 872 | else |
| 874 | 873 | $onlyApproved = false; |
| 875 | 874 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | { |
| 378 | 378 | $val = 'CASE '; |
| 379 | 379 | foreach ($members as $k => $v) |
| 380 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
| 380 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
| 381 | 381 | |
| 382 | 382 | $val = $val . ' END'; |
| 383 | 383 | $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 | '', |
@@ -1452,7 +1452,7 @@ discard block |
||
| 1452 | 1452 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
| 1453 | 1453 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
| 1454 | 1454 | |
| 1455 | - $returnContext .= '<div class="videocontainer"><div><video controls preload="none" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . ' style="object-fit:contain;"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1455 | + $returnContext .= '<div class="videocontainer"><div><video controls preload="none" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . ' style="object-fit:contain;"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1456 | 1456 | } |
| 1457 | 1457 | // Audio. |
| 1458 | 1458 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
| 1461 | 1461 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
| 1462 | 1462 | |
| 1463 | - $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>'; |
|
| 1463 | + $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>'; |
|
| 1464 | 1464 | } |
| 1465 | 1465 | // Anything else. |
| 1466 | 1466 | else |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | 'type' => 'unparsed_commas_content', |
| 1624 | 1624 | 'test' => '\d+,\d+\]', |
| 1625 | 1625 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
| 1626 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1626 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1627 | 1627 | { |
| 1628 | 1628 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
| 1629 | 1629 | if (empty($scheme)) |
@@ -2161,7 +2161,7 @@ discard block |
||
| 2161 | 2161 | $codes[] = array( |
| 2162 | 2162 | 'tag' => 'cowsay', |
| 2163 | 2163 | 'parameters' => array( |
| 2164 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
| 2164 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
| 2165 | 2165 | { |
| 2166 | 2166 | static $css_added; |
| 2167 | 2167 | |
@@ -2178,7 +2178,7 @@ discard block |
||
| 2178 | 2178 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
| 2179 | 2179 | }, |
| 2180 | 2180 | ), |
| 2181 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
| 2181 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
| 2182 | 2182 | { |
| 2183 | 2183 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2184 | 2184 | }, |
@@ -3550,7 +3550,7 @@ discard block |
||
| 3550 | 3550 | if ($fp != false) |
| 3551 | 3551 | { |
| 3552 | 3552 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
| 3553 | - 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"); |
|
| 3553 | + 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"); |
|
| 3554 | 3554 | |
| 3555 | 3555 | // Read in the HTTP/1.1 or whatever. |
| 3556 | 3556 | $test = substr(fgets($fp, 11), -1); |
@@ -4154,7 +4154,7 @@ discard block |
||
| 4154 | 4154 | $toMinify = array(); |
| 4155 | 4155 | $normal = array(); |
| 4156 | 4156 | |
| 4157 | - usort($context['css_files'], function ($a, $b) |
|
| 4157 | + usort($context['css_files'], function($a, $b) |
|
| 4158 | 4158 | { |
| 4159 | 4159 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 4160 | 4160 | }); |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | { |
| 5447 | 5447 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
| 5448 | 5448 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5449 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5449 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5450 | 5450 | if ($keep_alive) |
| 5451 | 5451 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
| 5452 | 5452 | else |
@@ -5456,7 +5456,7 @@ discard block |
||
| 5456 | 5456 | { |
| 5457 | 5457 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
| 5458 | 5458 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5459 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5459 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5460 | 5460 | if ($keep_alive) |
| 5461 | 5461 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
| 5462 | 5462 | else |
@@ -5704,13 +5704,13 @@ discard block |
||
| 5704 | 5704 | |
| 5705 | 5705 | // UTF-8 occurences of MS special characters |
| 5706 | 5706 | $findchars_utf8 = array( |
| 5707 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5708 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5709 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5710 | - "\xe2\x80\x98", // left single curly quote |
|
| 5711 | - "\xe2\x80\x99", // right single curly quote |
|
| 5712 | - "\xe2\x80\x9c", // left double curly quote |
|
| 5713 | - "\xe2\x80\x9d", // right double curly quote |
|
| 5707 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5708 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5709 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5710 | + "\xe2\x80\x98", // left single curly quote |
|
| 5711 | + "\xe2\x80\x99", // right single curly quote |
|
| 5712 | + "\xe2\x80\x9c", // left double curly quote |
|
| 5713 | + "\xe2\x80\x9d", // right double curly quote |
|
| 5714 | 5714 | ); |
| 5715 | 5715 | |
| 5716 | 5716 | // windows 1252 / iso equivalents |
@@ -5726,13 +5726,13 @@ discard block |
||
| 5726 | 5726 | |
| 5727 | 5727 | // safe replacements |
| 5728 | 5728 | $replacechars = array( |
| 5729 | - ',', // ‚ |
|
| 5730 | - ',,', // „ |
|
| 5731 | - '...', // … |
|
| 5732 | - "'", // ‘ |
|
| 5733 | - "'", // ’ |
|
| 5734 | - '"', // “ |
|
| 5735 | - '"', // ” |
|
| 5729 | + ',', // ‚ |
|
| 5730 | + ',,', // „ |
|
| 5731 | + '...', // … |
|
| 5732 | + "'", // ‘ |
|
| 5733 | + "'", // ’ |
|
| 5734 | + '"', // “ |
|
| 5735 | + '"', // ” |
|
| 5736 | 5736 | ); |
| 5737 | 5737 | |
| 5738 | 5738 | if ($context['utf8']) |
@@ -6913,7 +6913,7 @@ discard block |
||
| 6913 | 6913 | EXISTS ( |
| 6914 | 6914 | SELECT bpv.id_board |
| 6915 | 6915 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6916 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
| 6916 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
| 6917 | 6917 | AND bpv.deny = 0 |
| 6918 | 6918 | AND bpv.id_board = b.id_board |
| 6919 | 6919 | )'; |
@@ -6923,7 +6923,7 @@ discard block |
||
| 6923 | 6923 | AND NOT EXISTS ( |
| 6924 | 6924 | SELECT bpv.id_board |
| 6925 | 6925 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6926 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
| 6926 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
| 6927 | 6927 | AND bpv.deny = 1 |
| 6928 | 6928 | AND bpv.id_board = b.id_board |
| 6929 | 6929 | )'; |
@@ -7194,8 +7194,8 @@ discard block |
||
| 7194 | 7194 | $i = 0; |
| 7195 | 7195 | while (empty($done)) |
| 7196 | 7196 | { |
| 7197 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
| 7198 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
| 7197 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
| 7198 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
| 7199 | 7199 | else |
| 7200 | 7200 | $done = true; |
| 7201 | 7201 | } |
@@ -7205,8 +7205,8 @@ discard block |
||
| 7205 | 7205 | $i = 0; |
| 7206 | 7206 | while (empty($done)) |
| 7207 | 7207 | { |
| 7208 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
| 7209 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
| 7208 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
| 7209 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
| 7210 | 7210 | else |
| 7211 | 7211 | $done = true; |
| 7212 | 7212 | } |
@@ -279,7 +279,6 @@ discard block |
||
| 279 | 279 | $condition = 'id_member IN ({array_int:members})'; |
| 280 | 280 | $parameters['members'] = $members; |
| 281 | 281 | } |
| 282 | - |
|
| 283 | 282 | elseif ($members === null) |
| 284 | 283 | $condition = '1=1'; |
| 285 | 284 | |
@@ -382,11 +381,9 @@ discard block |
||
| 382 | 381 | $val = $val . ' END'; |
| 383 | 382 | $type = 'raw'; |
| 384 | 383 | } |
| 385 | - |
|
| 386 | 384 | else |
| 387 | 385 | $val = alert_count($members, true); |
| 388 | 386 | } |
| 389 | - |
|
| 390 | 387 | elseif ($type == 'int' && ($val === '+' || $val === '-')) |
| 391 | 388 | { |
| 392 | 389 | $val = $var . ' ' . $val . ' 1'; |
@@ -2162,7 +2159,7 @@ discard block |
||
| 2162 | 2159 | 'tag' => 'cowsay', |
| 2163 | 2160 | 'parameters' => array( |
| 2164 | 2161 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
| 2165 | - { |
|
| 2162 | + { |
|
| 2166 | 2163 | static $css_added; |
| 2167 | 2164 | |
| 2168 | 2165 | if (empty($css_added)) |
@@ -2179,7 +2176,7 @@ discard block |
||
| 2179 | 2176 | }, |
| 2180 | 2177 | ), |
| 2181 | 2178 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
| 2182 | - { |
|
| 2179 | + { |
|
| 2183 | 2180 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2184 | 2181 | }, |
| 2185 | 2182 | ), |
@@ -3277,7 +3274,7 @@ discard block |
||
| 3277 | 3274 | |
| 3278 | 3275 | // Replace away! |
| 3279 | 3276 | $message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements) |
| 3280 | - { |
|
| 3277 | + { |
|
| 3281 | 3278 | return $smileyPregReplacements[$matches[1]]; |
| 3282 | 3279 | }, $message); |
| 3283 | 3280 | } |
@@ -4075,7 +4072,6 @@ discard block |
||
| 4075 | 4072 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
| 4076 | 4073 | $minSeed = $js_file['options']['seed']; |
| 4077 | 4074 | } |
| 4078 | - |
|
| 4079 | 4075 | else |
| 4080 | 4076 | { |
| 4081 | 4077 | echo ' |
@@ -6350,7 +6346,6 @@ discard block |
||
| 6350 | 6346 | $isWritable = true; |
| 6351 | 6347 | break; |
| 6352 | 6348 | } |
| 6353 | - |
|
| 6354 | 6349 | else |
| 6355 | 6350 | @chmod($file, $val); |
| 6356 | 6351 | } |
@@ -7282,7 +7277,6 @@ discard block |
||
| 7282 | 7277 | |
| 7283 | 7278 | $length += array_length($value, $deep_count); |
| 7284 | 7279 | } |
| 7285 | - |
|
| 7286 | 7280 | else |
| 7287 | 7281 | $length += strlen($value); |
| 7288 | 7282 | } |
@@ -1736,7 +1736,7 @@ discard block |
||
| 1736 | 1736 | // Prevents warnings about constants that are already defined. |
| 1737 | 1737 | $settingsText = preg_replace_callback( |
| 1738 | 1738 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
| 1739 | - function ($matches) |
|
| 1739 | + function($matches) |
|
| 1740 | 1740 | { |
| 1741 | 1741 | return 'define(\'' . md5(mt_rand()) . '\''; |
| 1742 | 1742 | }, |
@@ -1746,7 +1746,7 @@ discard block |
||
| 1746 | 1746 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
| 1747 | 1747 | try |
| 1748 | 1748 | { |
| 1749 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
| 1749 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
| 1750 | 1750 | throw new ErrorException('eval error'); |
| 1751 | 1751 | |
| 1752 | 1752 | unset($mtime, $settingsFile, $settingsText); |
@@ -1953,7 +1953,7 @@ discard block |
||
| 1953 | 1953 | } |
| 1954 | 1954 | |
| 1955 | 1955 | // Everything is simpler if we convert heredocs to normal strings first. |
| 1956 | - if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1956 | + if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1957 | 1957 | { |
| 1958 | 1958 | foreach ($matches[0] as $mkey => $heredoc) |
| 1959 | 1959 | { |
@@ -1967,7 +1967,7 @@ discard block |
||
| 1967 | 1967 | } |
| 1968 | 1968 | |
| 1969 | 1969 | // Split before everything that could possibly delimit a comment or a string. |
| 1970 | - $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1970 | + $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1971 | 1971 | |
| 1972 | 1972 | $in_string = 0; |
| 1973 | 1973 | $in_comment = 0; |
@@ -1213,7 +1213,8 @@ discard block |
||
| 1213 | 1213 | } |
| 1214 | 1214 | |
| 1215 | 1215 | // It's important to do the numbered ones before the named ones, or messes happen. |
| 1216 | - uksort($substitutions, function($a, $b) { |
|
| 1216 | + uksort($substitutions, function($a, $b) |
|
| 1217 | + { |
|
| 1217 | 1218 | if (is_int($a) && is_int($b)) |
| 1218 | 1219 | return $a > $b; |
| 1219 | 1220 | elseif (is_int($a)) |
@@ -1752,8 +1753,12 @@ discard block |
||
| 1752 | 1753 | unset($mtime, $settingsFile, $settingsText); |
| 1753 | 1754 | $defined_vars = get_defined_vars(); |
| 1754 | 1755 | } |
| 1755 | - catch (Throwable $e) {} |
|
| 1756 | - catch (ErrorException $e) {} |
|
| 1756 | + catch (Throwable $e) |
|
| 1757 | + { |
|
| 1758 | +} |
|
| 1759 | + catch (ErrorException $e) |
|
| 1760 | + { |
|
| 1761 | +} |
|
| 1757 | 1762 | if (isset($e)) |
| 1758 | 1763 | return false; |
| 1759 | 1764 | |
@@ -1913,7 +1918,8 @@ discard block |
||
| 1913 | 1918 | // For the same reason, replace literal returns and newlines with "\r" and "\n" |
| 1914 | 1919 | elseif (is_string($var) && (strpos($var, "\n") !== false || strpos($var, "\r") !== false)) |
| 1915 | 1920 | { |
| 1916 | - return strtr(preg_replace_callback('/[\r\n]+/', function($m) { |
|
| 1921 | + return strtr(preg_replace_callback('/[\r\n]+/', function($m) |
|
| 1922 | + { |
|
| 1917 | 1923 | return '\' . "' . strtr($m[0], array("\r" => '\r', "\n" => '\n')) . '" . \''; |
| 1918 | 1924 | }, $var), array("'' . " => '', " . ''" => '')); |
| 1919 | 1925 | } |
@@ -67,8 +67,7 @@ |
||
| 67 | 67 | $sound_letter = substr($sound_letter, strpos($sound_letter, 'data') + 8); |
| 68 | 68 | switch ($word[$i] === 's' ? 0 : mt_rand(0, 2)) |
| 69 | 69 | { |
| 70 | - case 0 : |
|
| 71 | - for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
| 70 | + case 0 : for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
| 72 | 71 | for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++) |
| 73 | 72 | $sound_word .= $word[$i] === 's' ? $sound_letter[$j] : chr(mt_rand(max(ord($sound_letter[$j]) - 1, 0x00), min(ord($sound_letter[$j]) + 1, 0xFF))); |
| 74 | 73 | break; |
@@ -816,7 +816,7 @@ |
||
| 816 | 816 | |
| 817 | 817 | $out = 'POST /smf/stats/collect_stats.php HTTP/1.1' . "\r\n"; |
| 818 | 818 | $out .= 'Host: www.simplemachines.org' . "\r\n"; |
| 819 | - $out .= 'user-agent: '. SMF_USER_AGENT . "\r\n"; |
|
| 819 | + $out .= 'user-agent: ' . SMF_USER_AGENT . "\r\n"; |
|
| 820 | 820 | $out .= 'content-type: application/x-www-form-urlencoded' . "\r\n"; |
| 821 | 821 | $out .= 'connection: Close' . "\r\n"; |
| 822 | 822 | $out .= 'content-length: ' . $length . "\r\n\r\n"; |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | log_error(sprintf($txt['smiley_set_dir_not_found'], $set_names[array_search($set, $context['smiley_sets'])])); |
| 501 | 501 | |
| 502 | 502 | $context['smiley_sets'] = array_filter($context['smiley_sets'], function($v) use ($set) |
| 503 | - { |
|
| 503 | + { |
|
| 504 | 504 | return $v != $set; |
| 505 | 505 | }); |
| 506 | 506 | } |
@@ -3496,7 +3496,6 @@ discard block |
||
| 3496 | 3496 | } |
| 3497 | 3497 | } |
| 3498 | 3498 | } |
| 3499 | - |
|
| 3500 | 3499 | elseif (($value == 'upload' && allowedTo('profile_upload_avatar')) || $downloadedExternalAvatar) |
| 3501 | 3500 | { |
| 3502 | 3501 | if ((isset($_FILES['attachment']['name']) && $_FILES['attachment']['name'] != '') || $downloadedExternalAvatar) |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | display_db_error(); |
| 74 | 74 | |
| 75 | 75 | // We need to escape ' and \ |
| 76 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
| 76 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
| 77 | 77 | |
| 78 | 78 | if (!empty($db_options['persist'])) |
| 79 | 79 | $connection = @pg_pconnect((empty($db_server) ? '' : 'host=' . $db_server . ' ') . 'dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
@@ -925,7 +925,7 @@ discard block |
||
| 925 | 925 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
| 926 | 926 | $error_array[2] = null; |
| 927 | 927 | |
| 928 | - if(empty($db_persist)) |
|
| 928 | + if (empty($db_persist)) |
|
| 929 | 929 | { // without pooling |
| 930 | 930 | if (empty($pg_error_data_prep)) |
| 931 | 931 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -926,7 +926,8 @@ discard block |
||
| 926 | 926 | $error_array[2] = null; |
| 927 | 927 | |
| 928 | 928 | if(empty($db_persist)) |
| 929 | - { // without pooling |
|
| 929 | + { |
|
| 930 | +// without pooling |
|
| 930 | 931 | if (empty($pg_error_data_prep)) |
| 931 | 932 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
| 932 | 933 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -937,7 +938,8 @@ discard block |
||
| 937 | 938 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
| 938 | 939 | } |
| 939 | 940 | else |
| 940 | - { //with pooling |
|
| 941 | + { |
|
| 942 | +//with pooling |
|
| 941 | 943 | $pg_error_data_prep = pg_prepare($db_connection, '', |
| 942 | 944 | 'INSERT INTO ' . $db_prefix . 'log_errors |
| 943 | 945 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |