@@ -1256,7 +1256,7 @@ discard block |
||
| 1256 | 1256 | ); |
| 1257 | 1257 | if (empty($value)) |
| 1258 | 1258 | { |
| 1259 | - $deletes = array('id_theme' => 1 , 'variable' => $row['col_name'], 'id_member' => $memID); |
|
| 1259 | + $deletes = array('id_theme' => 1, 'variable' => $row['col_name'], 'id_member' => $memID); |
|
| 1260 | 1260 | unset($user_profile[$memID]['options'][$row['col_name']]); |
| 1261 | 1261 | } |
| 1262 | 1262 | else |
@@ -1284,7 +1284,7 @@ discard block |
||
| 1284 | 1284 | array('id_theme', 'variable', 'id_member') |
| 1285 | 1285 | ); |
| 1286 | 1286 | if (!empty($deletes)) |
| 1287 | - $smcFunc['db_query']('',' |
|
| 1287 | + $smcFunc['db_query']('', ' |
|
| 1288 | 1288 | DELETE FROM {db_prefix}themes |
| 1289 | 1289 | WHERE id_theme = {int:id_theme} AND |
| 1290 | 1290 | variable = {string:variable} AND |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | { |
| 387 | 387 | $val = 'CASE '; |
| 388 | 388 | foreach ($members as $k => $v) |
| 389 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. count(fetch_alerts($v, false, 0, array(), false)) . ' '; |
|
| 389 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . count(fetch_alerts($v, false, 0, array(), false)) . ' '; |
|
| 390 | 390 | $val = $val . ' END'; |
| 391 | 391 | $type = 'raw'; |
| 392 | 392 | } |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | $unsupportedFormats = (array) cache_get_data('unsupportedtimeformats', 86400); |
| 818 | 818 | if (empty($unsupportedFormats)) |
| 819 | 819 | { |
| 820 | - foreach($strftimeFormatSubstitutions as $format => $substitution) |
|
| 820 | + foreach ($strftimeFormatSubstitutions as $format => $substitution) |
|
| 821 | 821 | { |
| 822 | 822 | $value = @strftime('%' . $format); |
| 823 | 823 | |
@@ -1182,7 +1182,7 @@ discard block |
||
| 1182 | 1182 | 'height' => array('optional' => true, 'match' => '(\d+)'), |
| 1183 | 1183 | ), |
| 1184 | 1184 | 'content' => '$1', |
| 1185 | - 'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
| 1185 | + 'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
| 1186 | 1186 | { |
| 1187 | 1187 | $returnContext = ''; |
| 1188 | 1188 | |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}'])) |
| 1220 | - $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>'; |
|
| 1220 | + $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>'; |
|
| 1221 | 1221 | else |
| 1222 | 1222 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>'; |
| 1223 | 1223 | } |
@@ -1246,7 +1246,7 @@ discard block |
||
| 1246 | 1246 | 'type' => 'unparsed_content', |
| 1247 | 1247 | '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>', |
| 1248 | 1248 | // @todo Maybe this can be simplified? |
| 1249 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
| 1249 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
| 1250 | 1250 | { |
| 1251 | 1251 | if (!isset($disabled['code'])) |
| 1252 | 1252 | { |
@@ -1283,7 +1283,7 @@ discard block |
||
| 1283 | 1283 | 'type' => 'unparsed_equals_content', |
| 1284 | 1284 | '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>', |
| 1285 | 1285 | // @todo Maybe this can be simplified? |
| 1286 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
| 1286 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
| 1287 | 1287 | { |
| 1288 | 1288 | if (!isset($disabled['code'])) |
| 1289 | 1289 | { |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | 'type' => 'unparsed_content', |
| 1328 | 1328 | 'content' => '<a href="mailto:$1" class="bbc_email">$1</a>', |
| 1329 | 1329 | // @todo Should this respect guest_hideContacts? |
| 1330 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1330 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1331 | 1331 | { |
| 1332 | 1332 | $data = strtr($data, array('<br>' => '')); |
| 1333 | 1333 | }, |
@@ -1346,7 +1346,7 @@ discard block |
||
| 1346 | 1346 | 'type' => 'unparsed_commas_content', |
| 1347 | 1347 | 'test' => '\d+,\d+\]', |
| 1348 | 1348 | 'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">', |
| 1349 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1349 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1350 | 1350 | { |
| 1351 | 1351 | if (isset($disabled['url'])) |
| 1352 | 1352 | $tag['content'] = '$1'; |
@@ -1362,7 +1362,7 @@ discard block |
||
| 1362 | 1362 | 'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]', |
| 1363 | 1363 | 'before' => '<div $1>', |
| 1364 | 1364 | 'after' => '</div>', |
| 1365 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1365 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1366 | 1366 | { |
| 1367 | 1367 | $class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"'; |
| 1368 | 1368 | |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | 'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'), |
| 1412 | 1412 | ), |
| 1413 | 1413 | 'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">', |
| 1414 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1414 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1415 | 1415 | { |
| 1416 | 1416 | global $image_proxy_enabled, $user_info; |
| 1417 | 1417 | |
@@ -1437,7 +1437,7 @@ discard block |
||
| 1437 | 1437 | 'tag' => 'img', |
| 1438 | 1438 | 'type' => 'unparsed_content', |
| 1439 | 1439 | 'content' => '<img src="$1" alt="" class="bbc_img">', |
| 1440 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1440 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1441 | 1441 | { |
| 1442 | 1442 | global $image_proxy_enabled, $user_info; |
| 1443 | 1443 | |
@@ -1463,7 +1463,7 @@ discard block |
||
| 1463 | 1463 | 'tag' => 'iurl', |
| 1464 | 1464 | 'type' => 'unparsed_content', |
| 1465 | 1465 | 'content' => '<a href="$1" class="bbc_link">$1</a>', |
| 1466 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1466 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1467 | 1467 | { |
| 1468 | 1468 | $data = strtr($data, array('<br>' => '')); |
| 1469 | 1469 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1477,7 +1477,7 @@ discard block |
||
| 1477 | 1477 | 'quoted' => 'optional', |
| 1478 | 1478 | 'before' => '<a href="$1" class="bbc_link">', |
| 1479 | 1479 | 'after' => '</a>', |
| 1480 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1480 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1481 | 1481 | { |
| 1482 | 1482 | if (substr($data, 0, 1) == '#') |
| 1483 | 1483 | $data = '#post_' . substr($data, 1); |
@@ -1563,7 +1563,7 @@ discard block |
||
| 1563 | 1563 | 'tag' => 'php', |
| 1564 | 1564 | 'type' => 'unparsed_content', |
| 1565 | 1565 | 'content' => '<span class="phpcode">$1</span>', |
| 1566 | - 'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled) |
|
| 1566 | + 'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled) |
|
| 1567 | 1567 | { |
| 1568 | 1568 | if (!isset($disabled['php'])) |
| 1569 | 1569 | { |
@@ -1661,7 +1661,7 @@ discard block |
||
| 1661 | 1661 | 'test' => '[1-7]\]', |
| 1662 | 1662 | 'before' => '<span style="font-size: $1;" class="bbc_size">', |
| 1663 | 1663 | 'after' => '</span>', |
| 1664 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1664 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1665 | 1665 | { |
| 1666 | 1666 | $sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95); |
| 1667 | 1667 | $data = $sizes[$data] . 'em'; |
@@ -1699,7 +1699,7 @@ discard block |
||
| 1699 | 1699 | 'tag' => 'time', |
| 1700 | 1700 | 'type' => 'unparsed_content', |
| 1701 | 1701 | 'content' => '$1', |
| 1702 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1702 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1703 | 1703 | { |
| 1704 | 1704 | if (is_numeric($data)) |
| 1705 | 1705 | $data = timeformat($data); |
@@ -1727,7 +1727,7 @@ discard block |
||
| 1727 | 1727 | 'tag' => 'url', |
| 1728 | 1728 | 'type' => 'unparsed_content', |
| 1729 | 1729 | 'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>', |
| 1730 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1730 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1731 | 1731 | { |
| 1732 | 1732 | $data = strtr($data, array('<br>' => '')); |
| 1733 | 1733 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1741,7 +1741,7 @@ discard block |
||
| 1741 | 1741 | 'quoted' => 'optional', |
| 1742 | 1742 | 'before' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">', |
| 1743 | 1743 | 'after' => '</a>', |
| 1744 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1744 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1745 | 1745 | { |
| 1746 | 1746 | $scheme = parse_url($data, PHP_URL_SCHEME); |
| 1747 | 1747 | if (empty($scheme)) |
@@ -1773,7 +1773,7 @@ discard block |
||
| 1773 | 1773 | { |
| 1774 | 1774 | if (isset($temp_bbc)) |
| 1775 | 1775 | $bbc_codes = $temp_bbc; |
| 1776 | - usort($codes, function ($a, $b) { |
|
| 1776 | + usort($codes, function($a, $b) { |
|
| 1777 | 1777 | return strcmp($a['tag'], $b['tag']); |
| 1778 | 1778 | }); |
| 1779 | 1779 | return $codes; |
@@ -1989,7 +1989,7 @@ discard block |
||
| 1989 | 1989 | # a run of Unicode domain name characters and a dot |
| 1990 | 1990 | [\p{L}\p{M}\p{N}\-.:@]+\. |
| 1991 | 1991 | # and then a TLD valid in the DNS or the reserved "local" TLD |
| 1992 | - (?:'. $modSettings['tld_regex'] .'|local) |
|
| 1992 | + (?:'. $modSettings['tld_regex'] . '|local) |
|
| 1993 | 1993 | ) |
| 1994 | 1994 | # followed by a non-domain character or end of line |
| 1995 | 1995 | (?=[^\p{L}\p{N}\-.]|$) |
@@ -2057,7 +2057,7 @@ discard block |
||
| 2057 | 2057 | )? |
| 2058 | 2058 | '; |
| 2059 | 2059 | |
| 2060 | - $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) { |
|
| 2060 | + $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) { |
|
| 2061 | 2061 | $url = array_shift($matches); |
| 2062 | 2062 | |
| 2063 | 2063 | // If this isn't a clean URL, bail out |
@@ -2082,7 +2082,7 @@ discard block |
||
| 2082 | 2082 | $fullUrl = $url; |
| 2083 | 2083 | |
| 2084 | 2084 | // Make sure that $fullUrl really is valid |
| 2085 | - if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '' ) . $fullUrl) === false) |
|
| 2085 | + if (validate_iri((strpos($fullUrl, '//') === 0 ? 'http:' : '') . $fullUrl) === false) |
|
| 2086 | 2086 | return $url; |
| 2087 | 2087 | |
| 2088 | 2088 | return '[url="' . str_replace(array('[', ']'), array('[', ']'), $fullUrl) . '"]' . $url . '[/url]'; |
@@ -2146,7 +2146,7 @@ discard block |
||
| 2146 | 2146 | $look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2)); |
| 2147 | 2147 | |
| 2148 | 2148 | // A closing tag that doesn't match any open tags? Skip it. |
| 2149 | - if (!in_array($look_for, array_map(function($code){return $code['tag'];}, $open_tags))) |
|
| 2149 | + if (!in_array($look_for, array_map(function($code) {return $code['tag']; }, $open_tags))) |
|
| 2150 | 2150 | continue; |
| 2151 | 2151 | |
| 2152 | 2152 | $to_close = array(); |
@@ -2813,7 +2813,7 @@ discard block |
||
| 2813 | 2813 | for ($i = 0, $n = count($smileysfrom); $i < $n; $i++) |
| 2814 | 2814 | { |
| 2815 | 2815 | $specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES); |
| 2816 | - $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
| 2816 | + $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
| 2817 | 2817 | |
| 2818 | 2818 | $smileyPregReplacements[$smileysfrom[$i]] = $smileyCode; |
| 2819 | 2819 | |
@@ -2830,7 +2830,7 @@ discard block |
||
| 2830 | 2830 | |
| 2831 | 2831 | // Replace away! |
| 2832 | 2832 | $message = preg_replace_callback($smileyPregSearch, |
| 2833 | - function ($matches) use ($smileyPregReplacements) |
|
| 2833 | + function($matches) use ($smileyPregReplacements) |
|
| 2834 | 2834 | { |
| 2835 | 2835 | return $smileyPregReplacements[$matches[1]]; |
| 2836 | 2836 | }, $message); |
@@ -2927,13 +2927,13 @@ discard block |
||
| 2927 | 2927 | { |
| 2928 | 2928 | if (defined('SID') && SID != '') |
| 2929 | 2929 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#]+?)(#[^"]*?)?$~', |
| 2930 | - function ($m) use ($scripturl) |
|
| 2930 | + function($m) use ($scripturl) |
|
| 2931 | 2931 | { |
| 2932 | - return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : ""); |
|
| 2932 | + return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : ""); |
|
| 2933 | 2933 | }, $setLocation); |
| 2934 | 2934 | else |
| 2935 | 2935 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~', |
| 2936 | - function ($m) use ($scripturl) |
|
| 2936 | + function($m) use ($scripturl) |
|
| 2937 | 2937 | { |
| 2938 | 2938 | return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : ""); |
| 2939 | 2939 | }, $setLocation); |
@@ -3254,7 +3254,7 @@ discard block |
||
| 3254 | 3254 | |
| 3255 | 3255 | // Add a generic "Are you sure?" confirmation message. |
| 3256 | 3256 | addInlineJavaScript(' |
| 3257 | - var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';'); |
|
| 3257 | + var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';'); |
|
| 3258 | 3258 | |
| 3259 | 3259 | // Now add the capping code for avatars. |
| 3260 | 3260 | 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') |
@@ -3719,7 +3719,7 @@ discard block |
||
| 3719 | 3719 | if (!empty($normal)) |
| 3720 | 3720 | foreach ($normal as $nf) |
| 3721 | 3721 | echo ' |
| 3722 | - <link rel="stylesheet" href="', $nf ,'">'; |
|
| 3722 | + <link rel="stylesheet" href="', $nf, '">'; |
|
| 3723 | 3723 | |
| 3724 | 3724 | if ($db_show_debug === true) |
| 3725 | 3725 | { |
@@ -3735,7 +3735,7 @@ discard block |
||
| 3735 | 3735 | <style>'; |
| 3736 | 3736 | |
| 3737 | 3737 | foreach ($context['css_header'] as $css) |
| 3738 | - echo $css .' |
|
| 3738 | + echo $css . ' |
|
| 3739 | 3739 | '; |
| 3740 | 3740 | |
| 3741 | 3741 | echo' |
@@ -3779,7 +3779,7 @@ discard block |
||
| 3779 | 3779 | |
| 3780 | 3780 | |
| 3781 | 3781 | // No namespaces, sorry! |
| 3782 | - $classType = 'MatthiasMullie\\Minify\\'. strtoupper($type); |
|
| 3782 | + $classType = 'MatthiasMullie\\Minify\\' . strtoupper($type); |
|
| 3783 | 3783 | |
| 3784 | 3784 | // Temp path. |
| 3785 | 3785 | $cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/'; |
@@ -3959,7 +3959,7 @@ discard block |
||
| 3959 | 3959 | else |
| 3960 | 3960 | $path = $modSettings['attachmentUploadDir']; |
| 3961 | 3961 | |
| 3962 | - return $path . '/' . $attachment_id . '_' . $file_hash .'.dat'; |
|
| 3962 | + return $path . '/' . $attachment_id . '_' . $file_hash . '.dat'; |
|
| 3963 | 3963 | } |
| 3964 | 3964 | |
| 3965 | 3965 | /** |
@@ -4003,10 +4003,10 @@ discard block |
||
| 4003 | 4003 | $valid_low = isValidIP($ip_parts[0]); |
| 4004 | 4004 | $valid_high = isValidIP($ip_parts[1]); |
| 4005 | 4005 | $count = 0; |
| 4006 | - $mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.'); |
|
| 4006 | + $mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.'); |
|
| 4007 | 4007 | $max = ($mode == ':' ? 'ffff' : '255'); |
| 4008 | 4008 | $min = 0; |
| 4009 | - if(!$valid_low) |
|
| 4009 | + if (!$valid_low) |
|
| 4010 | 4010 | { |
| 4011 | 4011 | $ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]); |
| 4012 | 4012 | $valid_low = isValidIP($ip_parts[0]); |
@@ -4020,7 +4020,7 @@ discard block |
||
| 4020 | 4020 | } |
| 4021 | 4021 | |
| 4022 | 4022 | $count = 0; |
| 4023 | - if(!$valid_high) |
|
| 4023 | + if (!$valid_high) |
|
| 4024 | 4024 | { |
| 4025 | 4025 | $ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]); |
| 4026 | 4026 | $valid_high = isValidIP($ip_parts[1]); |
@@ -4033,7 +4033,7 @@ discard block |
||
| 4033 | 4033 | } |
| 4034 | 4034 | } |
| 4035 | 4035 | |
| 4036 | - if($valid_high && $valid_low) |
|
| 4036 | + if ($valid_high && $valid_low) |
|
| 4037 | 4037 | { |
| 4038 | 4038 | $ip_array['low'] = $ip_parts[0]; |
| 4039 | 4039 | $ip_array['high'] = $ip_parts[1]; |
@@ -4215,7 +4215,7 @@ discard block |
||
| 4215 | 4215 | addInlineJavaScript(' |
| 4216 | 4216 | var user_menus = new smc_PopupMenu(); |
| 4217 | 4217 | user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup"); |
| 4218 | - user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true); |
|
| 4218 | + user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true); |
|
| 4219 | 4219 | if ($context['allow_pm']) |
| 4220 | 4220 | addInlineJavaScript(' |
| 4221 | 4221 | user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true); |
@@ -4851,7 +4851,7 @@ discard block |
||
| 4851 | 4851 | // No? try a fallback to $sourcedir |
| 4852 | 4852 | else |
| 4853 | 4853 | { |
| 4854 | - $absPath = $sourcedir .'/'. $file; |
|
| 4854 | + $absPath = $sourcedir . '/' . $file; |
|
| 4855 | 4855 | |
| 4856 | 4856 | if (file_exists($absPath)) |
| 4857 | 4857 | require_once($absPath); |
@@ -5118,15 +5118,15 @@ discard block |
||
| 5118 | 5118 | |
| 5119 | 5119 | // UTF-8 occurences of MS special characters |
| 5120 | 5120 | $findchars_utf8 = array( |
| 5121 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5122 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5123 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5124 | - "\xe2\x80\x98", // left single curly quote |
|
| 5125 | - "\xe2\x80\x99", // right single curly quote |
|
| 5126 | - "\xe2\x80\x9c", // left double curly quote |
|
| 5127 | - "\xe2\x80\x9d", // right double curly quote |
|
| 5128 | - "\xe2\x80\x93", // en dash |
|
| 5129 | - "\xe2\x80\x94", // em dash |
|
| 5121 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5122 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5123 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5124 | + "\xe2\x80\x98", // left single curly quote |
|
| 5125 | + "\xe2\x80\x99", // right single curly quote |
|
| 5126 | + "\xe2\x80\x9c", // left double curly quote |
|
| 5127 | + "\xe2\x80\x9d", // right double curly quote |
|
| 5128 | + "\xe2\x80\x93", // en dash |
|
| 5129 | + "\xe2\x80\x94", // em dash |
|
| 5130 | 5130 | ); |
| 5131 | 5131 | |
| 5132 | 5132 | // windows 1252 / iso equivalents |
@@ -5144,15 +5144,15 @@ discard block |
||
| 5144 | 5144 | |
| 5145 | 5145 | // safe replacements |
| 5146 | 5146 | $replacechars = array( |
| 5147 | - ',', // ‚ |
|
| 5148 | - ',,', // „ |
|
| 5149 | - '...', // … |
|
| 5150 | - "'", // ‘ |
|
| 5151 | - "'", // ’ |
|
| 5152 | - '"', // “ |
|
| 5153 | - '"', // ” |
|
| 5154 | - '-', // – |
|
| 5155 | - '--', // — |
|
| 5147 | + ',', // ‚ |
|
| 5148 | + ',,', // „ |
|
| 5149 | + '...', // … |
|
| 5150 | + "'", // ‘ |
|
| 5151 | + "'", // ’ |
|
| 5152 | + '"', // “ |
|
| 5153 | + '"', // ” |
|
| 5154 | + '-', // – |
|
| 5155 | + '--', // — |
|
| 5156 | 5156 | ); |
| 5157 | 5157 | |
| 5158 | 5158 | if ($context['utf8']) |
@@ -5570,7 +5570,7 @@ discard block |
||
| 5570 | 5570 | */ |
| 5571 | 5571 | function inet_dtop($bin) |
| 5572 | 5572 | { |
| 5573 | - if(empty($bin)) |
|
| 5573 | + if (empty($bin)) |
|
| 5574 | 5574 | return ''; |
| 5575 | 5575 | |
| 5576 | 5576 | global $db_type; |
@@ -5601,28 +5601,28 @@ discard block |
||
| 5601 | 5601 | */ |
| 5602 | 5602 | function _safe_serialize($value) |
| 5603 | 5603 | { |
| 5604 | - if(is_null($value)) |
|
| 5604 | + if (is_null($value)) |
|
| 5605 | 5605 | return 'N;'; |
| 5606 | 5606 | |
| 5607 | - if(is_bool($value)) |
|
| 5608 | - return 'b:'. (int) $value .';'; |
|
| 5607 | + if (is_bool($value)) |
|
| 5608 | + return 'b:' . (int) $value . ';'; |
|
| 5609 | 5609 | |
| 5610 | - if(is_int($value)) |
|
| 5611 | - return 'i:'. $value .';'; |
|
| 5610 | + if (is_int($value)) |
|
| 5611 | + return 'i:' . $value . ';'; |
|
| 5612 | 5612 | |
| 5613 | - if(is_float($value)) |
|
| 5614 | - return 'd:'. str_replace(',', '.', $value) .';'; |
|
| 5613 | + if (is_float($value)) |
|
| 5614 | + return 'd:' . str_replace(',', '.', $value) . ';'; |
|
| 5615 | 5615 | |
| 5616 | - if(is_string($value)) |
|
| 5617 | - return 's:'. strlen($value) .':"'. $value .'";'; |
|
| 5616 | + if (is_string($value)) |
|
| 5617 | + return 's:' . strlen($value) . ':"' . $value . '";'; |
|
| 5618 | 5618 | |
| 5619 | - if(is_array($value)) |
|
| 5619 | + if (is_array($value)) |
|
| 5620 | 5620 | { |
| 5621 | 5621 | $out = ''; |
| 5622 | - foreach($value as $k => $v) |
|
| 5622 | + foreach ($value as $k => $v) |
|
| 5623 | 5623 | $out .= _safe_serialize($k) . _safe_serialize($v); |
| 5624 | 5624 | |
| 5625 | - return 'a:'. count($value) .':{'. $out .'}'; |
|
| 5625 | + return 'a:' . count($value) . ':{' . $out . '}'; |
|
| 5626 | 5626 | } |
| 5627 | 5627 | |
| 5628 | 5628 | // safe_serialize cannot serialize resources or objects. |
@@ -5664,7 +5664,7 @@ discard block |
||
| 5664 | 5664 | function _safe_unserialize($str) |
| 5665 | 5665 | { |
| 5666 | 5666 | // Input is not a string. |
| 5667 | - if(empty($str) || !is_string($str)) |
|
| 5667 | + if (empty($str) || !is_string($str)) |
|
| 5668 | 5668 | return false; |
| 5669 | 5669 | |
| 5670 | 5670 | $stack = array(); |
@@ -5678,40 +5678,40 @@ discard block |
||
| 5678 | 5678 | * 3 - in array, expecting value or another array |
| 5679 | 5679 | */ |
| 5680 | 5680 | $state = 0; |
| 5681 | - while($state != 1) |
|
| 5681 | + while ($state != 1) |
|
| 5682 | 5682 | { |
| 5683 | 5683 | $type = isset($str[0]) ? $str[0] : ''; |
| 5684 | - if($type == '}') |
|
| 5684 | + if ($type == '}') |
|
| 5685 | 5685 | $str = substr($str, 1); |
| 5686 | 5686 | |
| 5687 | - else if($type == 'N' && $str[1] == ';') |
|
| 5687 | + else if ($type == 'N' && $str[1] == ';') |
|
| 5688 | 5688 | { |
| 5689 | 5689 | $value = null; |
| 5690 | 5690 | $str = substr($str, 2); |
| 5691 | 5691 | } |
| 5692 | - else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
| 5692 | + else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
| 5693 | 5693 | { |
| 5694 | 5694 | $value = $matches[1] == '1' ? true : false; |
| 5695 | 5695 | $str = substr($str, 4); |
| 5696 | 5696 | } |
| 5697 | - else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
| 5697 | + else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
| 5698 | 5698 | { |
| 5699 | - $value = (int)$matches[1]; |
|
| 5699 | + $value = (int) $matches[1]; |
|
| 5700 | 5700 | $str = $matches[2]; |
| 5701 | 5701 | } |
| 5702 | - else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
| 5702 | + else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
| 5703 | 5703 | { |
| 5704 | - $value = (float)$matches[1]; |
|
| 5704 | + $value = (float) $matches[1]; |
|
| 5705 | 5705 | $str = $matches[3]; |
| 5706 | 5706 | } |
| 5707 | - else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";') |
|
| 5707 | + else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";') |
|
| 5708 | 5708 | { |
| 5709 | - $value = substr($matches[2], 0, (int)$matches[1]); |
|
| 5710 | - $str = substr($matches[2], (int)$matches[1] + 2); |
|
| 5709 | + $value = substr($matches[2], 0, (int) $matches[1]); |
|
| 5710 | + $str = substr($matches[2], (int) $matches[1] + 2); |
|
| 5711 | 5711 | } |
| 5712 | - else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
| 5712 | + else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
| 5713 | 5713 | { |
| 5714 | - $expectedLength = (int)$matches[1]; |
|
| 5714 | + $expectedLength = (int) $matches[1]; |
|
| 5715 | 5715 | $str = $matches[2]; |
| 5716 | 5716 | } |
| 5717 | 5717 | |
@@ -5719,10 +5719,10 @@ discard block |
||
| 5719 | 5719 | else |
| 5720 | 5720 | return false; |
| 5721 | 5721 | |
| 5722 | - switch($state) |
|
| 5722 | + switch ($state) |
|
| 5723 | 5723 | { |
| 5724 | 5724 | case 3: // In array, expecting value or another array. |
| 5725 | - if($type == 'a') |
|
| 5725 | + if ($type == 'a') |
|
| 5726 | 5726 | { |
| 5727 | 5727 | $stack[] = &$list; |
| 5728 | 5728 | $list[$key] = array(); |
@@ -5731,7 +5731,7 @@ discard block |
||
| 5731 | 5731 | $state = 2; |
| 5732 | 5732 | break; |
| 5733 | 5733 | } |
| 5734 | - if($type != '}') |
|
| 5734 | + if ($type != '}') |
|
| 5735 | 5735 | { |
| 5736 | 5736 | $list[$key] = $value; |
| 5737 | 5737 | $state = 2; |
@@ -5742,29 +5742,29 @@ discard block |
||
| 5742 | 5742 | return false; |
| 5743 | 5743 | |
| 5744 | 5744 | case 2: // in array, expecting end of array or a key |
| 5745 | - if($type == '}') |
|
| 5745 | + if ($type == '}') |
|
| 5746 | 5746 | { |
| 5747 | 5747 | // Array size is less than expected. |
| 5748 | - if(count($list) < end($expected)) |
|
| 5748 | + if (count($list) < end($expected)) |
|
| 5749 | 5749 | return false; |
| 5750 | 5750 | |
| 5751 | 5751 | unset($list); |
| 5752 | - $list = &$stack[count($stack)-1]; |
|
| 5752 | + $list = &$stack[count($stack) - 1]; |
|
| 5753 | 5753 | array_pop($stack); |
| 5754 | 5754 | |
| 5755 | 5755 | // Go to terminal state if we're at the end of the root array. |
| 5756 | 5756 | array_pop($expected); |
| 5757 | 5757 | |
| 5758 | - if(count($expected) == 0) |
|
| 5758 | + if (count($expected) == 0) |
|
| 5759 | 5759 | $state = 1; |
| 5760 | 5760 | |
| 5761 | 5761 | break; |
| 5762 | 5762 | } |
| 5763 | 5763 | |
| 5764 | - if($type == 'i' || $type == 's') |
|
| 5764 | + if ($type == 'i' || $type == 's') |
|
| 5765 | 5765 | { |
| 5766 | 5766 | // Array size exceeds expected length. |
| 5767 | - if(count($list) >= end($expected)) |
|
| 5767 | + if (count($list) >= end($expected)) |
|
| 5768 | 5768 | return false; |
| 5769 | 5769 | |
| 5770 | 5770 | $key = $value; |
@@ -5777,7 +5777,7 @@ discard block |
||
| 5777 | 5777 | |
| 5778 | 5778 | // Expecting array or value. |
| 5779 | 5779 | case 0: |
| 5780 | - if($type == 'a') |
|
| 5780 | + if ($type == 'a') |
|
| 5781 | 5781 | { |
| 5782 | 5782 | $data = array(); |
| 5783 | 5783 | $list = &$data; |
@@ -5786,7 +5786,7 @@ discard block |
||
| 5786 | 5786 | break; |
| 5787 | 5787 | } |
| 5788 | 5788 | |
| 5789 | - if($type != '}') |
|
| 5789 | + if ($type != '}') |
|
| 5790 | 5790 | { |
| 5791 | 5791 | $data = $value; |
| 5792 | 5792 | $state = 1; |
@@ -5799,7 +5799,7 @@ discard block |
||
| 5799 | 5799 | } |
| 5800 | 5800 | |
| 5801 | 5801 | // Trailing data in input. |
| 5802 | - if(!empty($str)) |
|
| 5802 | + if (!empty($str)) |
|
| 5803 | 5803 | return false; |
| 5804 | 5804 | |
| 5805 | 5805 | return $data; |
@@ -5853,7 +5853,7 @@ discard block |
||
| 5853 | 5853 | // Set different modes. |
| 5854 | 5854 | $chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
| 5855 | 5855 | |
| 5856 | - foreach($chmodValues as $val) |
|
| 5856 | + foreach ($chmodValues as $val) |
|
| 5857 | 5857 | { |
| 5858 | 5858 | // If it's writable, break out of the loop. |
| 5859 | 5859 | if (is_writable($file)) |
@@ -5888,13 +5888,13 @@ discard block |
||
| 5888 | 5888 | $returnArray = @json_decode($json, $returnAsArray); |
| 5889 | 5889 | |
| 5890 | 5890 | // PHP 5.3 so no json_last_error_msg() |
| 5891 | - switch(json_last_error()) |
|
| 5891 | + switch (json_last_error()) |
|
| 5892 | 5892 | { |
| 5893 | 5893 | case JSON_ERROR_NONE: |
| 5894 | 5894 | $jsonError = false; |
| 5895 | 5895 | break; |
| 5896 | 5896 | case JSON_ERROR_DEPTH: |
| 5897 | - $jsonError = 'JSON_ERROR_DEPTH'; |
|
| 5897 | + $jsonError = 'JSON_ERROR_DEPTH'; |
|
| 5898 | 5898 | break; |
| 5899 | 5899 | case JSON_ERROR_STATE_MISMATCH: |
| 5900 | 5900 | $jsonError = 'JSON_ERROR_STATE_MISMATCH'; |
@@ -5922,10 +5922,10 @@ discard block |
||
| 5922 | 5922 | loadLanguage('Errors'); |
| 5923 | 5923 | |
| 5924 | 5924 | if (!empty($jsonDebug)) |
| 5925 | - log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
| 5925 | + log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
| 5926 | 5926 | |
| 5927 | 5927 | else |
| 5928 | - log_error($txt['json_'. $jsonError], 'critical'); |
|
| 5928 | + log_error($txt['json_' . $jsonError], 'critical'); |
|
| 5929 | 5929 | |
| 5930 | 5930 | // Everyone expects an array. |
| 5931 | 5931 | return array(); |
@@ -6042,7 +6042,7 @@ discard block |
||
| 6042 | 6042 | // Convert Punycode to Unicode |
| 6043 | 6043 | require_once($sourcedir . '/punycode/Punycode.php'); |
| 6044 | 6044 | $Punycode = new TrueBV\Punycode(); |
| 6045 | - $tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds); |
|
| 6045 | + $tlds = array_map(function($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds); |
|
| 6046 | 6046 | } |
| 6047 | 6047 | // Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update |
| 6048 | 6048 | else |
@@ -6136,7 +6136,7 @@ discard block |
||
| 6136 | 6136 | } |
| 6137 | 6137 | |
| 6138 | 6138 | // This recursive function creates the index array from the strings |
| 6139 | - $add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
| 6139 | + $add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
| 6140 | 6140 | { |
| 6141 | 6141 | static $depth = 0; |
| 6142 | 6142 | $depth++; |
@@ -6163,7 +6163,7 @@ discard block |
||
| 6163 | 6163 | }; |
| 6164 | 6164 | |
| 6165 | 6165 | // This recursive function turns the index array into a regular expression |
| 6166 | - $index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex) |
|
| 6166 | + $index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex) |
|
| 6167 | 6167 | { |
| 6168 | 6168 | static $depth = 0; |
| 6169 | 6169 | $depth++; |
@@ -6187,11 +6187,11 @@ discard block |
||
| 6187 | 6187 | |
| 6188 | 6188 | if (count(array_keys($value)) == 1) |
| 6189 | 6189 | { |
| 6190 | - $new_key_array = explode('(?'.'>', $sub_regex); |
|
| 6190 | + $new_key_array = explode('(?' . '>', $sub_regex); |
|
| 6191 | 6191 | $new_key .= $new_key_array[0]; |
| 6192 | 6192 | } |
| 6193 | 6193 | else |
| 6194 | - $sub_regex = '(?'.'>' . $sub_regex . ')'; |
|
| 6194 | + $sub_regex = '(?' . '>' . $sub_regex . ')'; |
|
| 6195 | 6195 | } |
| 6196 | 6196 | |
| 6197 | 6197 | if ($depth > 1) |
@@ -6234,10 +6234,10 @@ discard block |
||
| 6234 | 6234 | { |
| 6235 | 6235 | $regex = array(); |
| 6236 | 6236 | while (!empty($index)) |
| 6237 | - $regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
| 6237 | + $regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
| 6238 | 6238 | } |
| 6239 | 6239 | else |
| 6240 | - $regex = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
| 6240 | + $regex = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
| 6241 | 6241 | |
| 6242 | 6242 | // Restore PHP's internal character encoding to whatever it was originally |
| 6243 | 6243 | if (!empty($current_encoding)) |
@@ -6459,7 +6459,7 @@ discard block |
||
| 6459 | 6459 | function sanitize_iri($iri) |
| 6460 | 6460 | { |
| 6461 | 6461 | // Encode any non-ASCII characters (but not space or control characters of any sort) |
| 6462 | - $iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) { |
|
| 6462 | + $iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function($matches) { |
|
| 6463 | 6463 | return rawurlencode($matches[0]); |
| 6464 | 6464 | }, $iri); |
| 6465 | 6465 | |
@@ -6501,7 +6501,7 @@ discard block |
||
| 6501 | 6501 | $unescaped = array( |
| 6502 | 6502 | '%21'=>'!', '%23'=>'#', '%24'=>'$', '%26'=>'&', |
| 6503 | 6503 | '%27'=>"'", '%28'=>'(', '%29'=>')', '%2A'=>'*', |
| 6504 | - '%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':', |
|
| 6504 | + '%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':', |
|
| 6505 | 6505 | '%3B'=>';', '%3D'=>'=', '%3F'=>'?', '%40'=>'@', |
| 6506 | 6506 | ); |
| 6507 | 6507 | $iri = strtr(rawurlencode($iri), $unescaped); |