@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | $lastlen = strlen($text = preg_replace($backToBackPattern, '', $text)); |
1113 | 1113 | |
1114 | 1114 | // Need to sort the tags by name length. |
1115 | - uksort($valid_tags, function ($a, $b) { |
|
1115 | + uksort($valid_tags, function($a, $b) { |
|
1116 | 1116 | return strlen($a) < strlen($b) ? 1 : -1; |
1117 | 1117 | }); |
1118 | 1118 | |
@@ -1980,7 +1980,7 @@ discard block |
||
1980 | 1980 | } |
1981 | 1981 | |
1982 | 1982 | // Set proper extensions; do this post caching so cache doesn't become extension-specific |
1983 | - array_walk_recursive($context['smileys'], function (&$filename, $key) |
|
1983 | + array_walk_recursive($context['smileys'], function(&$filename, $key) |
|
1984 | 1984 | { |
1985 | 1985 | global $context, $user_info, $modSettings; |
1986 | 1986 | if ($key == 'filename') |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | { |
392 | 392 | $val = 'CASE '; |
393 | 393 | foreach ($members as $k => $v) |
394 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. count(fetch_alerts($v, false, 0, array(), false)) . ' '; |
|
394 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . count(fetch_alerts($v, false, 0, array(), false)) . ' '; |
|
395 | 395 | $val = $val . ' END'; |
396 | 396 | $type = 'raw'; |
397 | 397 | } |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | static $non_twelve_hour, $locale_cache; |
745 | 745 | static $unsupportedFormats, $finalizedFormats; |
746 | 746 | |
747 | - $unsupportedFormatsWindows = array('z','Z'); |
|
747 | + $unsupportedFormatsWindows = array('z', 'Z'); |
|
748 | 748 | |
749 | 749 | // Ensure required values are set |
750 | 750 | $user_info['time_offset'] = !empty($user_info['time_offset']) ? $user_info['time_offset'] : 0; |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | $unsupportedFormats = (array) cache_get_data('unsupportedtimeformats', 86400); |
830 | 830 | if (empty($unsupportedFormats)) |
831 | 831 | { |
832 | - foreach($strftimeFormatSubstitutions as $format => $substitution) |
|
832 | + foreach ($strftimeFormatSubstitutions as $format => $substitution) |
|
833 | 833 | { |
834 | 834 | // Avoid a crashing bug with PHP 7 on certain versions of Windows |
835 | 835 | if ($context['server']['is_windows'] && in_array($format, $unsupportedFormatsWindows)) |
@@ -1209,7 +1209,7 @@ discard block |
||
1209 | 1209 | 'height' => array('optional' => true, 'match' => '(\d+)'), |
1210 | 1210 | ), |
1211 | 1211 | 'content' => '$1', |
1212 | - 'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
1212 | + 'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
1213 | 1213 | { |
1214 | 1214 | $returnContext = ''; |
1215 | 1215 | |
@@ -1244,7 +1244,7 @@ discard block |
||
1244 | 1244 | } |
1245 | 1245 | |
1246 | 1246 | if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}'])) |
1247 | - $returnContext .= '<a href="'. $currentAttachment['href']. ';image" id="link_'. $currentAttachment['id']. '" onclick="'. $currentAttachment['thumbnail']['javascript']. '"><img src="'. $currentAttachment['thumbnail']['href']. '"' . $alt . $title . ' id="thumb_'. $currentAttachment['id']. '" class="atc_img"></a>'; |
|
1247 | + $returnContext .= '<a href="' . $currentAttachment['href'] . ';image" id="link_' . $currentAttachment['id'] . '" onclick="' . $currentAttachment['thumbnail']['javascript'] . '"><img src="' . $currentAttachment['thumbnail']['href'] . '"' . $alt . $title . ' id="thumb_' . $currentAttachment['id'] . '" class="atc_img"></a>'; |
|
1248 | 1248 | else |
1249 | 1249 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>'; |
1250 | 1250 | } |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | 'type' => 'unparsed_content', |
1297 | 1297 | 'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>', |
1298 | 1298 | // @todo Maybe this can be simplified? |
1299 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
1299 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
1300 | 1300 | { |
1301 | 1301 | if (!isset($disabled['code'])) |
1302 | 1302 | { |
@@ -1333,7 +1333,7 @@ discard block |
||
1333 | 1333 | 'type' => 'unparsed_equals_content', |
1334 | 1334 | 'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> ($2) <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>', |
1335 | 1335 | // @todo Maybe this can be simplified? |
1336 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
1336 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
1337 | 1337 | { |
1338 | 1338 | if (!isset($disabled['code'])) |
1339 | 1339 | { |
@@ -1377,7 +1377,7 @@ discard block |
||
1377 | 1377 | 'type' => 'unparsed_content', |
1378 | 1378 | 'content' => '<a href="mailto:$1" class="bbc_email">$1</a>', |
1379 | 1379 | // @todo Should this respect guest_hideContacts? |
1380 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1380 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1381 | 1381 | { |
1382 | 1382 | $data = strtr($data, array('<br>' => '')); |
1383 | 1383 | }, |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | 'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]', |
1398 | 1398 | 'before' => '<div $1>', |
1399 | 1399 | 'after' => '</div>', |
1400 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1400 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1401 | 1401 | { |
1402 | 1402 | $class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"'; |
1403 | 1403 | |
@@ -1483,7 +1483,7 @@ discard block |
||
1483 | 1483 | 'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'), |
1484 | 1484 | ), |
1485 | 1485 | 'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">', |
1486 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1486 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1487 | 1487 | { |
1488 | 1488 | global $image_proxy_enabled, $user_info; |
1489 | 1489 | |
@@ -1509,7 +1509,7 @@ discard block |
||
1509 | 1509 | 'tag' => 'img', |
1510 | 1510 | 'type' => 'unparsed_content', |
1511 | 1511 | 'content' => '<img src="$1" alt="" class="bbc_img">', |
1512 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1512 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1513 | 1513 | { |
1514 | 1514 | global $image_proxy_enabled, $user_info; |
1515 | 1515 | |
@@ -1535,7 +1535,7 @@ discard block |
||
1535 | 1535 | 'tag' => 'iurl', |
1536 | 1536 | 'type' => 'unparsed_content', |
1537 | 1537 | 'content' => '<a href="$1" class="bbc_link">$1</a>', |
1538 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1538 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1539 | 1539 | { |
1540 | 1540 | $data = strtr($data, array('<br>' => '')); |
1541 | 1541 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1549,7 +1549,7 @@ discard block |
||
1549 | 1549 | 'quoted' => 'optional', |
1550 | 1550 | 'before' => '<a href="$1" class="bbc_link">', |
1551 | 1551 | 'after' => '</a>', |
1552 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1552 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1553 | 1553 | { |
1554 | 1554 | if (substr($data, 0, 1) == '#') |
1555 | 1555 | $data = '#post_' . substr($data, 1); |
@@ -1642,7 +1642,7 @@ discard block |
||
1642 | 1642 | 'tag' => 'php', |
1643 | 1643 | 'type' => 'unparsed_content', |
1644 | 1644 | 'content' => '<span class="phpcode">$1</span>', |
1645 | - 'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled) |
|
1645 | + 'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled) |
|
1646 | 1646 | { |
1647 | 1647 | if (!isset($disabled['php'])) |
1648 | 1648 | { |
@@ -1770,7 +1770,7 @@ discard block |
||
1770 | 1770 | 'test' => '[1-7]\]', |
1771 | 1771 | 'before' => '<span style="font-size: $1;" class="bbc_size">', |
1772 | 1772 | 'after' => '</span>', |
1773 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1773 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1774 | 1774 | { |
1775 | 1775 | $sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95); |
1776 | 1776 | $data = $sizes[$data] . 'em'; |
@@ -1808,7 +1808,7 @@ discard block |
||
1808 | 1808 | 'tag' => 'time', |
1809 | 1809 | 'type' => 'unparsed_content', |
1810 | 1810 | 'content' => '$1', |
1811 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1811 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1812 | 1812 | { |
1813 | 1813 | if (is_numeric($data)) |
1814 | 1814 | $data = timeformat($data); |
@@ -1841,7 +1841,7 @@ discard block |
||
1841 | 1841 | 'tag' => 'url', |
1842 | 1842 | 'type' => 'unparsed_content', |
1843 | 1843 | 'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>', |
1844 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1844 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1845 | 1845 | { |
1846 | 1846 | $data = strtr($data, array('<br>' => '')); |
1847 | 1847 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1855,7 +1855,7 @@ discard block |
||
1855 | 1855 | 'quoted' => 'optional', |
1856 | 1856 | 'before' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">', |
1857 | 1857 | 'after' => '</a>', |
1858 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1858 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1859 | 1859 | { |
1860 | 1860 | $scheme = parse_url($data, PHP_URL_SCHEME); |
1861 | 1861 | if (empty($scheme)) |
@@ -1901,7 +1901,7 @@ discard block |
||
1901 | 1901 | { |
1902 | 1902 | if (isset($temp_bbc)) |
1903 | 1903 | $bbc_codes = $temp_bbc; |
1904 | - usort($codes, function ($a, $b) { |
|
1904 | + usort($codes, function($a, $b) { |
|
1905 | 1905 | return strcmp($a['tag'], $b['tag']); |
1906 | 1906 | }); |
1907 | 1907 | return $codes; |
@@ -2117,7 +2117,7 @@ discard block |
||
2117 | 2117 | # a run of Unicode domain name characters and a dot |
2118 | 2118 | [\p{L}\p{M}\p{N}\-.:@]+\. |
2119 | 2119 | # and then a TLD valid in the DNS or the reserved "local" TLD |
2120 | - (?:'. $modSettings['tld_regex'] .'|local) |
|
2120 | + (?:'. $modSettings['tld_regex'] . '|local) |
|
2121 | 2121 | ) |
2122 | 2122 | # followed by a non-domain character or end of line |
2123 | 2123 | (?=[^\p{L}\p{N}\-.]|$) |
@@ -2185,7 +2185,7 @@ discard block |
||
2185 | 2185 | )? |
2186 | 2186 | '; |
2187 | 2187 | |
2188 | - $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) { |
|
2188 | + $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) { |
|
2189 | 2189 | $url = array_shift($matches); |
2190 | 2190 | |
2191 | 2191 | // If this isn't a clean URL, bail out |
@@ -2210,7 +2210,7 @@ discard block |
||
2210 | 2210 | $fullUrl = $url; |
2211 | 2211 | |
2212 | 2212 | // Make sure that $fullUrl really is valid |
2213 | - if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '' ) . $fullUrl) === false) |
|
2213 | + if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '') . $fullUrl) === false) |
|
2214 | 2214 | return $url; |
2215 | 2215 | |
2216 | 2216 | return '[url="' . str_replace(array('[', ']'), array('[', ']'), $fullUrl) . '"]' . $url . '[/url]'; |
@@ -2274,7 +2274,7 @@ discard block |
||
2274 | 2274 | $look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2)); |
2275 | 2275 | |
2276 | 2276 | // A closing tag that doesn't match any open tags? Skip it. |
2277 | - if (!in_array($look_for, array_map(function($code){return $code['tag'];}, $open_tags))) |
|
2277 | + if (!in_array($look_for, array_map(function($code) {return $code['tag']; }, $open_tags))) |
|
2278 | 2278 | continue; |
2279 | 2279 | |
2280 | 2280 | $to_close = array(); |
@@ -2932,7 +2932,7 @@ discard block |
||
2932 | 2932 | } |
2933 | 2933 | |
2934 | 2934 | // Set proper extensions; do this post caching so cache doesn't become extension-specific |
2935 | - foreach($smileysto AS $ix=>$file) |
|
2935 | + foreach ($smileysto AS $ix=>$file) |
|
2936 | 2936 | // Need to use the default if user selection is disabled |
2937 | 2937 | if (empty($modSettings['smiley_sets_enable'])) |
2938 | 2938 | $smileysto[$ix] = $file . $context['user']['smiley_set_default_ext']; |
@@ -2950,7 +2950,7 @@ discard block |
||
2950 | 2950 | for ($i = 0, $n = count($smileysfrom); $i < $n; $i++) |
2951 | 2951 | { |
2952 | 2952 | $specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES); |
2953 | - $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2953 | + $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2954 | 2954 | |
2955 | 2955 | $smileyPregReplacements[$smileysfrom[$i]] = $smileyCode; |
2956 | 2956 | |
@@ -2975,7 +2975,7 @@ discard block |
||
2975 | 2975 | |
2976 | 2976 | // Replace away! |
2977 | 2977 | $message = preg_replace_callback($smileyPregSearch, |
2978 | - function ($matches) use ($smileyPregReplacements) |
|
2978 | + function($matches) use ($smileyPregReplacements) |
|
2979 | 2979 | { |
2980 | 2980 | return $smileyPregReplacements[$matches[1]]; |
2981 | 2981 | }, $message); |
@@ -3072,13 +3072,13 @@ discard block |
||
3072 | 3072 | { |
3073 | 3073 | if (defined('SID') && SID != '') |
3074 | 3074 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#]+?)(#[^"]*?)?$~', |
3075 | - function ($m) use ($scripturl) |
|
3075 | + function($m) use ($scripturl) |
|
3076 | 3076 | { |
3077 | - return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : ""); |
|
3077 | + return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : ""); |
|
3078 | 3078 | }, $setLocation); |
3079 | 3079 | else |
3080 | 3080 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '~') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~', |
3081 | - function ($m) use ($scripturl) |
|
3081 | + function($m) use ($scripturl) |
|
3082 | 3082 | { |
3083 | 3083 | return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : ""); |
3084 | 3084 | }, $setLocation); |
@@ -3399,7 +3399,7 @@ discard block |
||
3399 | 3399 | |
3400 | 3400 | // Add a generic "Are you sure?" confirmation message. |
3401 | 3401 | addInlineJavaScript(' |
3402 | - var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';'); |
|
3402 | + var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';'); |
|
3403 | 3403 | |
3404 | 3404 | // Now add the capping code for avatars. |
3405 | 3405 | if (!empty($modSettings['avatar_max_width_external']) && !empty($modSettings['avatar_max_height_external']) && !empty($modSettings['avatar_action_too_large']) && $modSettings['avatar_action_too_large'] == 'option_css_resize') |
@@ -3865,7 +3865,7 @@ discard block |
||
3865 | 3865 | if (!empty($normal)) |
3866 | 3866 | foreach ($normal as $nf) |
3867 | 3867 | echo ' |
3868 | - <link rel="stylesheet" href="', $nf ,'">'; |
|
3868 | + <link rel="stylesheet" href="', $nf, '">'; |
|
3869 | 3869 | |
3870 | 3870 | if ($db_show_debug === true) |
3871 | 3871 | { |
@@ -3881,7 +3881,7 @@ discard block |
||
3881 | 3881 | <style>'; |
3882 | 3882 | |
3883 | 3883 | foreach ($context['css_header'] as $css) |
3884 | - echo $css .' |
|
3884 | + echo $css . ' |
|
3885 | 3885 | '; |
3886 | 3886 | |
3887 | 3887 | echo' |
@@ -3925,7 +3925,7 @@ discard block |
||
3925 | 3925 | |
3926 | 3926 | |
3927 | 3927 | // No namespaces, sorry! |
3928 | - $classType = 'MatthiasMullie\\Minify\\'. strtoupper($type); |
|
3928 | + $classType = 'MatthiasMullie\\Minify\\' . strtoupper($type); |
|
3929 | 3929 | |
3930 | 3930 | // Temp path. |
3931 | 3931 | $cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/'; |
@@ -4105,7 +4105,7 @@ discard block |
||
4105 | 4105 | else |
4106 | 4106 | $path = $modSettings['attachmentUploadDir']; |
4107 | 4107 | |
4108 | - return $path . '/' . $attachment_id . '_' . $file_hash .'.dat'; |
|
4108 | + return $path . '/' . $attachment_id . '_' . $file_hash . '.dat'; |
|
4109 | 4109 | } |
4110 | 4110 | |
4111 | 4111 | /** |
@@ -4149,10 +4149,10 @@ discard block |
||
4149 | 4149 | $valid_low = isValidIP($ip_parts[0]); |
4150 | 4150 | $valid_high = isValidIP($ip_parts[1]); |
4151 | 4151 | $count = 0; |
4152 | - $mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.'); |
|
4152 | + $mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.'); |
|
4153 | 4153 | $max = ($mode == ':' ? 'ffff' : '255'); |
4154 | 4154 | $min = 0; |
4155 | - if(!$valid_low) |
|
4155 | + if (!$valid_low) |
|
4156 | 4156 | { |
4157 | 4157 | $ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]); |
4158 | 4158 | $valid_low = isValidIP($ip_parts[0]); |
@@ -4166,7 +4166,7 @@ discard block |
||
4166 | 4166 | } |
4167 | 4167 | |
4168 | 4168 | $count = 0; |
4169 | - if(!$valid_high) |
|
4169 | + if (!$valid_high) |
|
4170 | 4170 | { |
4171 | 4171 | $ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]); |
4172 | 4172 | $valid_high = isValidIP($ip_parts[1]); |
@@ -4179,7 +4179,7 @@ discard block |
||
4179 | 4179 | } |
4180 | 4180 | } |
4181 | 4181 | |
4182 | - if($valid_high && $valid_low) |
|
4182 | + if ($valid_high && $valid_low) |
|
4183 | 4183 | { |
4184 | 4184 | $ip_array['low'] = $ip_parts[0]; |
4185 | 4185 | $ip_array['high'] = $ip_parts[1]; |
@@ -4360,7 +4360,7 @@ discard block |
||
4360 | 4360 | addInlineJavaScript(' |
4361 | 4361 | var user_menus = new smc_PopupMenu(); |
4362 | 4362 | user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup"); |
4363 | - user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true); |
|
4363 | + user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true); |
|
4364 | 4364 | if ($context['allow_pm']) |
4365 | 4365 | addInlineJavaScript(' |
4366 | 4366 | user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true); |
@@ -4655,7 +4655,7 @@ discard block |
||
4655 | 4655 | $context['total_admin_reports'] += $context['unapproved_members']; |
4656 | 4656 | } |
4657 | 4657 | |
4658 | - if($context['total_admin_reports'] > 0 && !empty($context['menu_buttons']['admin'])) |
|
4658 | + if ($context['total_admin_reports'] > 0 && !empty($context['menu_buttons']['admin'])) |
|
4659 | 4659 | { |
4660 | 4660 | $context['menu_buttons']['admin']['amt'] = $context['total_admin_reports']; |
4661 | 4661 | } |
@@ -5002,7 +5002,7 @@ discard block |
||
5002 | 5002 | // No? try a fallback to $sourcedir |
5003 | 5003 | else |
5004 | 5004 | { |
5005 | - $absPath = $sourcedir .'/'. $file; |
|
5005 | + $absPath = $sourcedir . '/' . $file; |
|
5006 | 5006 | |
5007 | 5007 | if (file_exists($absPath)) |
5008 | 5008 | require_once($absPath); |
@@ -5269,15 +5269,15 @@ discard block |
||
5269 | 5269 | |
5270 | 5270 | // UTF-8 occurences of MS special characters |
5271 | 5271 | $findchars_utf8 = array( |
5272 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
5273 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
5274 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
5275 | - "\xe2\x80\x98", // left single curly quote |
|
5276 | - "\xe2\x80\x99", // right single curly quote |
|
5277 | - "\xe2\x80\x9c", // left double curly quote |
|
5278 | - "\xe2\x80\x9d", // right double curly quote |
|
5279 | - "\xe2\x80\x93", // en dash |
|
5280 | - "\xe2\x80\x94", // em dash |
|
5272 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
5273 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
5274 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
5275 | + "\xe2\x80\x98", // left single curly quote |
|
5276 | + "\xe2\x80\x99", // right single curly quote |
|
5277 | + "\xe2\x80\x9c", // left double curly quote |
|
5278 | + "\xe2\x80\x9d", // right double curly quote |
|
5279 | + "\xe2\x80\x93", // en dash |
|
5280 | + "\xe2\x80\x94", // em dash |
|
5281 | 5281 | ); |
5282 | 5282 | |
5283 | 5283 | // windows 1252 / iso equivalents |
@@ -5295,15 +5295,15 @@ discard block |
||
5295 | 5295 | |
5296 | 5296 | // safe replacements |
5297 | 5297 | $replacechars = array( |
5298 | - ',', // ‚ |
|
5299 | - ',,', // „ |
|
5300 | - '...', // … |
|
5301 | - "'", // ‘ |
|
5302 | - "'", // ’ |
|
5303 | - '"', // “ |
|
5304 | - '"', // ” |
|
5305 | - '-', // – |
|
5306 | - '--', // — |
|
5298 | + ',', // ‚ |
|
5299 | + ',,', // „ |
|
5300 | + '...', // … |
|
5301 | + "'", // ‘ |
|
5302 | + "'", // ’ |
|
5303 | + '"', // “ |
|
5304 | + '"', // ” |
|
5305 | + '-', // – |
|
5306 | + '--', // — |
|
5307 | 5307 | ); |
5308 | 5308 | |
5309 | 5309 | if ($context['utf8']) |
@@ -5623,7 +5623,7 @@ discard block |
||
5623 | 5623 | */ |
5624 | 5624 | function inet_dtop($bin) |
5625 | 5625 | { |
5626 | - if(empty($bin)) |
|
5626 | + if (empty($bin)) |
|
5627 | 5627 | return ''; |
5628 | 5628 | |
5629 | 5629 | global $db_type; |
@@ -5654,28 +5654,28 @@ discard block |
||
5654 | 5654 | */ |
5655 | 5655 | function _safe_serialize($value) |
5656 | 5656 | { |
5657 | - if(is_null($value)) |
|
5657 | + if (is_null($value)) |
|
5658 | 5658 | return 'N;'; |
5659 | 5659 | |
5660 | - if(is_bool($value)) |
|
5661 | - return 'b:'. (int) $value .';'; |
|
5660 | + if (is_bool($value)) |
|
5661 | + return 'b:' . (int) $value . ';'; |
|
5662 | 5662 | |
5663 | - if(is_int($value)) |
|
5664 | - return 'i:'. $value .';'; |
|
5663 | + if (is_int($value)) |
|
5664 | + return 'i:' . $value . ';'; |
|
5665 | 5665 | |
5666 | - if(is_float($value)) |
|
5667 | - return 'd:'. str_replace(',', '.', $value) .';'; |
|
5666 | + if (is_float($value)) |
|
5667 | + return 'd:' . str_replace(',', '.', $value) . ';'; |
|
5668 | 5668 | |
5669 | - if(is_string($value)) |
|
5670 | - return 's:'. strlen($value) .':"'. $value .'";'; |
|
5669 | + if (is_string($value)) |
|
5670 | + return 's:' . strlen($value) . ':"' . $value . '";'; |
|
5671 | 5671 | |
5672 | - if(is_array($value)) |
|
5672 | + if (is_array($value)) |
|
5673 | 5673 | { |
5674 | 5674 | $out = ''; |
5675 | - foreach($value as $k => $v) |
|
5675 | + foreach ($value as $k => $v) |
|
5676 | 5676 | $out .= _safe_serialize($k) . _safe_serialize($v); |
5677 | 5677 | |
5678 | - return 'a:'. count($value) .':{'. $out .'}'; |
|
5678 | + return 'a:' . count($value) . ':{' . $out . '}'; |
|
5679 | 5679 | } |
5680 | 5680 | |
5681 | 5681 | // safe_serialize cannot serialize resources or objects. |
@@ -5717,7 +5717,7 @@ discard block |
||
5717 | 5717 | function _safe_unserialize($str) |
5718 | 5718 | { |
5719 | 5719 | // Input is not a string. |
5720 | - if(empty($str) || !is_string($str)) |
|
5720 | + if (empty($str) || !is_string($str)) |
|
5721 | 5721 | return false; |
5722 | 5722 | |
5723 | 5723 | $stack = array(); |
@@ -5731,40 +5731,40 @@ discard block |
||
5731 | 5731 | * 3 - in array, expecting value or another array |
5732 | 5732 | */ |
5733 | 5733 | $state = 0; |
5734 | - while($state != 1) |
|
5734 | + while ($state != 1) |
|
5735 | 5735 | { |
5736 | 5736 | $type = isset($str[0]) ? $str[0] : ''; |
5737 | - if($type == '}') |
|
5737 | + if ($type == '}') |
|
5738 | 5738 | $str = substr($str, 1); |
5739 | 5739 | |
5740 | - else if($type == 'N' && $str[1] == ';') |
|
5740 | + else if ($type == 'N' && $str[1] == ';') |
|
5741 | 5741 | { |
5742 | 5742 | $value = null; |
5743 | 5743 | $str = substr($str, 2); |
5744 | 5744 | } |
5745 | - else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5745 | + else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5746 | 5746 | { |
5747 | 5747 | $value = $matches[1] == '1' ? true : false; |
5748 | 5748 | $str = substr($str, 4); |
5749 | 5749 | } |
5750 | - else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5750 | + else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5751 | 5751 | { |
5752 | - $value = (int)$matches[1]; |
|
5752 | + $value = (int) $matches[1]; |
|
5753 | 5753 | $str = $matches[2]; |
5754 | 5754 | } |
5755 | - else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5755 | + else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5756 | 5756 | { |
5757 | - $value = (float)$matches[1]; |
|
5757 | + $value = (float) $matches[1]; |
|
5758 | 5758 | $str = $matches[3]; |
5759 | 5759 | } |
5760 | - else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";') |
|
5760 | + else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";') |
|
5761 | 5761 | { |
5762 | - $value = substr($matches[2], 0, (int)$matches[1]); |
|
5763 | - $str = substr($matches[2], (int)$matches[1] + 2); |
|
5762 | + $value = substr($matches[2], 0, (int) $matches[1]); |
|
5763 | + $str = substr($matches[2], (int) $matches[1] + 2); |
|
5764 | 5764 | } |
5765 | - else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5765 | + else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5766 | 5766 | { |
5767 | - $expectedLength = (int)$matches[1]; |
|
5767 | + $expectedLength = (int) $matches[1]; |
|
5768 | 5768 | $str = $matches[2]; |
5769 | 5769 | } |
5770 | 5770 | |
@@ -5772,10 +5772,10 @@ discard block |
||
5772 | 5772 | else |
5773 | 5773 | return false; |
5774 | 5774 | |
5775 | - switch($state) |
|
5775 | + switch ($state) |
|
5776 | 5776 | { |
5777 | 5777 | case 3: // In array, expecting value or another array. |
5778 | - if($type == 'a') |
|
5778 | + if ($type == 'a') |
|
5779 | 5779 | { |
5780 | 5780 | $stack[] = &$list; |
5781 | 5781 | $list[$key] = array(); |
@@ -5784,7 +5784,7 @@ discard block |
||
5784 | 5784 | $state = 2; |
5785 | 5785 | break; |
5786 | 5786 | } |
5787 | - if($type != '}') |
|
5787 | + if ($type != '}') |
|
5788 | 5788 | { |
5789 | 5789 | $list[$key] = $value; |
5790 | 5790 | $state = 2; |
@@ -5795,29 +5795,29 @@ discard block |
||
5795 | 5795 | return false; |
5796 | 5796 | |
5797 | 5797 | case 2: // in array, expecting end of array or a key |
5798 | - if($type == '}') |
|
5798 | + if ($type == '}') |
|
5799 | 5799 | { |
5800 | 5800 | // Array size is less than expected. |
5801 | - if(count($list) < end($expected)) |
|
5801 | + if (count($list) < end($expected)) |
|
5802 | 5802 | return false; |
5803 | 5803 | |
5804 | 5804 | unset($list); |
5805 | - $list = &$stack[count($stack)-1]; |
|
5805 | + $list = &$stack[count($stack) - 1]; |
|
5806 | 5806 | array_pop($stack); |
5807 | 5807 | |
5808 | 5808 | // Go to terminal state if we're at the end of the root array. |
5809 | 5809 | array_pop($expected); |
5810 | 5810 | |
5811 | - if(count($expected) == 0) |
|
5811 | + if (count($expected) == 0) |
|
5812 | 5812 | $state = 1; |
5813 | 5813 | |
5814 | 5814 | break; |
5815 | 5815 | } |
5816 | 5816 | |
5817 | - if($type == 'i' || $type == 's') |
|
5817 | + if ($type == 'i' || $type == 's') |
|
5818 | 5818 | { |
5819 | 5819 | // Array size exceeds expected length. |
5820 | - if(count($list) >= end($expected)) |
|
5820 | + if (count($list) >= end($expected)) |
|
5821 | 5821 | return false; |
5822 | 5822 | |
5823 | 5823 | $key = $value; |
@@ -5830,7 +5830,7 @@ discard block |
||
5830 | 5830 | |
5831 | 5831 | // Expecting array or value. |
5832 | 5832 | case 0: |
5833 | - if($type == 'a') |
|
5833 | + if ($type == 'a') |
|
5834 | 5834 | { |
5835 | 5835 | $data = array(); |
5836 | 5836 | $list = &$data; |
@@ -5839,7 +5839,7 @@ discard block |
||
5839 | 5839 | break; |
5840 | 5840 | } |
5841 | 5841 | |
5842 | - if($type != '}') |
|
5842 | + if ($type != '}') |
|
5843 | 5843 | { |
5844 | 5844 | $data = $value; |
5845 | 5845 | $state = 1; |
@@ -5852,7 +5852,7 @@ discard block |
||
5852 | 5852 | } |
5853 | 5853 | |
5854 | 5854 | // Trailing data in input. |
5855 | - if(!empty($str)) |
|
5855 | + if (!empty($str)) |
|
5856 | 5856 | return false; |
5857 | 5857 | |
5858 | 5858 | return $data; |
@@ -5906,7 +5906,7 @@ discard block |
||
5906 | 5906 | // Set different modes. |
5907 | 5907 | $chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
5908 | 5908 | |
5909 | - foreach($chmodValues as $val) |
|
5909 | + foreach ($chmodValues as $val) |
|
5910 | 5910 | { |
5911 | 5911 | // If it's writable, break out of the loop. |
5912 | 5912 | if (is_writable($file)) |
@@ -5941,13 +5941,13 @@ discard block |
||
5941 | 5941 | $returnArray = @json_decode($json, $returnAsArray); |
5942 | 5942 | |
5943 | 5943 | // PHP 5.3 so no json_last_error_msg() |
5944 | - switch(json_last_error()) |
|
5944 | + switch (json_last_error()) |
|
5945 | 5945 | { |
5946 | 5946 | case JSON_ERROR_NONE: |
5947 | 5947 | $jsonError = false; |
5948 | 5948 | break; |
5949 | 5949 | case JSON_ERROR_DEPTH: |
5950 | - $jsonError = 'JSON_ERROR_DEPTH'; |
|
5950 | + $jsonError = 'JSON_ERROR_DEPTH'; |
|
5951 | 5951 | break; |
5952 | 5952 | case JSON_ERROR_STATE_MISMATCH: |
5953 | 5953 | $jsonError = 'JSON_ERROR_STATE_MISMATCH'; |
@@ -5975,10 +5975,10 @@ discard block |
||
5975 | 5975 | loadLanguage('Errors'); |
5976 | 5976 | |
5977 | 5977 | if (!empty($jsonDebug)) |
5978 | - log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5978 | + log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5979 | 5979 | |
5980 | 5980 | else |
5981 | - log_error($txt['json_'. $jsonError], 'critical'); |
|
5981 | + log_error($txt['json_' . $jsonError], 'critical'); |
|
5982 | 5982 | |
5983 | 5983 | // Everyone expects an array. |
5984 | 5984 | return array(); |
@@ -6095,7 +6095,7 @@ discard block |
||
6095 | 6095 | // Convert Punycode to Unicode |
6096 | 6096 | require_once($sourcedir . '/Class-Punycode.php'); |
6097 | 6097 | $Punycode = new Punycode(); |
6098 | - $tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds); |
|
6098 | + $tlds = array_map(function($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds); |
|
6099 | 6099 | } |
6100 | 6100 | // Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update |
6101 | 6101 | else |
@@ -6189,7 +6189,7 @@ discard block |
||
6189 | 6189 | } |
6190 | 6190 | |
6191 | 6191 | // This recursive function creates the index array from the strings |
6192 | - $add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
6192 | + $add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
6193 | 6193 | { |
6194 | 6194 | static $depth = 0; |
6195 | 6195 | $depth++; |
@@ -6216,7 +6216,7 @@ discard block |
||
6216 | 6216 | }; |
6217 | 6217 | |
6218 | 6218 | // This recursive function turns the index array into a regular expression |
6219 | - $index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex) |
|
6219 | + $index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex) |
|
6220 | 6220 | { |
6221 | 6221 | static $depth = 0; |
6222 | 6222 | $depth++; |
@@ -6240,11 +6240,11 @@ discard block |
||
6240 | 6240 | |
6241 | 6241 | if (count(array_keys($value)) == 1) |
6242 | 6242 | { |
6243 | - $new_key_array = explode('(?'.'>', $sub_regex); |
|
6243 | + $new_key_array = explode('(?' . '>', $sub_regex); |
|
6244 | 6244 | $new_key .= $new_key_array[0]; |
6245 | 6245 | } |
6246 | 6246 | else |
6247 | - $sub_regex = '(?'.'>' . $sub_regex . ')'; |
|
6247 | + $sub_regex = '(?' . '>' . $sub_regex . ')'; |
|
6248 | 6248 | } |
6249 | 6249 | |
6250 | 6250 | if ($depth > 1) |
@@ -6287,10 +6287,10 @@ discard block |
||
6287 | 6287 | { |
6288 | 6288 | $regex = array(); |
6289 | 6289 | while (!empty($index)) |
6290 | - $regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
6290 | + $regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
6291 | 6291 | } |
6292 | 6292 | else |
6293 | - $regex = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
6293 | + $regex = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
6294 | 6294 | |
6295 | 6295 | // Restore PHP's internal character encoding to whatever it was originally |
6296 | 6296 | if (!empty($current_encoding)) |
@@ -6451,8 +6451,8 @@ discard block |
||
6451 | 6451 | $query_part['query_see_board'] = '1=1'; |
6452 | 6452 | // Otherwise just the groups in $user_info['groups']. |
6453 | 6453 | else |
6454 | - $query_part['query_see_board'] = 'EXISTS (SELECT DISTINCT bpv.id_board FROM ' . $db_prefix . 'board_permissions_view bpv WHERE (bpv.id_group IN ( '. implode(',', $groups) .') AND bpv.deny = 0) ' |
|
6455 | - . ( !empty($deny_boards_access) ? ' AND (bpv.id_group NOT IN ( '. implode(',', $groups) .') and bpv.deny = 1)' : '') |
|
6454 | + $query_part['query_see_board'] = 'EXISTS (SELECT DISTINCT bpv.id_board FROM ' . $db_prefix . 'board_permissions_view bpv WHERE (bpv.id_group IN ( ' . implode(',', $groups) . ') AND bpv.deny = 0) ' |
|
6455 | + . (!empty($deny_boards_access) ? ' AND (bpv.id_group NOT IN ( ' . implode(',', $groups) . ') and bpv.deny = 1)' : '') |
|
6456 | 6456 | . ' AND bpv.id_board = b.id_board)'; |
6457 | 6457 | |
6458 | 6458 | // Build the list of boards they WANT to see. |
@@ -6516,7 +6516,7 @@ discard block |
||
6516 | 6516 | function sanitize_iri($iri) |
6517 | 6517 | { |
6518 | 6518 | // Encode any non-ASCII characters (but not space or control characters of any sort) |
6519 | - $iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) { |
|
6519 | + $iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function($matches) { |
|
6520 | 6520 | return rawurlencode($matches[0]); |
6521 | 6521 | }, $iri); |
6522 | 6522 | |
@@ -6558,7 +6558,7 @@ discard block |
||
6558 | 6558 | $unescaped = array( |
6559 | 6559 | '%21'=>'!', '%23'=>'#', '%24'=>'$', '%26'=>'&', |
6560 | 6560 | '%27'=>"'", '%28'=>'(', '%29'=>')', '%2A'=>'*', |
6561 | - '%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':', |
|
6561 | + '%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':', |
|
6562 | 6562 | '%3B'=>';', '%3D'=>'=', '%3F'=>'?', '%40'=>'@', |
6563 | 6563 | ); |
6564 | 6564 | $iri = strtr(rawurlencode($iri), $unescaped); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | // INET. |
356 | 356 | elseif ($param_info['type'] == 'inet') |
357 | 357 | { |
358 | - if(count($search_params[$param_name]) === 1) |
|
358 | + if (count($search_params[$param_name]) === 1) |
|
359 | 359 | { |
360 | 360 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' = {inet:' . $param_name . '})'; |
361 | 361 | $where_params[$param_name] = $search_params[$param_name][0]; |
@@ -363,8 +363,8 @@ discard block |
||
363 | 363 | elseif (count($search_params[$param_name]) === 2) |
364 | 364 | { |
365 | 365 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' <= {inet:' . $param_name . '_high} and ' . $param_info['db_fields'][0] . ' >= {inet:' . $param_name . '_low})'; |
366 | - $where_params[$param_name.'_low'] = $search_params[$param_name]['low']; |
|
367 | - $where_params[$param_name.'_high'] = $search_params[$param_name]['high']; |
|
366 | + $where_params[$param_name . '_low'] = $search_params[$param_name]['low']; |
|
367 | + $where_params[$param_name . '_high'] = $search_params[$param_name]['high']; |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | } |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | if (!empty($context['show_filter']) && !empty($context['available_filters'])) |
1013 | 1013 | $listOptions['additional_rows'][] = array( |
1014 | 1014 | 'position' => 'above_column_headers', |
1015 | - 'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_'.$context['current_filter']])) ? $txt['admin_browse_filter_type_'.$context['current_filter']] : $context['available_filters'][0]['desc']), |
|
1015 | + 'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_' . $context['current_filter']])) ? $txt['admin_browse_filter_type_' . $context['current_filter']] : $context['available_filters'][0]['desc']), |
|
1016 | 1016 | 'class' => 'filter_row generic_list_wrapper smalltext', |
1017 | 1017 | ); |
1018 | 1018 |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $smcFunc['db_free_result']($result_boards); |
136 | 136 | |
137 | 137 | // Run through the categories and boards (or only boards).... |
138 | - for (reset($row_boards); key($row_boards)!==null; next($row_boards)) |
|
138 | + for (reset($row_boards); key($row_boards) !== null; next($row_boards)) |
|
139 | 139 | { |
140 | 140 | $row_board = current($row_boards); |
141 | 141 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $row_boards[$row_board['id_parent']]['id_msg'] = $row_board['id_msg']; |
304 | 304 | $row_boards[$row_board['id_parent']]['subject'] = $row_board['subject']; |
305 | 305 | $row_boards[$row_board['id_parent']]['poster_time'] = $row_board['poster_time']; |
306 | - $row_boards[$row_board['id_parent']]['short_subject'] = (!empty($row_board['short_subject']) ? $row_board['short_subject'] : '') ; |
|
306 | + $row_boards[$row_board['id_parent']]['short_subject'] = (!empty($row_board['short_subject']) ? $row_board['short_subject'] : ''); |
|
307 | 307 | $row_boards[$row_board['id_parent']]['poster_name'] = $row_board['poster_name']; |
308 | 308 | $row_boards[$row_board['id_parent']]['real_name'] = $row_board['real_name']; |
309 | 309 | $row_boards[$row_board['id_parent']]['id_member'] = $row_board['id_member']; |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | // Set the last post in the root board |
370 | 370 | if (!$isChild && !empty($row_board['poster_time']) |
371 | - && ( empty($this_category[$row_board['id_board']]['last_post']['timestamp']) |
|
371 | + && (empty($this_category[$row_board['id_board']]['last_post']['timestamp']) |
|
372 | 372 | || $this_category[$row_board['id_board']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time']) |
373 | 373 | ) |
374 | 374 | ) |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | if ($boardIndexOptions['include_categories']) |
399 | 399 | foreach ($categories as &$category) |
400 | 400 | { |
401 | - foreach ($category['boards'] as &$board ) |
|
401 | + foreach ($category['boards'] as &$board) |
|
402 | 402 | { |
403 | 403 | if (!empty($moderators[$board['id']])) |
404 | 404 | { |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | } |
422 | 422 | else |
423 | - foreach ($this_category as &$board ) |
|
423 | + foreach ($this_category as &$board) |
|
424 | 424 | { |
425 | 425 | if (!empty($moderators[$board['id']])) |
426 | 426 | { |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']); |
442 | 442 | } |
443 | 443 | |
444 | - unset($category,$board); |
|
444 | + unset($category, $board); |
|
445 | 445 | |
446 | 446 | if ($boardIndexOptions['include_categories']) |
447 | 447 | sortCategories($categories); |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | $regOptions['username'] = trim(preg_replace('~[\t\n\r \x0B\0' . ($context['utf8'] ? '\x{A0}\x{AD}\x{2000}-\x{200F}\x{201F}\x{202F}\x{3000}\x{FEFF}' : '\x00-\x08\x0B\x0C\x0E-\x19\xA0') . ']+~' . ($context['utf8'] ? 'u' : ''), ' ', $regOptions['username'])); |
468 | 468 | |
469 | 469 | // 4-byte Unicode characters are not permitted within user names where db_mb4 is false |
470 | - $regOptions['username'] = !$smcFunc['db_mb4'] && max(array_map('ord', str_split($regOptions['username']))) >= 240 ? preg_replace_callback('/[\x{10000}-\x{10FFFF}]/u', function($name) use($smcFunc){return $smcFunc['htmlspecialchars']($name[0]);}, $regOptions['username']) : $regOptions['username']; |
|
470 | + $regOptions['username'] = !$smcFunc['db_mb4'] && max(array_map('ord', str_split($regOptions['username']))) >= 240 ? preg_replace_callback('/[\x{10000}-\x{10FFFF}]/u', function($name) use($smcFunc){return $smcFunc['htmlspecialchars']($name[0]); }, $regOptions['username']) : $regOptions['username']; |
|
471 | 471 | |
472 | 472 | // @todo Separate the sprintf? |
473 | 473 | if (empty($regOptions['email']) || !filter_var($regOptions['email'], FILTER_VALIDATE_EMAIL) || strlen($regOptions['email']) > 255) |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | 'member_name' => $regOptions['username'], |
590 | 590 | 'email_address' => $regOptions['email'], |
591 | 591 | 'passwd' => hash_password($regOptions['username'], $regOptions['password']), |
592 | - 'password_salt' => substr(md5(mt_rand()), 0, 4) , |
|
592 | + 'password_salt' => substr(md5(mt_rand()), 0, 4), |
|
593 | 593 | 'posts' => 0, |
594 | 594 | 'date_registered' => time(), |
595 | 595 | 'member_ip' => $regOptions['interface'] == 'admin' ? '127.0.0.1' : $user_info['ip'], |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | 'time_offset', |
680 | 680 | ); |
681 | 681 | $knownInets = array( |
682 | - 'member_ip','member_ip2', |
|
682 | + 'member_ip', 'member_ip2', |
|
683 | 683 | ); |
684 | 684 | |
685 | 685 | // Call an optional function to validate the users' input. |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | $checkName = strtr($name, array('_' => '\\_', '%' => '\\%')); |
908 | 908 | |
909 | 909 | //when we got no wildcard we can use equal -> fast |
910 | - $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '=' ); |
|
910 | + $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '='); |
|
911 | 911 | |
912 | 912 | // Make sure they don't want someone else's name. |
913 | 913 | $request = $smcFunc['db_query']('', ' |
@@ -1276,7 +1276,7 @@ discard block |
||
1276 | 1276 | $user_info['buddies'][] = $userReceiver; |
1277 | 1277 | |
1278 | 1278 | // And add a nice alert. Don't abuse though! |
1279 | - if ((cache_get_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, 86400)) == null) |
|
1279 | + if ((cache_get_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, 86400)) == null) |
|
1280 | 1280 | { |
1281 | 1281 | $smcFunc['db_insert']('insert', |
1282 | 1282 | '{db_prefix}background_tasks', |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | ); |
1292 | 1292 | |
1293 | 1293 | // Store this in a cache entry to avoid creating multiple alerts. Give it a long life cycle. |
1294 | - cache_put_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, '1', 86400); |
|
1294 | + cache_put_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, '1', 86400); |
|
1295 | 1295 | } |
1296 | 1296 | } |
1297 | 1297 |