@@ -455,7 +455,7 @@ |
||
455 | 455 | |
456 | 456 | elseif ($context['uninstalling']) |
457 | 457 | echo ' |
458 | - ', $txt['package_uninstall_done'] .' <br> |
|
458 | + ', $txt['package_uninstall_done'] . ' <br> |
|
459 | 459 | ', '<a href="', $context['remove_url'], '" class="button">', $txt['package_keep'], '</a>', '<a href="', $context['remove_url'], '" class="button">', $txt['package_delete2'], '</a>'; |
460 | 460 | |
461 | 461 | elseif ($context['install_finished']) |
@@ -1860,25 +1860,25 @@ |
||
1860 | 1860 | $fields = array(); |
1861 | 1861 | $new_sort = array(); |
1862 | 1862 | |
1863 | - while($row = $smcFunc['db_fetch_assoc']($request)) |
|
1863 | + while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1864 | 1864 | $fields[] = $row['id_field']; |
1865 | 1865 | $smcFunc['db_free_result']($request); |
1866 | 1866 | |
1867 | 1867 | $idx = array_search($context['fid'], $fields); |
1868 | 1868 | |
1869 | - if ($_GET['move'] == 'down' && count($fields) - 1 > $idx ) |
|
1869 | + if ($_GET['move'] == 'down' && count($fields) - 1 > $idx) |
|
1870 | 1870 | { |
1871 | - $new_sort = array_slice($fields ,0 ,$idx ,true); |
|
1871 | + $new_sort = array_slice($fields, 0, $idx, true); |
|
1872 | 1872 | $new_sort[] = $fields[$idx + 1]; |
1873 | 1873 | $new_sort[] = $fields[$idx]; |
1874 | - $new_sort += array_slice($fields ,$idx + 2 ,count($fields) ,true); |
|
1874 | + $new_sort += array_slice($fields, $idx + 2, count($fields), true); |
|
1875 | 1875 | } |
1876 | 1876 | elseif ($context['fid'] > 0 and $idx < count($fields)) |
1877 | 1877 | { |
1878 | - $new_sort = array_slice($fields ,0 ,($idx - 1) ,true); |
|
1878 | + $new_sort = array_slice($fields, 0, ($idx - 1), true); |
|
1879 | 1879 | $new_sort[] = $fields[$idx]; |
1880 | 1880 | $new_sort[] = $fields[$idx - 1]; |
1881 | - $new_sort += array_slice($fields ,($idx + 1) ,count($fields) ,true); |
|
1881 | + $new_sort += array_slice($fields, ($idx + 1), count($fields), true); |
|
1882 | 1882 | } |
1883 | 1883 | else |
1884 | 1884 | redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler |
@@ -2705,8 +2705,7 @@ discard block |
||
2705 | 2705 | $context['css_files_order'] = array(); |
2706 | 2706 | |
2707 | 2707 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
2708 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2709 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2708 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2710 | 2709 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
2711 | 2710 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
2712 | 2711 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2820,8 +2819,7 @@ discard block |
||
2820 | 2819 | global $settings, $context, $modSettings; |
2821 | 2820 | |
2822 | 2821 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
2823 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
2824 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2822 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
2825 | 2823 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
2826 | 2824 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
2827 | 2825 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -320,7 +320,7 @@ |
||
320 | 320 | { |
321 | 321 | // PHPBB 3 check this function exists in PHP 5.5 or higher |
322 | 322 | if (function_exists('password_verify')) |
323 | - $other_passwords[] = password_verify($_POST['passwrd'],$user_settings['password_salt']); |
|
323 | + $other_passwords[] = password_verify($_POST['passwrd'], $user_settings['password_salt']); |
|
324 | 324 | |
325 | 325 | // PHP-Fusion |
326 | 326 | $other_passwords[] = hash_hmac('sha256', $_POST['passwrd'], $user_settings['password_salt']); |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | display_db_error(); |
76 | 76 | |
77 | 77 | // We need to escape ' and \ |
78 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
78 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
79 | 79 | |
80 | 80 | // Since pg_connect doesn't feed error info to pg_last_error, we have to catch issues with a try/catch. |
81 | 81 | set_error_handler(function($errno, $errstr) { |
82 | - throw new ErrorException($errstr, $errno);}); |
|
82 | + throw new ErrorException($errstr, $errno); }); |
|
83 | 83 | try |
84 | 84 | { |
85 | 85 | if (!empty($db_options['persist'])) |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
939 | 939 | $error_array[2] = null; |
940 | 940 | |
941 | - if(empty($db_persist)) |
|
941 | + if (empty($db_persist)) |
|
942 | 942 | { // without pooling |
943 | 943 | if (empty($pg_error_data_prep)) |
944 | 944 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -78,7 +78,8 @@ discard block |
||
78 | 78 | $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
79 | 79 | |
80 | 80 | // Since pg_connect doesn't feed error info to pg_last_error, we have to catch issues with a try/catch. |
81 | - set_error_handler(function($errno, $errstr) { |
|
81 | + set_error_handler(function($errno, $errstr) |
|
82 | + { |
|
82 | 83 | throw new ErrorException($errstr, $errno);}); |
83 | 84 | try |
84 | 85 | { |
@@ -939,7 +940,8 @@ discard block |
||
939 | 940 | $error_array[2] = null; |
940 | 941 | |
941 | 942 | if(empty($db_persist)) |
942 | - { // without pooling |
|
943 | + { |
|
944 | +// without pooling |
|
943 | 945 | if (empty($pg_error_data_prep)) |
944 | 946 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
945 | 947 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -950,7 +952,8 @@ discard block |
||
950 | 952 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
951 | 953 | } |
952 | 954 | else |
953 | - { //with pooling |
|
955 | + { |
|
956 | +//with pooling |
|
954 | 957 | $pg_error_data_prep = pg_prepare($db_connection, '', |
955 | 958 | 'INSERT INTO ' . $db_prefix . 'log_errors |
956 | 959 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |
@@ -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'; |
@@ -1039,11 +1039,11 @@ discard block |
||
1039 | 1039 | // Anything that isn't a specification, punctuation mark, or whitespace. |
1040 | 1040 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
1041 | 1041 | // A series of punctuation marks (except %), possibly separated by whitespace. |
1042 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1042 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
1043 | 1043 | // Unwanted trailing punctuation and whitespace. |
1044 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1044 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
1045 | 1045 | // Unwanted opening punctuation and whitespace. |
1046 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1046 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
1047 | 1047 | ), |
1048 | 1048 | array( |
1049 | 1049 | '', |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | $dt_user = new DateTime('@' . $timestamp); |
1156 | 1156 | $temp_offset = $dtz_user->getOffset($dt_user); |
1157 | 1157 | if ($temp_offset !== false) |
1158 | - $user_offset = $temp_offset/3600; |
|
1158 | + $user_offset = $temp_offset / 3600; |
|
1159 | 1159 | } |
1160 | 1160 | } |
1161 | 1161 | } |
@@ -1486,7 +1486,7 @@ discard block |
||
1486 | 1486 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
1487 | 1487 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
1488 | 1488 | |
1489 | - $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>' : ''); |
|
1489 | + $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>' : ''); |
|
1490 | 1490 | } |
1491 | 1491 | // Audio. |
1492 | 1492 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1494,7 +1494,7 @@ discard block |
||
1494 | 1494 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
1495 | 1495 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
1496 | 1496 | |
1497 | - $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>'; |
|
1497 | + $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>'; |
|
1498 | 1498 | } |
1499 | 1499 | // Anything else. |
1500 | 1500 | else |
@@ -1663,7 +1663,7 @@ discard block |
||
1663 | 1663 | 'type' => 'unparsed_commas_content', |
1664 | 1664 | 'test' => '\d+,\d+\]', |
1665 | 1665 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
1666 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1666 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1667 | 1667 | { |
1668 | 1668 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
1669 | 1669 | if (empty($scheme)) |
@@ -2201,12 +2201,12 @@ discard block |
||
2201 | 2201 | $codes[] = array( |
2202 | 2202 | 'tag' => 'cowsay', |
2203 | 2203 | 'parameters' => array( |
2204 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
2204 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
2205 | 2205 | { |
2206 | 2206 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2207 | 2207 | }, |
2208 | 2208 | ), |
2209 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
2209 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
2210 | 2210 | { |
2211 | 2211 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2212 | 2212 | }, |
@@ -3578,7 +3578,7 @@ discard block |
||
3578 | 3578 | if ($fp != false) |
3579 | 3579 | { |
3580 | 3580 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
3581 | - 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"); |
|
3581 | + 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"); |
|
3582 | 3582 | |
3583 | 3583 | // Read in the HTTP/1.1 or whatever. |
3584 | 3584 | $test = substr(fgets($fp, 11), -1); |
@@ -4182,7 +4182,7 @@ discard block |
||
4182 | 4182 | $toMinify = array(); |
4183 | 4183 | $normal = array(); |
4184 | 4184 | |
4185 | - uasort($context['css_files'], function ($a, $b) |
|
4185 | + uasort($context['css_files'], function($a, $b) |
|
4186 | 4186 | { |
4187 | 4187 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
4188 | 4188 | }); |
@@ -5478,7 +5478,7 @@ discard block |
||
5478 | 5478 | { |
5479 | 5479 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
5480 | 5480 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5481 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5481 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5482 | 5482 | if ($keep_alive) |
5483 | 5483 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
5484 | 5484 | else |
@@ -5488,7 +5488,7 @@ discard block |
||
5488 | 5488 | { |
5489 | 5489 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
5490 | 5490 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
5491 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
5491 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
5492 | 5492 | if ($keep_alive) |
5493 | 5493 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
5494 | 5494 | else |
@@ -5736,13 +5736,13 @@ discard block |
||
5736 | 5736 | |
5737 | 5737 | // UTF-8 occurences of MS special characters |
5738 | 5738 | $findchars_utf8 = array( |
5739 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
5740 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
5741 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
5742 | - "\xe2\x80\x98", // left single curly quote |
|
5743 | - "\xe2\x80\x99", // right single curly quote |
|
5744 | - "\xe2\x80\x9c", // left double curly quote |
|
5745 | - "\xe2\x80\x9d", // right double curly quote |
|
5739 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
5740 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
5741 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
5742 | + "\xe2\x80\x98", // left single curly quote |
|
5743 | + "\xe2\x80\x99", // right single curly quote |
|
5744 | + "\xe2\x80\x9c", // left double curly quote |
|
5745 | + "\xe2\x80\x9d", // right double curly quote |
|
5746 | 5746 | ); |
5747 | 5747 | |
5748 | 5748 | // windows 1252 / iso equivalents |
@@ -5758,13 +5758,13 @@ discard block |
||
5758 | 5758 | |
5759 | 5759 | // safe replacements |
5760 | 5760 | $replacechars = array( |
5761 | - ',', // ‚ |
|
5762 | - ',,', // „ |
|
5763 | - '...', // … |
|
5764 | - "'", // ‘ |
|
5765 | - "'", // ’ |
|
5766 | - '"', // “ |
|
5767 | - '"', // ” |
|
5761 | + ',', // ‚ |
|
5762 | + ',,', // „ |
|
5763 | + '...', // … |
|
5764 | + "'", // ‘ |
|
5765 | + "'", // ’ |
|
5766 | + '"', // “ |
|
5767 | + '"', // ” |
|
5768 | 5768 | ); |
5769 | 5769 | |
5770 | 5770 | if ($context['utf8']) |
@@ -6949,7 +6949,7 @@ discard block |
||
6949 | 6949 | EXISTS ( |
6950 | 6950 | SELECT bpv.id_board |
6951 | 6951 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
6952 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
6952 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
6953 | 6953 | AND bpv.deny = 0 |
6954 | 6954 | AND bpv.id_board = b.id_board |
6955 | 6955 | )'; |
@@ -6959,7 +6959,7 @@ discard block |
||
6959 | 6959 | AND NOT EXISTS ( |
6960 | 6960 | SELECT bpv.id_board |
6961 | 6961 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
6962 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
6962 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
6963 | 6963 | AND bpv.deny = 1 |
6964 | 6964 | AND bpv.id_board = b.id_board |
6965 | 6965 | )'; |
@@ -7230,8 +7230,8 @@ discard block |
||
7230 | 7230 | $i = 0; |
7231 | 7231 | while (empty($done)) |
7232 | 7232 | { |
7233 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
7234 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
7233 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
7234 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
7235 | 7235 | else |
7236 | 7236 | $done = true; |
7237 | 7237 | } |
@@ -7241,8 +7241,8 @@ discard block |
||
7241 | 7241 | $i = 0; |
7242 | 7242 | while (empty($done)) |
7243 | 7243 | { |
7244 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
7245 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
7244 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
7245 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
7246 | 7246 | else |
7247 | 7247 | $done = true; |
7248 | 7248 | } |