@@ -430,8 +430,8 @@ |
||
430 | 430 | $real_name = $smcFunc['db_case_sensitive'] ? 'LOWER(real_name)' : 'real_name'; |
431 | 431 | |
432 | 432 | // Searches. |
433 | - $member_name_search = $member_name . ' ' . $comparison . ' ' . implode( ' OR ' . $member_name . ' ' . $comparison . ' ', $names_list); |
|
434 | - $real_name_search = $real_name . ' ' . $comparison . ' ' . implode( ' OR ' . $real_name . ' ' . $comparison . ' ', $names_list); |
|
433 | + $member_name_search = $member_name . ' ' . $comparison . ' ' . implode(' OR ' . $member_name . ' ' . $comparison . ' ', $names_list); |
|
434 | + $real_name_search = $real_name . ' ' . $comparison . ' ' . implode(' OR ' . $real_name . ' ' . $comparison . ' ', $names_list); |
|
435 | 435 | |
436 | 436 | // Search by username, display name, and email address. |
437 | 437 | $request = $smcFunc['db_query']('', ' |
@@ -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, $image_proxy_secret, $boardurl, $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, $image_proxy_secret, $boardurl, $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); |
@@ -1557,7 +1557,7 @@ discard block |
||
1557 | 1557 | 'tag' => 'php', |
1558 | 1558 | 'type' => 'unparsed_content', |
1559 | 1559 | 'content' => '<span class="phpcode">$1</span>', |
1560 | - 'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled) |
|
1560 | + 'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled) |
|
1561 | 1561 | { |
1562 | 1562 | if (!isset($disabled['php'])) |
1563 | 1563 | { |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | 'test' => '[1-7]\]', |
1656 | 1656 | 'before' => '<span style="font-size: $1;" class="bbc_size">', |
1657 | 1657 | 'after' => '</span>', |
1658 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1658 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1659 | 1659 | { |
1660 | 1660 | $sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95); |
1661 | 1661 | $data = $sizes[$data] . 'em'; |
@@ -1693,7 +1693,7 @@ discard block |
||
1693 | 1693 | 'tag' => 'time', |
1694 | 1694 | 'type' => 'unparsed_content', |
1695 | 1695 | 'content' => '$1', |
1696 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1696 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1697 | 1697 | { |
1698 | 1698 | if (is_numeric($data)) |
1699 | 1699 | $data = timeformat($data); |
@@ -1721,7 +1721,7 @@ discard block |
||
1721 | 1721 | 'tag' => 'url', |
1722 | 1722 | 'type' => 'unparsed_content', |
1723 | 1723 | 'content' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">$1</a>', |
1724 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1724 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1725 | 1725 | { |
1726 | 1726 | $data = strtr($data, array('<br>' => '')); |
1727 | 1727 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1735,7 +1735,7 @@ discard block |
||
1735 | 1735 | 'quoted' => 'optional', |
1736 | 1736 | 'before' => '<a href="$1" class="bbc_link" target="_blank" rel="noopener">', |
1737 | 1737 | 'after' => '</a>', |
1738 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1738 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1739 | 1739 | { |
1740 | 1740 | $scheme = parse_url($data, PHP_URL_SCHEME); |
1741 | 1741 | if (empty($scheme)) |
@@ -1761,7 +1761,7 @@ discard block |
||
1761 | 1761 | { |
1762 | 1762 | if (isset($temp_bbc)) |
1763 | 1763 | $bbc_codes = $temp_bbc; |
1764 | - usort($codes, function ($a, $b) { |
|
1764 | + usort($codes, function($a, $b) { |
|
1765 | 1765 | return strcmp($a['tag'], $b['tag']); |
1766 | 1766 | }); |
1767 | 1767 | return $codes; |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | # a run of Unicode domain name characters and a dot |
1999 | 1999 | [\p{L}\p{M}\p{N}\-.:@]+\. |
2000 | 2000 | # and then a TLD valid in the DNS or the reserved "local" TLD |
2001 | - (?:'. $modSettings['tld_regex'] .'|local) |
|
2001 | + (?:'. $modSettings['tld_regex'] . '|local) |
|
2002 | 2002 | ) |
2003 | 2003 | # followed by a non-domain character or end of line |
2004 | 2004 | (?=[^\p{L}\p{N}\-.]|$) |
@@ -2066,7 +2066,7 @@ discard block |
||
2066 | 2066 | )? |
2067 | 2067 | '; |
2068 | 2068 | |
2069 | - $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) { |
|
2069 | + $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) { |
|
2070 | 2070 | $url = array_shift($matches); |
2071 | 2071 | |
2072 | 2072 | $scheme = parse_url($url, PHP_URL_SCHEME); |
@@ -2147,7 +2147,7 @@ discard block |
||
2147 | 2147 | $look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2)); |
2148 | 2148 | |
2149 | 2149 | // A closing tag that doesn't match any open tags? Skip it. |
2150 | - if (!in_array($look_for, array_map(function($code){return $code['tag'];}, $open_tags))) |
|
2150 | + if (!in_array($look_for, array_map(function($code) {return $code['tag']; }, $open_tags))) |
|
2151 | 2151 | continue; |
2152 | 2152 | |
2153 | 2153 | $to_close = array(); |
@@ -2810,7 +2810,7 @@ discard block |
||
2810 | 2810 | for ($i = 0, $n = count($smileysfrom); $i < $n; $i++) |
2811 | 2811 | { |
2812 | 2812 | $specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES); |
2813 | - $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2813 | + $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2814 | 2814 | |
2815 | 2815 | $smileyPregReplacements[$smileysfrom[$i]] = $smileyCode; |
2816 | 2816 | |
@@ -2827,7 +2827,7 @@ discard block |
||
2827 | 2827 | |
2828 | 2828 | // Replace away! |
2829 | 2829 | $message = preg_replace_callback($smileyPregSearch, |
2830 | - function ($matches) use ($smileyPregReplacements) |
|
2830 | + function($matches) use ($smileyPregReplacements) |
|
2831 | 2831 | { |
2832 | 2832 | return $smileyPregReplacements[$matches[1]]; |
2833 | 2833 | }, $message); |
@@ -2893,13 +2893,13 @@ discard block |
||
2893 | 2893 | { |
2894 | 2894 | if (defined('SID') && SID != '') |
2895 | 2895 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#]+?)(#[^"]*?)?$~', |
2896 | - function ($m) use ($scripturl) |
|
2896 | + function($m) use ($scripturl) |
|
2897 | 2897 | { |
2898 | - return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : ""); |
|
2898 | + return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : ""); |
|
2899 | 2899 | }, $setLocation); |
2900 | 2900 | else |
2901 | 2901 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~', |
2902 | - function ($m) use ($scripturl) |
|
2902 | + function($m) use ($scripturl) |
|
2903 | 2903 | { |
2904 | 2904 | return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : ""); |
2905 | 2905 | }, $setLocation); |
@@ -3222,7 +3222,7 @@ discard block |
||
3222 | 3222 | |
3223 | 3223 | // Add a generic "Are you sure?" confirmation message. |
3224 | 3224 | addInlineJavaScript(' |
3225 | - var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';'); |
|
3225 | + var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';'); |
|
3226 | 3226 | |
3227 | 3227 | // Now add the capping code for avatars. |
3228 | 3228 | 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') |
@@ -3583,7 +3583,7 @@ discard block |
||
3583 | 3583 | |
3584 | 3584 | else |
3585 | 3585 | echo ' |
3586 | - <script src="', $settings['theme_url'] ,'/scripts/minified', ($do_deferred ? '_deferred' : '') ,'.js', $minSeed ,'"></script>'; |
|
3586 | + <script src="', $settings['theme_url'], '/scripts/minified', ($do_deferred ? '_deferred' : ''), '.js', $minSeed, '"></script>'; |
|
3587 | 3587 | } |
3588 | 3588 | |
3589 | 3589 | // Inline JavaScript - Actually useful some times! |
@@ -3661,14 +3661,14 @@ discard block |
||
3661 | 3661 | |
3662 | 3662 | else |
3663 | 3663 | echo ' |
3664 | - <link rel="stylesheet" href="', $settings['theme_url'] ,'/css/minified.css', $minSeed ,'">'; |
|
3664 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/minified.css', $minSeed, '">'; |
|
3665 | 3665 | } |
3666 | 3666 | |
3667 | 3667 | // Print the rest after the minified files. |
3668 | 3668 | if (!empty($normal)) |
3669 | 3669 | foreach ($normal as $nf) |
3670 | 3670 | echo ' |
3671 | - <link rel="stylesheet" href="', $nf ,'">'; |
|
3671 | + <link rel="stylesheet" href="', $nf, '">'; |
|
3672 | 3672 | |
3673 | 3673 | if ($db_show_debug === true) |
3674 | 3674 | { |
@@ -3684,7 +3684,7 @@ discard block |
||
3684 | 3684 | <style>'; |
3685 | 3685 | |
3686 | 3686 | foreach ($context['css_header'] as $css) |
3687 | - echo $css .' |
|
3687 | + echo $css . ' |
|
3688 | 3688 | '; |
3689 | 3689 | |
3690 | 3690 | echo' |
@@ -3713,27 +3713,27 @@ discard block |
||
3713 | 3713 | return false; |
3714 | 3714 | |
3715 | 3715 | // Did we already did this? |
3716 | - $toCache = cache_get_data('minimized_'. $settings['theme_id'] .'_'. $type, 86400); |
|
3716 | + $toCache = cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type, 86400); |
|
3717 | 3717 | |
3718 | 3718 | // Already done? |
3719 | 3719 | if (!empty($toCache)) |
3720 | 3720 | return true; |
3721 | 3721 | |
3722 | 3722 | // No namespaces, sorry! |
3723 | - $classType = 'MatthiasMullie\\Minify\\'. strtoupper($type); |
|
3723 | + $classType = 'MatthiasMullie\\Minify\\' . strtoupper($type); |
|
3724 | 3724 | |
3725 | 3725 | // Temp path. |
3726 | - $cTempPath = $settings['theme_dir'] .'/'. ($type == 'css' ? 'css' : 'scripts') .'/'; |
|
3726 | + $cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/'; |
|
3727 | 3727 | |
3728 | 3728 | // What kind of file are we going to create? |
3729 | - $toCreate = $cTempPath .'minified'. ($do_deferred ? '_deferred' : '') .'.'. $type; |
|
3729 | + $toCreate = $cTempPath . 'minified' . ($do_deferred ? '_deferred' : '') . '.' . $type; |
|
3730 | 3730 | |
3731 | 3731 | // File has to exists, if it isn't try to create it. |
3732 | 3732 | if ((!file_exists($toCreate) && @fopen($toCreate, 'w') === false) || !smf_chmod($toCreate)) |
3733 | 3733 | { |
3734 | 3734 | loadLanguage('Errors'); |
3735 | 3735 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3736 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3736 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3737 | 3737 | |
3738 | 3738 | // The process failed so roll back to print each individual file. |
3739 | 3739 | return $data; |
@@ -3768,14 +3768,14 @@ discard block |
||
3768 | 3768 | { |
3769 | 3769 | loadLanguage('Errors'); |
3770 | 3770 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3771 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3771 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3772 | 3772 | |
3773 | 3773 | // The process failed so roll back to print each individual file. |
3774 | 3774 | return $data; |
3775 | 3775 | } |
3776 | 3776 | |
3777 | 3777 | // And create a long lived cache entry. |
3778 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, $toCreate, 86400); |
|
3778 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, $toCreate, 86400); |
|
3779 | 3779 | |
3780 | 3780 | return true; |
3781 | 3781 | } |
@@ -3835,7 +3835,7 @@ discard block |
||
3835 | 3835 | else |
3836 | 3836 | $path = $modSettings['attachmentUploadDir']; |
3837 | 3837 | |
3838 | - return $path . '/' . $attachment_id . '_' . $file_hash .'.dat'; |
|
3838 | + return $path . '/' . $attachment_id . '_' . $file_hash . '.dat'; |
|
3839 | 3839 | } |
3840 | 3840 | |
3841 | 3841 | /** |
@@ -3879,10 +3879,10 @@ discard block |
||
3879 | 3879 | $valid_low = isValidIP($ip_parts[0]); |
3880 | 3880 | $valid_high = isValidIP($ip_parts[1]); |
3881 | 3881 | $count = 0; |
3882 | - $mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.'); |
|
3882 | + $mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.'); |
|
3883 | 3883 | $max = ($mode == ':' ? 'ffff' : '255'); |
3884 | 3884 | $min = 0; |
3885 | - if(!$valid_low) |
|
3885 | + if (!$valid_low) |
|
3886 | 3886 | { |
3887 | 3887 | $ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]); |
3888 | 3888 | $valid_low = isValidIP($ip_parts[0]); |
@@ -3896,7 +3896,7 @@ discard block |
||
3896 | 3896 | } |
3897 | 3897 | |
3898 | 3898 | $count = 0; |
3899 | - if(!$valid_high) |
|
3899 | + if (!$valid_high) |
|
3900 | 3900 | { |
3901 | 3901 | $ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]); |
3902 | 3902 | $valid_high = isValidIP($ip_parts[1]); |
@@ -3909,7 +3909,7 @@ discard block |
||
3909 | 3909 | } |
3910 | 3910 | } |
3911 | 3911 | |
3912 | - if($valid_high && $valid_low) |
|
3912 | + if ($valid_high && $valid_low) |
|
3913 | 3913 | { |
3914 | 3914 | $ip_array['low'] = $ip_parts[0]; |
3915 | 3915 | $ip_array['high'] = $ip_parts[1]; |
@@ -4091,7 +4091,7 @@ discard block |
||
4091 | 4091 | addInlineJavaScript(' |
4092 | 4092 | var user_menus = new smc_PopupMenu(); |
4093 | 4093 | user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup"); |
4094 | - user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true); |
|
4094 | + user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true); |
|
4095 | 4095 | if ($context['allow_pm']) |
4096 | 4096 | addInlineJavaScript(' |
4097 | 4097 | user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true); |
@@ -4727,7 +4727,7 @@ discard block |
||
4727 | 4727 | // No? try a fallback to $sourcedir |
4728 | 4728 | else |
4729 | 4729 | { |
4730 | - $absPath = $sourcedir .'/'. $file; |
|
4730 | + $absPath = $sourcedir . '/' . $file; |
|
4731 | 4731 | |
4732 | 4732 | if (file_exists($absPath)) |
4733 | 4733 | require_once($absPath); |
@@ -4808,15 +4808,15 @@ discard block |
||
4808 | 4808 | |
4809 | 4809 | // UTF-8 occurences of MS special characters |
4810 | 4810 | $findchars_utf8 = array( |
4811 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
4812 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
4813 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
4814 | - "\xe2\x80\x98", // left single curly quote |
|
4815 | - "\xe2\x80\x99", // right single curly quote |
|
4816 | - "\xe2\x80\x9c", // left double curly quote |
|
4817 | - "\xe2\x80\x9d", // right double curly quote |
|
4818 | - "\xe2\x80\x93", // en dash |
|
4819 | - "\xe2\x80\x94", // em dash |
|
4811 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
4812 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
4813 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
4814 | + "\xe2\x80\x98", // left single curly quote |
|
4815 | + "\xe2\x80\x99", // right single curly quote |
|
4816 | + "\xe2\x80\x9c", // left double curly quote |
|
4817 | + "\xe2\x80\x9d", // right double curly quote |
|
4818 | + "\xe2\x80\x93", // en dash |
|
4819 | + "\xe2\x80\x94", // em dash |
|
4820 | 4820 | ); |
4821 | 4821 | |
4822 | 4822 | // windows 1252 / iso equivalents |
@@ -4834,15 +4834,15 @@ discard block |
||
4834 | 4834 | |
4835 | 4835 | // safe replacements |
4836 | 4836 | $replacechars = array( |
4837 | - ',', // ‚ |
|
4838 | - ',,', // „ |
|
4839 | - '...', // … |
|
4840 | - "'", // ‘ |
|
4841 | - "'", // ’ |
|
4842 | - '"', // “ |
|
4843 | - '"', // ” |
|
4844 | - '-', // – |
|
4845 | - '--', // — |
|
4837 | + ',', // ‚ |
|
4838 | + ',,', // „ |
|
4839 | + '...', // … |
|
4840 | + "'", // ‘ |
|
4841 | + "'", // ’ |
|
4842 | + '"', // “ |
|
4843 | + '"', // ” |
|
4844 | + '-', // – |
|
4845 | + '--', // — |
|
4846 | 4846 | ); |
4847 | 4847 | |
4848 | 4848 | if ($context['utf8']) |
@@ -5260,7 +5260,7 @@ discard block |
||
5260 | 5260 | */ |
5261 | 5261 | function inet_dtop($bin) |
5262 | 5262 | { |
5263 | - if(empty($bin)) |
|
5263 | + if (empty($bin)) |
|
5264 | 5264 | return ''; |
5265 | 5265 | |
5266 | 5266 | global $db_type; |
@@ -5291,28 +5291,28 @@ discard block |
||
5291 | 5291 | */ |
5292 | 5292 | function _safe_serialize($value) |
5293 | 5293 | { |
5294 | - if(is_null($value)) |
|
5294 | + if (is_null($value)) |
|
5295 | 5295 | return 'N;'; |
5296 | 5296 | |
5297 | - if(is_bool($value)) |
|
5298 | - return 'b:'. (int) $value .';'; |
|
5297 | + if (is_bool($value)) |
|
5298 | + return 'b:' . (int) $value . ';'; |
|
5299 | 5299 | |
5300 | - if(is_int($value)) |
|
5301 | - return 'i:'. $value .';'; |
|
5300 | + if (is_int($value)) |
|
5301 | + return 'i:' . $value . ';'; |
|
5302 | 5302 | |
5303 | - if(is_float($value)) |
|
5304 | - return 'd:'. str_replace(',', '.', $value) .';'; |
|
5303 | + if (is_float($value)) |
|
5304 | + return 'd:' . str_replace(',', '.', $value) . ';'; |
|
5305 | 5305 | |
5306 | - if(is_string($value)) |
|
5307 | - return 's:'. strlen($value) .':"'. $value .'";'; |
|
5306 | + if (is_string($value)) |
|
5307 | + return 's:' . strlen($value) . ':"' . $value . '";'; |
|
5308 | 5308 | |
5309 | - if(is_array($value)) |
|
5309 | + if (is_array($value)) |
|
5310 | 5310 | { |
5311 | 5311 | $out = ''; |
5312 | - foreach($value as $k => $v) |
|
5312 | + foreach ($value as $k => $v) |
|
5313 | 5313 | $out .= _safe_serialize($k) . _safe_serialize($v); |
5314 | 5314 | |
5315 | - return 'a:'. count($value) .':{'. $out .'}'; |
|
5315 | + return 'a:' . count($value) . ':{' . $out . '}'; |
|
5316 | 5316 | } |
5317 | 5317 | |
5318 | 5318 | // safe_serialize cannot serialize resources or objects. |
@@ -5354,7 +5354,7 @@ discard block |
||
5354 | 5354 | function _safe_unserialize($str) |
5355 | 5355 | { |
5356 | 5356 | // Input is not a string. |
5357 | - if(empty($str) || !is_string($str)) |
|
5357 | + if (empty($str) || !is_string($str)) |
|
5358 | 5358 | return false; |
5359 | 5359 | |
5360 | 5360 | $stack = array(); |
@@ -5368,40 +5368,40 @@ discard block |
||
5368 | 5368 | * 3 - in array, expecting value or another array |
5369 | 5369 | */ |
5370 | 5370 | $state = 0; |
5371 | - while($state != 1) |
|
5371 | + while ($state != 1) |
|
5372 | 5372 | { |
5373 | 5373 | $type = isset($str[0]) ? $str[0] : ''; |
5374 | - if($type == '}') |
|
5374 | + if ($type == '}') |
|
5375 | 5375 | $str = substr($str, 1); |
5376 | 5376 | |
5377 | - else if($type == 'N' && $str[1] == ';') |
|
5377 | + else if ($type == 'N' && $str[1] == ';') |
|
5378 | 5378 | { |
5379 | 5379 | $value = null; |
5380 | 5380 | $str = substr($str, 2); |
5381 | 5381 | } |
5382 | - else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5382 | + else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5383 | 5383 | { |
5384 | 5384 | $value = $matches[1] == '1' ? true : false; |
5385 | 5385 | $str = substr($str, 4); |
5386 | 5386 | } |
5387 | - else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5387 | + else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5388 | 5388 | { |
5389 | - $value = (int)$matches[1]; |
|
5389 | + $value = (int) $matches[1]; |
|
5390 | 5390 | $str = $matches[2]; |
5391 | 5391 | } |
5392 | - else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5392 | + else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5393 | 5393 | { |
5394 | - $value = (float)$matches[1]; |
|
5394 | + $value = (float) $matches[1]; |
|
5395 | 5395 | $str = $matches[3]; |
5396 | 5396 | } |
5397 | - else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";') |
|
5397 | + else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";') |
|
5398 | 5398 | { |
5399 | - $value = substr($matches[2], 0, (int)$matches[1]); |
|
5400 | - $str = substr($matches[2], (int)$matches[1] + 2); |
|
5399 | + $value = substr($matches[2], 0, (int) $matches[1]); |
|
5400 | + $str = substr($matches[2], (int) $matches[1] + 2); |
|
5401 | 5401 | } |
5402 | - else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5402 | + else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5403 | 5403 | { |
5404 | - $expectedLength = (int)$matches[1]; |
|
5404 | + $expectedLength = (int) $matches[1]; |
|
5405 | 5405 | $str = $matches[2]; |
5406 | 5406 | } |
5407 | 5407 | |
@@ -5409,10 +5409,10 @@ discard block |
||
5409 | 5409 | else |
5410 | 5410 | return false; |
5411 | 5411 | |
5412 | - switch($state) |
|
5412 | + switch ($state) |
|
5413 | 5413 | { |
5414 | 5414 | case 3: // In array, expecting value or another array. |
5415 | - if($type == 'a') |
|
5415 | + if ($type == 'a') |
|
5416 | 5416 | { |
5417 | 5417 | $stack[] = &$list; |
5418 | 5418 | $list[$key] = array(); |
@@ -5421,7 +5421,7 @@ discard block |
||
5421 | 5421 | $state = 2; |
5422 | 5422 | break; |
5423 | 5423 | } |
5424 | - if($type != '}') |
|
5424 | + if ($type != '}') |
|
5425 | 5425 | { |
5426 | 5426 | $list[$key] = $value; |
5427 | 5427 | $state = 2; |
@@ -5432,29 +5432,29 @@ discard block |
||
5432 | 5432 | return false; |
5433 | 5433 | |
5434 | 5434 | case 2: // in array, expecting end of array or a key |
5435 | - if($type == '}') |
|
5435 | + if ($type == '}') |
|
5436 | 5436 | { |
5437 | 5437 | // Array size is less than expected. |
5438 | - if(count($list) < end($expected)) |
|
5438 | + if (count($list) < end($expected)) |
|
5439 | 5439 | return false; |
5440 | 5440 | |
5441 | 5441 | unset($list); |
5442 | - $list = &$stack[count($stack)-1]; |
|
5442 | + $list = &$stack[count($stack) - 1]; |
|
5443 | 5443 | array_pop($stack); |
5444 | 5444 | |
5445 | 5445 | // Go to terminal state if we're at the end of the root array. |
5446 | 5446 | array_pop($expected); |
5447 | 5447 | |
5448 | - if(count($expected) == 0) |
|
5448 | + if (count($expected) == 0) |
|
5449 | 5449 | $state = 1; |
5450 | 5450 | |
5451 | 5451 | break; |
5452 | 5452 | } |
5453 | 5453 | |
5454 | - if($type == 'i' || $type == 's') |
|
5454 | + if ($type == 'i' || $type == 's') |
|
5455 | 5455 | { |
5456 | 5456 | // Array size exceeds expected length. |
5457 | - if(count($list) >= end($expected)) |
|
5457 | + if (count($list) >= end($expected)) |
|
5458 | 5458 | return false; |
5459 | 5459 | |
5460 | 5460 | $key = $value; |
@@ -5467,7 +5467,7 @@ discard block |
||
5467 | 5467 | |
5468 | 5468 | // Expecting array or value. |
5469 | 5469 | case 0: |
5470 | - if($type == 'a') |
|
5470 | + if ($type == 'a') |
|
5471 | 5471 | { |
5472 | 5472 | $data = array(); |
5473 | 5473 | $list = &$data; |
@@ -5476,7 +5476,7 @@ discard block |
||
5476 | 5476 | break; |
5477 | 5477 | } |
5478 | 5478 | |
5479 | - if($type != '}') |
|
5479 | + if ($type != '}') |
|
5480 | 5480 | { |
5481 | 5481 | $data = $value; |
5482 | 5482 | $state = 1; |
@@ -5489,7 +5489,7 @@ discard block |
||
5489 | 5489 | } |
5490 | 5490 | |
5491 | 5491 | // Trailing data in input. |
5492 | - if(!empty($str)) |
|
5492 | + if (!empty($str)) |
|
5493 | 5493 | return false; |
5494 | 5494 | |
5495 | 5495 | return $data; |
@@ -5543,7 +5543,7 @@ discard block |
||
5543 | 5543 | // Set different modes. |
5544 | 5544 | $chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
5545 | 5545 | |
5546 | - foreach($chmodValues as $val) |
|
5546 | + foreach ($chmodValues as $val) |
|
5547 | 5547 | { |
5548 | 5548 | // If it's writable, break out of the loop. |
5549 | 5549 | if (is_writable($file)) |
@@ -5578,13 +5578,13 @@ discard block |
||
5578 | 5578 | $returnArray = @json_decode($json, $returnAsArray); |
5579 | 5579 | |
5580 | 5580 | // PHP 5.3 so no json_last_error_msg() |
5581 | - switch(json_last_error()) |
|
5581 | + switch (json_last_error()) |
|
5582 | 5582 | { |
5583 | 5583 | case JSON_ERROR_NONE: |
5584 | 5584 | $jsonError = false; |
5585 | 5585 | break; |
5586 | 5586 | case JSON_ERROR_DEPTH: |
5587 | - $jsonError = 'JSON_ERROR_DEPTH'; |
|
5587 | + $jsonError = 'JSON_ERROR_DEPTH'; |
|
5588 | 5588 | break; |
5589 | 5589 | case JSON_ERROR_STATE_MISMATCH: |
5590 | 5590 | $jsonError = 'JSON_ERROR_STATE_MISMATCH'; |
@@ -5612,10 +5612,10 @@ discard block |
||
5612 | 5612 | loadLanguage('Errors'); |
5613 | 5613 | |
5614 | 5614 | if (!empty($jsonDebug)) |
5615 | - log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5615 | + log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5616 | 5616 | |
5617 | 5617 | else |
5618 | - log_error($txt['json_'. $jsonError], 'critical'); |
|
5618 | + log_error($txt['json_' . $jsonError], 'critical'); |
|
5619 | 5619 | |
5620 | 5620 | // Everyone expects an array. |
5621 | 5621 | return array(); |
@@ -5727,7 +5727,7 @@ discard block |
||
5727 | 5727 | }); |
5728 | 5728 | |
5729 | 5729 | // Convert Punycode to Unicode |
5730 | - $tlds = array_map(function ($input) { |
|
5730 | + $tlds = array_map(function($input) { |
|
5731 | 5731 | $prefix = 'xn--'; |
5732 | 5732 | $safe_char = 0xFFFC; |
5733 | 5733 | $base = 36; |
@@ -5743,7 +5743,7 @@ discard block |
||
5743 | 5743 | |
5744 | 5744 | foreach ($enco_parts as $encoded) |
5745 | 5745 | { |
5746 | - if (strpos($encoded,$prefix) !== 0 || strlen(trim(str_replace($prefix,'',$encoded))) == 0) |
|
5746 | + if (strpos($encoded, $prefix) !== 0 || strlen(trim(str_replace($prefix, '', $encoded))) == 0) |
|
5747 | 5747 | { |
5748 | 5748 | $output_parts[] = $encoded; |
5749 | 5749 | continue; |
@@ -5754,7 +5754,7 @@ discard block |
||
5754 | 5754 | $idx = 0; |
5755 | 5755 | $char = 0x80; |
5756 | 5756 | $decoded = array(); |
5757 | - $output=''; |
|
5757 | + $output = ''; |
|
5758 | 5758 | $delim_pos = strrpos($encoded, '-'); |
5759 | 5759 | |
5760 | 5760 | if ($delim_pos > strlen($prefix)) |
@@ -5770,7 +5770,7 @@ discard block |
||
5770 | 5770 | |
5771 | 5771 | for ($enco_idx = $delim_pos ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) |
5772 | 5772 | { |
5773 | - for ($old_idx = $idx, $w = 1, $k = $base; 1 ; $k += $base) |
|
5773 | + for ($old_idx = $idx, $w = 1, $k = $base; 1; $k += $base) |
|
5774 | 5774 | { |
5775 | 5775 | $cp = ord($encoded{$enco_idx++}); |
5776 | 5776 | $digit = ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $base)); |
@@ -5811,15 +5811,15 @@ discard block |
||
5811 | 5811 | |
5812 | 5812 | // 2 bytes |
5813 | 5813 | elseif ($v < (1 << 11)) |
5814 | - $output .= chr(192+($v >> 6)) . chr(128+($v & 63)); |
|
5814 | + $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
5815 | 5815 | |
5816 | 5816 | // 3 bytes |
5817 | 5817 | elseif ($v < (1 << 16)) |
5818 | - $output .= chr(224+($v >> 12)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5818 | + $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5819 | 5819 | |
5820 | 5820 | // 4 bytes |
5821 | 5821 | elseif ($v < (1 << 21)) |
5822 | - $output .= chr(240+($v >> 18)) . chr(128+(($v >> 12) & 63)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5822 | + $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5823 | 5823 | |
5824 | 5824 | // 'Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k |
5825 | 5825 | else |
@@ -5924,7 +5924,7 @@ discard block |
||
5924 | 5924 | } |
5925 | 5925 | |
5926 | 5926 | // This recursive function creates the index array from the strings |
5927 | - $add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5927 | + $add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5928 | 5928 | { |
5929 | 5929 | static $depth = 0; |
5930 | 5930 | $depth++; |
@@ -5951,7 +5951,7 @@ discard block |
||
5951 | 5951 | }; |
5952 | 5952 | |
5953 | 5953 | // This recursive function turns the index array into a regular expression |
5954 | - $index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5954 | + $index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5955 | 5955 | { |
5956 | 5956 | static $depth = 0; |
5957 | 5957 | $depth++; |
@@ -5975,11 +5975,11 @@ discard block |
||
5975 | 5975 | |
5976 | 5976 | if (count(array_keys($value)) == 1) |
5977 | 5977 | { |
5978 | - $new_key_array = explode('(?'.'>', $sub_regex); |
|
5978 | + $new_key_array = explode('(?' . '>', $sub_regex); |
|
5979 | 5979 | $new_key .= $new_key_array[0]; |
5980 | 5980 | } |
5981 | 5981 | else |
5982 | - $sub_regex = '(?'.'>' . $sub_regex . ')'; |
|
5982 | + $sub_regex = '(?' . '>' . $sub_regex . ')'; |
|
5983 | 5983 | } |
5984 | 5984 | |
5985 | 5985 | if ($depth > 1) |
@@ -6022,10 +6022,10 @@ discard block |
||
6022 | 6022 | { |
6023 | 6023 | $regex = array(); |
6024 | 6024 | while (!empty($index)) |
6025 | - $regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
6025 | + $regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
6026 | 6026 | } |
6027 | 6027 | else |
6028 | - $regex = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
6028 | + $regex = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
6029 | 6029 | |
6030 | 6030 | // Restore PHP's internal character encoding to whatever it was originally |
6031 | 6031 | if (!empty($current_encoding)) |
@@ -899,13 +899,13 @@ |
||
899 | 899 | if ($start_char === 'C') |
900 | 900 | $limit_seek = $limit; |
901 | 901 | else |
902 | - $limit_seek = $limit + 1; |
|
902 | + $limit_seek = $limit + 1; |
|
903 | 903 | |
904 | 904 | $request = $smcFunc['db_query']('', ' |
905 | 905 | SELECT id_msg, id_member, approved |
906 | 906 | FROM {db_prefix}messages |
907 | 907 | WHERE id_topic = {int:current_topic} |
908 | - AND id_msg '. $page_operator . ' {int:page_id}'. (!$modSettings['postmod_active'] || $approve_posts ? '' : ' |
|
908 | + AND id_msg '. $page_operator . ' {int:page_id}' . (!$modSettings['postmod_active'] || $approve_posts ? '' : ' |
|
909 | 909 | AND (approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR id_member = {int:current_member}') . ')') . ' |
910 | 910 | ORDER BY id_msg ' . ($ascending_seek ? '' : 'DESC') . ($context['messages_per_page'] == -1 ? '' : ' |
911 | 911 | LIMIT {int:limit}'), |
@@ -23,21 +23,21 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return array The truncated array |
25 | 25 | */ |
26 | -function truncateArray($arr, $max_length=1900) |
|
26 | +function truncateArray($arr, $max_length = 1900) |
|
27 | 27 | { |
28 | 28 | $curr_length = 0; |
29 | 29 | foreach ($arr as $key => $value) |
30 | 30 | if (is_array($value)) |
31 | 31 | foreach ($value as $key2 => $value2) |
32 | - $curr_length += strlen ($value2); |
|
32 | + $curr_length += strlen($value2); |
|
33 | 33 | else |
34 | - $curr_length += strlen ($value); |
|
34 | + $curr_length += strlen($value); |
|
35 | 35 | if ($curr_length <= $max_length) |
36 | 36 | return $arr; |
37 | 37 | else |
38 | 38 | { |
39 | 39 | // Truncate each element's value to a reasonable length |
40 | - $param_max = floor($max_length/count($arr)); |
|
40 | + $param_max = floor($max_length / count($arr)); |
|
41 | 41 | foreach ($arr as $key => &$value) |
42 | 42 | if (is_array($value)) |
43 | 43 | foreach ($value as $key2 => &$value2) |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if (filemtime($cachedir . '/db_last_error.php') === $last_db_error_change) |
208 | 208 | { |
209 | 209 | // Write the change |
210 | - $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
210 | + $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
211 | 211 | $written_bytes = file_put_contents($cachedir . '/db_last_error.php', $write_db_change, LOCK_EX); |
212 | 212 | |
213 | 213 | // survey says ... |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | ', $txt['debug_language_files'], count($context['debug']['language_files']), ': <em>', implode('</em>, <em>', $context['debug']['language_files']), '</em>.<br> |
281 | 281 | ', $txt['debug_stylesheets'], count($context['debug']['sheets']), ': <em>', implode('</em>, <em>', $context['debug']['sheets']), '</em>.<br> |
282 | 282 | ', $txt['debug_hooks'], empty($context['debug']['hooks']) ? 0 : count($context['debug']['hooks']) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_hooks\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_hooks" style="display: none;"><em>' . implode('</em>, <em>', $context['debug']['hooks']), '</em></span>)', '<br> |
283 | - ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">'. $txt['debug_show'] .'</a><span id="debug_instances" style="display: none;"><em>'. implode('</em>, <em>', array_keys($context['debug']['instances'])) .'</em></span>)'. '<br>') : ''),' |
|
283 | + ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">' . $txt['debug_show'] . '</a><span id="debug_instances" style="display: none;"><em>' . implode('</em>, <em>', array_keys($context['debug']['instances'])) . '</em></span>)' . '<br>') : ''), ' |
|
284 | 284 | ', $txt['debug_files_included'], count($files), ' - ', round($total_size / 1024), $txt['debug_kb'], ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_include_info\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_include_info" style="display: none;"><em>', implode('</em>, <em>', $files), '</em></span>)<br>'; |
285 | 285 | |
286 | 286 | if (function_exists('memory_get_peak_usage')) |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | // INET. |
361 | 361 | elseif ($param_info['type'] == 'inet') |
362 | 362 | { |
363 | - if(count($search_params[$param_name]) === 1) |
|
363 | + if (count($search_params[$param_name]) === 1) |
|
364 | 364 | { |
365 | 365 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' = {inet:' . $param_name . '})'; |
366 | 366 | $where_params[$param_name] = $search_params[$param_name][0]; |
@@ -368,8 +368,8 @@ discard block |
||
368 | 368 | elseif (count($search_params[$param_name]) === 2) |
369 | 369 | { |
370 | 370 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' <= {inet:' . $param_name . '_high} and ' . $param_info['db_fields'][0] . ' >= {inet:' . $param_name . '_low})'; |
371 | - $where_params[$param_name.'_low'] = $search_params[$param_name]['low']; |
|
372 | - $where_params[$param_name.'_high'] = $search_params[$param_name]['high']; |
|
371 | + $where_params[$param_name . '_low'] = $search_params[$param_name]['low']; |
|
372 | + $where_params[$param_name . '_high'] = $search_params[$param_name]['high']; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | } |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | 'Jessica "Suki" González', |
593 | 593 | 'Karl "RegularExpression" Benson', |
594 | 594 | 'Matthew "Labradoodle-360" Kerle', |
595 | - $user_info['is_admin'] ? 'Matt "Grudge" Wolf': 'Grudge', |
|
595 | + $user_info['is_admin'] ? 'Matt "Grudge" Wolf' : 'Grudge', |
|
596 | 596 | 'Michael "Thantos" Miller', |
597 | 597 | 'Norv', |
598 | 598 | 'Peter "Arantor" Spicer', |
@@ -824,13 +824,13 @@ discard block |
||
824 | 824 | $credit_info = $smcFunc['json_decode']($row['credits'], true); |
825 | 825 | |
826 | 826 | $copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' © ' . $smcFunc['htmlspecialchars']($credit_info['copyright']); |
827 | - $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="'. $smcFunc['htmlspecialchars']($credit_info['licenseurl']) .'">'. $smcFunc['htmlspecialchars']($credit_info['license']) .'</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
827 | + $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="' . $smcFunc['htmlspecialchars']($credit_info['licenseurl']) . '">' . $smcFunc['htmlspecialchars']($credit_info['license']) . '</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
828 | 828 | $version = $txt['credits_version'] . ' ' . $row['version']; |
829 | 829 | $title = (empty($credit_info['title']) ? $row['name'] : $smcFunc['htmlspecialchars']($credit_info['title'])) . ': ' . $version; |
830 | 830 | |
831 | 831 | // build this one out and stash it away |
832 | 832 | $mod_name = empty($credit_info['url']) ? $title : '<a href="' . $credit_info['url'] . '">' . $title . '</a>'; |
833 | - $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
833 | + $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
834 | 834 | } |
835 | 835 | cache_put_data('mods_credits', $mods, 86400); |
836 | 836 | } |
@@ -236,7 +236,7 @@ |
||
236 | 236 | $header = 'POST /cgi-bin/webscr HTTP/1.1' . "\r\n"; |
237 | 237 | $header .= 'content-type: application/x-www-form-urlencoded' . "\r\n"; |
238 | 238 | $header .= 'Host: www.' . (!empty($modSettings['paidsubs_test']) ? 'sandbox.' : '') . 'paypal.com' . "\r\n"; |
239 | - $header .= 'content-length: ' . strlen ($requestString) . "\r\n"; |
|
239 | + $header .= 'content-length: ' . strlen($requestString) . "\r\n"; |
|
240 | 240 | $header .= 'connection: close' . "\r\n\r\n"; |
241 | 241 | |
242 | 242 | // Open the connection. |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | // Just send a generic message. |
77 | 77 | else |
78 | 78 | $this->setResponse(array( |
79 | - 'text' => $this->_sa == 'add' ? 'attach_error_title' : 'attached_file_deleted_error', |
|
79 | + 'text' => $this->_sa == 'add' ? 'attach_error_title' : 'attached_file_deleted_error', |
|
80 | 80 | 'type' => 'error', |
81 | 81 | 'data' => false, |
82 | 82 | )); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | // Gotta urlencode the filename. |
411 | 411 | if ($this->_attachResults) |
412 | 412 | foreach ($this->_attachResults as $k => $v) |
413 | - $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
413 | + $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
414 | 414 | |
415 | 415 | $this->_response = array( |
416 | 416 | 'files' => $this->_attachResults ? $this->_attachResults : false, |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | ob_start(); |
438 | 438 | |
439 | 439 | // Set the header. |
440 | - header('content-type: application/json; charset='. $context['character_set'] .''); |
|
440 | + header('content-type: application/json; charset=' . $context['character_set'] . ''); |
|
441 | 441 | |
442 | 442 | echo $smcFunc['json_encode']($this->_response ? $this->_response : array()); |
443 | 443 |
@@ -704,7 +704,7 @@ |
||
704 | 704 | $mail_result = false; |
705 | 705 | } |
706 | 706 | } |
707 | - catch(ErrorException $e) |
|
707 | + catch (ErrorException $e) |
|
708 | 708 | { |
709 | 709 | log_error($e->getMessage(), 'general', $e->getFile(), $e->getLine()); |
710 | 710 | log_error(sprintf($txt['mail_send_unable'], $to)); |