@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | 'class' => 'centercol', |
394 | 394 | ), |
395 | 395 | 'data' => array( |
396 | - 'function' => function ($rowData) |
|
396 | + 'function' => function($rowData) |
|
397 | 397 | { |
398 | 398 | return $rowData['selected'] ? '<span class="generic_icons valid"></span>' : ''; |
399 | 399 | }, |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | 'class' => 'centercol', |
454 | 454 | ), |
455 | 455 | 'data' => array( |
456 | - 'function' => function ($rowData) |
|
456 | + 'function' => function($rowData) |
|
457 | 457 | { |
458 | 458 | return $rowData['selected'] ? '' : sprintf('<input type="checkbox" name="smiley_set[%1$d]">', $rowData['id']); |
459 | 459 | }, |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | 'value' => $txt['smileys_location'], |
998 | 998 | ), |
999 | 999 | 'data' => array( |
1000 | - 'function' => function ($rowData) use ($txt) |
|
1000 | + 'function' => function($rowData) use ($txt) |
|
1001 | 1001 | { |
1002 | 1002 | if (empty($rowData['hidden'])) |
1003 | 1003 | return $txt['smileys_location_form']; |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | }, |
1009 | 1009 | ), |
1010 | 1010 | 'sort' => array( |
1011 | - 'default' => $smcFunc['db_custom_order']('hidden', array_keys($smiley_locations)) , |
|
1011 | + 'default' => $smcFunc['db_custom_order']('hidden', array_keys($smiley_locations)), |
|
1012 | 1012 | 'reverse' => $smcFunc['db_custom_order']('hidden', array_keys($smiley_locations), true), |
1013 | 1013 | ), |
1014 | 1014 | ), |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | 'value' => $txt['smileys_description'], |
1018 | 1018 | ), |
1019 | 1019 | 'data' => array( |
1020 | - 'function' => function ($rowData) use ($context, $txt, $modSettings, $smcFunc) |
|
1020 | + 'function' => function($rowData) use ($context, $txt, $modSettings, $smcFunc) |
|
1021 | 1021 | { |
1022 | 1022 | if (empty($modSettings['smileys_dir']) || !is_dir($modSettings['smileys_dir'])) |
1023 | 1023 | return $smcFunc['htmlspecialchars']($rowData['description']); |
@@ -1554,7 +1554,7 @@ discard block |
||
1554 | 1554 | 'action' => $smcFunc['htmlspecialchars'](strtr($action['destination'], array($boarddir => '.'))) |
1555 | 1555 | ); |
1556 | 1556 | |
1557 | - $file = $packagesdir . '/temp/' . $base_path . $action['filename']; |
|
1557 | + $file = $packagesdir . '/temp/' . $base_path . $action['filename']; |
|
1558 | 1558 | if (isset($action['filename']) && (!file_exists($file) || !is_writable(dirname($action['destination'])))) |
1559 | 1559 | { |
1560 | 1560 | $context['has_failure'] = true; |
@@ -1599,7 +1599,7 @@ discard block |
||
1599 | 1599 | { |
1600 | 1600 | updateSettings(array( |
1601 | 1601 | 'smiley_sets_known' => $modSettings['smiley_sets_known'] . ',' . basename($action['action']), |
1602 | - 'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . $smileyInfo['name'] . (count($context['actions']) > 1 ? ' ' . (!empty($action['description']) ? $smcFunc['htmlspecialchars']($action['description']) : basename($action['action'])) : ''), |
|
1602 | + 'smiley_sets_names' => $modSettings['smiley_sets_names'] . "\n" . $smileyInfo['name'] . (count($context['actions']) > 1 ? ' ' . (!empty($action['description']) ? $smcFunc['htmlspecialchars']($action['description']) : basename($action['action'])) : ''), |
|
1603 | 1603 | )); |
1604 | 1604 | } |
1605 | 1605 | |
@@ -1611,7 +1611,7 @@ discard block |
||
1611 | 1611 | '{db_prefix}log_packages', |
1612 | 1612 | array( |
1613 | 1613 | 'filename' => 'string', 'name' => 'string', 'package_id' => 'string', 'version' => 'string', |
1614 | - 'id_member_installed' => 'int', 'member_installed' => 'string','time_installed' => 'int', |
|
1614 | + 'id_member_installed' => 'int', 'member_installed' => 'string', 'time_installed' => 'int', |
|
1615 | 1615 | 'install_state' => 'int', 'failed_steps' => 'string', 'themes_installed' => 'string', |
1616 | 1616 | 'member_removed' => 'int', 'db_changes' => 'string', 'credits' => 'string', |
1617 | 1617 | ), |
@@ -1860,7 +1860,7 @@ discard block |
||
1860 | 1860 | 'columns' => array( |
1861 | 1861 | 'icon' => array( |
1862 | 1862 | 'data' => array( |
1863 | - 'function' => function ($rowData) use ($settings, $smcFunc) |
|
1863 | + 'function' => function($rowData) use ($settings, $smcFunc) |
|
1864 | 1864 | { |
1865 | 1865 | $images_url = $settings[file_exists(sprintf('%1$s/images/post/%2$s.png', $settings['theme_dir'], $rowData['filename'])) ? 'actual_images_url' : 'default_images_url']; |
1866 | 1866 | return sprintf('<img src="%1$s/post/%2$s.png" alt="%3$s">', $images_url, $rowData['filename'], $smcFunc['htmlspecialchars']($rowData['title'])); |
@@ -1894,7 +1894,7 @@ discard block |
||
1894 | 1894 | 'value' => $txt['icons_board'], |
1895 | 1895 | ), |
1896 | 1896 | 'data' => array( |
1897 | - 'function' => function ($rowData) use ($txt) |
|
1897 | + 'function' => function($rowData) use ($txt) |
|
1898 | 1898 | { |
1899 | 1899 | return empty($rowData['board_name']) ? $txt['icons_edit_icons_all_boards'] : $rowData['board_name']; |
1900 | 1900 | }, |
@@ -5495,7 +5495,6 @@ discard block |
||
5495 | 5495 | |
5496 | 5496 | /** |
5497 | 5497 | * Tries different modes to make file/dirs writable. Wrapper function for chmod() |
5498 | - |
|
5499 | 5498 | * @param string $file The file/dir full path. |
5500 | 5499 | * @param int $value Not needed, added for legacy reasons. |
5501 | 5500 | * @return boolean true if the file/dir is already writable or the function was able to make it writable, false if the function couldn't make the file/dir writable. |
@@ -5535,7 +5534,6 @@ discard block |
||
5535 | 5534 | |
5536 | 5535 | /** |
5537 | 5536 | * Wrapper function for json_decode() with error handling. |
5538 | - |
|
5539 | 5537 | * @param string $json The string to decode. |
5540 | 5538 | * @param bool $returnAsArray To return the decoded string as an array or an object, SMF only uses Arrays but to keep on compatibility with json_decode its set to false as default. |
5541 | 5539 | * @param bool $logIt To specify if the error will be logged if theres any. |
@@ -6029,7 +6027,7 @@ discard block |
||
6029 | 6027 | $params = stream_context_get_params($stream); |
6030 | 6028 | $result = isset($params["options"]["ssl"]["peer_certificate"]) ? true : false; |
6031 | 6029 | } |
6032 | - return $result; |
|
6030 | + return $result; |
|
6033 | 6031 | } |
6034 | 6032 | |
6035 | 6033 | /** |
@@ -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); |
@@ -302,7 +302,6 @@ discard block |
||
302 | 302 | $condition = 'id_member IN ({array_int:members})'; |
303 | 303 | $parameters['members'] = $members; |
304 | 304 | } |
305 | - |
|
306 | 305 | elseif ($members === null) |
307 | 306 | $condition = '1=1'; |
308 | 307 | |
@@ -1739,7 +1738,7 @@ discard block |
||
1739 | 1738 | 'before' => '<span style="text-shadow: $1 $2">', |
1740 | 1739 | 'after' => '</span>', |
1741 | 1740 | 'validate' => function(&$tag, &$data, $disabled) |
1742 | - { |
|
1741 | + { |
|
1743 | 1742 | |
1744 | 1743 | if ($data[1] == 'top' || (is_numeric($data[1]) && $data[1] < 50)) |
1745 | 1744 | $data[1] = '0 -2px 1px'; |
@@ -1901,7 +1900,8 @@ discard block |
||
1901 | 1900 | { |
1902 | 1901 | if (isset($temp_bbc)) |
1903 | 1902 | $bbc_codes = $temp_bbc; |
1904 | - usort($codes, function ($a, $b) { |
|
1903 | + usort($codes, function ($a, $b) |
|
1904 | + { |
|
1905 | 1905 | return strcmp($a['tag'], $b['tag']); |
1906 | 1906 | }); |
1907 | 1907 | return $codes; |
@@ -2185,7 +2185,8 @@ 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 | 2190 | $url = array_shift($matches); |
2190 | 2191 | |
2191 | 2192 | // If this isn't a clean URL, bail out |
@@ -2274,7 +2275,9 @@ discard block |
||
2274 | 2275 | $look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2)); |
2275 | 2276 | |
2276 | 2277 | // 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))) |
|
2278 | + if (!in_array($look_for, array_map(function($code) |
|
2279 | + { |
|
2280 | +return $code['tag'];}, $open_tags))) |
|
2278 | 2281 | continue; |
2279 | 2282 | |
2280 | 2283 | $to_close = array(); |
@@ -3759,7 +3762,6 @@ discard block |
||
3759 | 3762 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
3760 | 3763 | $minSeed = $js_file['options']['seed']; |
3761 | 3764 | } |
3762 | - |
|
3763 | 3765 | else |
3764 | 3766 | echo ' |
3765 | 3767 | <script src="', $js_file['fileUrl'], '"', !empty($js_file['options']['async']) ? ' async' : '', !empty($js_file['options']['defer']) ? ' defer' : '', '></script>'; |
@@ -3909,7 +3911,9 @@ discard block |
||
3909 | 3911 | return $data; |
3910 | 3912 | |
3911 | 3913 | // Different pages include different files, so we use a hash to label the different combinations |
3912 | - $hash = md5(implode(' ', array_map(function($file) { return $file['filePath'] . (int) @filesize($file['filePath']) . (int) @filemtime($file['filePath']); }, $data))); |
|
3914 | + $hash = md5(implode(' ', array_map(function($file) |
|
3915 | + { |
|
3916 | +return $file['filePath'] . (int) @filesize($file['filePath']) . (int) @filemtime($file['filePath']); }, $data))); |
|
3913 | 3917 | |
3914 | 3918 | // Did we already do this? |
3915 | 3919 | list($toCache, $async, $defer) = array_pad((array) cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type . '_' . $hash, 86400), 3, null); |
@@ -5914,7 +5918,6 @@ discard block |
||
5914 | 5918 | $isWritable = true; |
5915 | 5919 | break; |
5916 | 5920 | } |
5917 | - |
|
5918 | 5921 | else |
5919 | 5922 | @chmod($file, $val); |
5920 | 5923 | } |
@@ -6084,7 +6087,8 @@ discard block |
||
6084 | 6087 | if (!empty($tlds)) |
6085 | 6088 | { |
6086 | 6089 | // Clean $tlds and convert it to an array |
6087 | - $tlds = array_filter(explode("\n", strtolower($tlds)), function($line) { |
|
6090 | + $tlds = array_filter(explode("\n", strtolower($tlds)), function($line) |
|
6091 | + { |
|
6088 | 6092 | $line = trim($line); |
6089 | 6093 | if (empty($line) || strpos($line, '#') !== false || strpos($line, ' ') !== false) |
6090 | 6094 | return false; |
@@ -6095,7 +6099,9 @@ discard block |
||
6095 | 6099 | // Convert Punycode to Unicode |
6096 | 6100 | require_once($sourcedir . '/Class-Punycode.php'); |
6097 | 6101 | $Punycode = new Punycode(); |
6098 | - $tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds); |
|
6102 | + $tlds = array_map(function ($input) use ($Punycode) |
|
6103 | + { |
|
6104 | +return $Punycode->decode($input); }, $tlds); |
|
6099 | 6105 | } |
6100 | 6106 | // Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update |
6101 | 6107 | else |
@@ -6262,7 +6268,8 @@ discard block |
||
6262 | 6268 | } |
6263 | 6269 | |
6264 | 6270 | // Sort by key length and then alphabetically |
6265 | - uksort($regex, function($k1, $k2) use (&$strlen) { |
|
6271 | + uksort($regex, function($k1, $k2) use (&$strlen) |
|
6272 | + { |
|
6266 | 6273 | $l1 = $strlen($k1); |
6267 | 6274 | $l2 = $strlen($k2); |
6268 | 6275 | |
@@ -6516,7 +6523,8 @@ discard block |
||
6516 | 6523 | function sanitize_iri($iri) |
6517 | 6524 | { |
6518 | 6525 | // 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) { |
|
6526 | + $iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) |
|
6527 | + { |
|
6520 | 6528 | return rawurlencode($matches[0]); |
6521 | 6529 | }, $iri); |
6522 | 6530 |
@@ -2932,7 +2932,7 @@ |
||
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']; |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function cleanCache($type = '') |
110 | 110 | { |
111 | - if($type == 'expired') |
|
112 | - $query = 'DELETE FROM cache WHERE ttl >= ' . time().';'; |
|
111 | + if ($type == 'expired') |
|
112 | + $query = 'DELETE FROM cache WHERE ttl >= ' . time() . ';'; |
|
113 | 113 | else |
114 | 114 | $query = 'DELETE FROM cache;'; |
115 | 115 | |
116 | 116 | $result = $this->cacheDB->exec($query); |
117 | 117 | |
118 | - $query = 'VACUUM;'; |
|
118 | + $query = 'VACUUM;'; |
|
119 | 119 | $this->cacheDB->exec($query); |
120 | 120 | |
121 | 121 | return $result; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | // If its invalid, use SMF's. |
158 | 158 | if (is_null($dir) || !is_writable($dir)) |
159 | - if(is_null($cachedir_sqlite) || !is_writable($cachedir_sqlite)) |
|
159 | + if (is_null($cachedir_sqlite) || !is_writable($cachedir_sqlite)) |
|
160 | 160 | $this->cachedir = $cachedir; |
161 | 161 | else |
162 | 162 | $this->cachedir = $cachedir_sqlite; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | { |
166 | 166 | global $db_connection, $db_prefix; |
167 | 167 | |
168 | - pg_query($db_connection, 'CREATE LOCAL TEMP TABLE IF NOT EXISTS ' . $db_prefix . 'cache_tmp AS SELECT * FROM ' . $db_prefix . 'cache WHERE ttl >= ' . time() ); |
|
168 | + pg_query($db_connection, 'CREATE LOCAL TEMP TABLE IF NOT EXISTS ' . $db_prefix . 'cache_tmp AS SELECT * FROM ' . $db_prefix . 'cache WHERE ttl >= ' . time()); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | { |
190 | 190 | global $db_connection, $db_prefix; |
191 | 191 | |
192 | - pg_query($db_connection, 'INSERT INTO ' . $db_prefix . 'cache SELECT * FROM '. $db_prefix . 'cache_tmp ON CONFLICT DO NOTHING'); |
|
192 | + pg_query($db_connection, 'INSERT INTO ' . $db_prefix . 'cache SELECT * FROM ' . $db_prefix . 'cache_tmp ON CONFLICT DO NOTHING'); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 |
@@ -199,22 +199,22 @@ discard block |
||
199 | 199 | |
200 | 200 | case 'date': |
201 | 201 | if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d)$~', $replacement, $date_matches) === 1) |
202 | - return sprintf('\'%04d-%02d-%02d\'', $date_matches[1], $date_matches[2], $date_matches[3]).'::date'; |
|
202 | + return sprintf('\'%04d-%02d-%02d\'', $date_matches[1], $date_matches[2], $date_matches[3]) . '::date'; |
|
203 | 203 | else |
204 | 204 | smf_db_error_backtrace('Wrong value type sent to the database. Date expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
205 | 205 | break; |
206 | 206 | |
207 | 207 | case 'time': |
208 | 208 | if (preg_match('~^([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $time_matches) === 1) |
209 | - return sprintf('\'%02d:%02d:%02d\'', $time_matches[1], $time_matches[2], $time_matches[3]).'::time'; |
|
209 | + return sprintf('\'%02d:%02d:%02d\'', $time_matches[1], $time_matches[2], $time_matches[3]) . '::time'; |
|
210 | 210 | else |
211 | 211 | smf_db_error_backtrace('Wrong value type sent to the database. Time expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
212 | 212 | break; |
213 | 213 | |
214 | 214 | case 'datetime': |
215 | 215 | if (preg_match('~^(\d{4})-([0-1]?\d)-([0-3]?\d) ([0-1]?\d|2[0-3]):([0-5]\d):([0-5]\d)$~', $replacement, $datetime_matches) === 1) |
216 | - return 'to_timestamp('. |
|
217 | - sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5] ,$datetime_matches[6]). |
|
216 | + return 'to_timestamp(' . |
|
217 | + sprintf('\'%04d-%02d-%02d %02d:%02d:%02d\'', $datetime_matches[1], $datetime_matches[2], $datetime_matches[3], $datetime_matches[4], $datetime_matches[5], $datetime_matches[6]) . |
|
218 | 218 | ',\'YYYY-MM-DD HH24:MI:SS\')'; |
219 | 219 | else |
220 | 220 | smf_db_error_backtrace('Wrong value type sent to the database. Datetime expected. (' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $old_pos = 0; |
425 | 425 | $pos = -1; |
426 | 426 | // Remove the string escape for better runtime |
427 | - $db_string_1 = str_replace('\'\'','',$db_string); |
|
427 | + $db_string_1 = str_replace('\'\'', '', $db_string); |
|
428 | 428 | while (true) |
429 | 429 | { |
430 | 430 | $pos = strpos($db_string_1, '\'', $pos + 1); |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | if (!empty($keys) && (count($keys) > 0) && $returnmode > 0) |
803 | 803 | { |
804 | 804 | // we only take the first key |
805 | - $returning = ' RETURNING '.$keys[0]; |
|
805 | + $returning = ' RETURNING ' . $keys[0]; |
|
806 | 806 | $with_returning = true; |
807 | 807 | } |
808 | 808 | |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | INSERT INTO ' . $table . '("' . implode('", "', $indexed_columns) . '") |
834 | 834 | VALUES |
835 | 835 | ' . implode(', |
836 | - ', $insertRows).$replace.$returning, |
|
836 | + ', $insertRows) . $replace . $returning, |
|
837 | 837 | array( |
838 | 838 | 'security_override' => true, |
839 | 839 | 'db_error_skip' => $method == 'ignore' || $table === $db_prefix . 'log_errors', |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | if ($returnmode === 2) |
847 | 847 | $return_var = array(); |
848 | 848 | |
849 | - while(($row = $smcFunc['db_fetch_row']($request)) && $with_returning) |
|
849 | + while (($row = $smcFunc['db_fetch_row']($request)) && $with_returning) |
|
850 | 850 | { |
851 | 851 | if (is_numeric($row[0])) // try to emulate mysql limitation |
852 | 852 | { |
@@ -1009,7 +1009,7 @@ discard block |
||
1009 | 1009 | */ |
1010 | 1010 | function smf_db_custom_order($field, $array_values, $desc = false) |
1011 | 1011 | { |
1012 | - $return = 'CASE '. $field . ' '; |
|
1012 | + $return = 'CASE ' . $field . ' '; |
|
1013 | 1013 | $count = count($array_values); |
1014 | 1014 | $then = ($desc ? ' THEN -' : ' THEN '); |
1015 | 1015 |
@@ -722,12 +722,12 @@ |
||
722 | 722 | $where = ''; |
723 | 723 | $count_pk = 0; |
724 | 724 | |
725 | - If ($replace_support) |
|
725 | + if ($replace_support) |
|
726 | 726 | { |
727 | 727 | foreach ($columns as $columnName => $type) |
728 | 728 | { |
729 | 729 | //check pk fiel |
730 | - IF (in_array($columnName, $keys)) |
|
730 | + if (in_array($columnName, $keys)) |
|
731 | 731 | { |
732 | 732 | $key_str .= ($count_pk > 0 ? ',' : ''); |
733 | 733 | $key_str .= $columnName; |
@@ -1697,8 +1697,7 @@ discard block |
||
1697 | 1697 | updateStats('topic'); |
1698 | 1698 | |
1699 | 1699 | // This function is needed to do the updateStats('subject') call. |
1700 | - $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : |
|
1701 | - function($string){ |
|
1700 | + $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string) { |
|
1702 | 1701 | global $sourcedir; |
1703 | 1702 | if (function_exists('mb_strtolower')) |
1704 | 1703 | return mb_strtolower($string, 'UTF-8'); |
@@ -1767,7 +1766,7 @@ discard block |
||
1767 | 1766 | if (trim($settingsArray[$i]) == 'if (file_exists(dirname(__FILE__) . \'/install.php\'))' && trim($settingsArray[$i + 1]) == '{' && trim($settingsArray[$i + 9]) == '}') |
1768 | 1767 | { |
1769 | 1768 | // Set the ten lines to nothing. |
1770 | - for ($j=0; $j < 10; $j++) |
|
1769 | + for ($j = 0; $j < 10; $j++) |
|
1771 | 1770 | $settingsArray[$i++] = ''; |
1772 | 1771 | |
1773 | 1772 | continue; |
@@ -36,7 +36,8 @@ discard block |
||
36 | 36 | 'default_password' => 'mysql.default_password', |
37 | 37 | 'default_host' => 'mysql.default_host', |
38 | 38 | 'default_port' => 'mysql.default_port', |
39 | - 'utf8_support' => function() { |
|
39 | + 'utf8_support' => function() |
|
40 | + { |
|
40 | 41 | return true; |
41 | 42 | }, |
42 | 43 | 'utf8_version' => '5.0.22', |
@@ -44,7 +45,8 @@ discard block |
||
44 | 45 | 'utf8_default' => true, |
45 | 46 | 'utf8_required' => true, |
46 | 47 | 'alter_support' => true, |
47 | - 'validate_prefix' => function(&$value) { |
|
48 | + 'validate_prefix' => function(&$value) |
|
49 | + { |
|
48 | 50 | $value = preg_replace('~[^A-Za-z0-9_\$]~', '', $value); |
49 | 51 | return true; |
50 | 52 | }, |
@@ -58,7 +60,8 @@ discard block |
||
58 | 60 | 'always_has_db' => true, |
59 | 61 | 'utf8_default' => true, |
60 | 62 | 'utf8_required' => true, |
61 | - 'utf8_support' => function() { |
|
63 | + 'utf8_support' => function() |
|
64 | + { |
|
62 | 65 | $request = pg_query('SHOW SERVER_ENCODING'); |
63 | 66 | |
64 | 67 | list ($charcode) = pg_fetch_row($request); |
@@ -70,7 +73,8 @@ discard block |
||
70 | 73 | }, |
71 | 74 | 'utf8_version' => '8.0', |
72 | 75 | 'utf8_version_check' => '$request = pg_query(\'SELECT version()\'); list ($version) = pg_fetch_row($request); list($pgl, $version) = explode(" ", $version); return $version;', |
73 | - 'validate_prefix' => function(&$value) { |
|
76 | + 'validate_prefix' => function(&$value) |
|
77 | + { |
|
74 | 78 | global $txt; |
75 | 79 | |
76 | 80 | $value = preg_replace('~[^A-Za-z0-9_\$]~', '', $value); |
@@ -963,13 +967,15 @@ discard block |
||
963 | 967 | |
964 | 968 | // If redirect in effect, force ssl ON |
965 | 969 | require_once(dirname(__FILE__) . '/Sources/Subs.php'); |
966 | - if (https_redirect_active($incontext['detected_url'])) { |
|
970 | + if (https_redirect_active($incontext['detected_url'])) |
|
971 | + { |
|
967 | 972 | $incontext['ssl_chkbx_protected'] = true; |
968 | 973 | $incontext['ssl_chkbx_checked'] = true; |
969 | 974 | $_POST['force_ssl'] = true; |
970 | 975 | } |
971 | 976 | // If no cert, make sure ssl stays OFF |
972 | - if (!ssl_cert_found($incontext['detected_url'])) { |
|
977 | + if (!ssl_cert_found($incontext['detected_url'])) |
|
978 | + { |
|
973 | 979 | $incontext['ssl_chkbx_protected'] = true; |
974 | 980 | $incontext['ssl_chkbx_checked'] = false; |
975 | 981 | } |
@@ -1438,7 +1444,8 @@ discard block |
||
1438 | 1444 | reloadSettings(); |
1439 | 1445 | |
1440 | 1446 | // We need this to properly hash the password for Admin |
1441 | - $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string) { |
|
1447 | + $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : function($string) |
|
1448 | + { |
|
1442 | 1449 | global $sourcedir; |
1443 | 1450 | if (function_exists('mb_strtolower')) |
1444 | 1451 | return mb_strtolower($string, 'UTF-8'); |
@@ -1696,7 +1703,8 @@ discard block |
||
1696 | 1703 | |
1697 | 1704 | // This function is needed to do the updateStats('subject') call. |
1698 | 1705 | $smcFunc['strtolower'] = $db_character_set != 'utf8' && $txt['lang_character_set'] != 'UTF-8' ? 'strtolower' : |
1699 | - function($string){ |
|
1706 | + function($string) |
|
1707 | + { |
|
1700 | 1708 | global $sourcedir; |
1701 | 1709 | if (function_exists('mb_strtolower')) |
1702 | 1710 | return mb_strtolower($string, 'UTF-8'); |
@@ -300,7 +300,7 @@ |
||
300 | 300 | echo ' |
301 | 301 | <div class="g-recaptcha centertext" data-sitekey="' . $verify_context['recaptcha_site_key'] . '" data-theme="' . $verify_context['recaptcha_theme'] . '"></div> |
302 | 302 | <br> |
303 | - <script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl='.$lang.'"></script>'; |
|
303 | + <script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl='.$lang . '"></script>'; |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | else |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | { |
127 | 127 | $smcFunc['db_transaction']('begin'); |
128 | 128 | $db_trans = true; |
129 | - $smcFunc['db_drop_table']($table_name.'_old'); |
|
130 | - $smcFunc['db_query']('',' |
|
131 | - RENAME TABLE '. $table_name .' TO ' . $table_name . '_old', |
|
129 | + $smcFunc['db_drop_table']($table_name . '_old'); |
|
130 | + $smcFunc['db_query']('', ' |
|
131 | + RENAME TABLE '. $table_name . ' TO ' . $table_name . '_old', |
|
132 | 132 | array( |
133 | 133 | 'security_override' => true, |
134 | 134 | ) |
@@ -202,15 +202,15 @@ discard block |
||
202 | 202 | { |
203 | 203 | $same_col = array(); |
204 | 204 | |
205 | - $request = $smcFunc['db_query']('',' |
|
205 | + $request = $smcFunc['db_query']('', ' |
|
206 | 206 | SELECT count(*), column_name |
207 | 207 | FROM information_schema.columns |
208 | 208 | WHERE table_name in ({string:table1},{string:table2}) AND table_schema = {string:schema} |
209 | 209 | GROUP BY column_name |
210 | 210 | HAVING count(*) > 1', |
211 | - array ( |
|
211 | + array( |
|
212 | 212 | 'table1' => $table_name, |
213 | - 'table2' => $table_name.'_old', |
|
213 | + 'table2' => $table_name . '_old', |
|
214 | 214 | 'schema' => $db_name, |
215 | 215 | ) |
216 | 216 | ); |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | $same_col[] = $row['column_name']; |
221 | 221 | } |
222 | 222 | |
223 | - $smcFunc['db_query']('',' |
|
224 | - INSERT INTO ' . $table_name .'(' |
|
223 | + $smcFunc['db_query']('', ' |
|
224 | + INSERT INTO ' . $table_name . '(' |
|
225 | 225 | . implode($same_col, ',') . |
226 | 226 | ') |
227 | 227 | SELECT '. implode($same_col, ',') . ' |
@@ -104,7 +104,7 @@ |
||
104 | 104 | * |
105 | 105 | * @param string $class The fully-qualified class name. |
106 | 106 | */ |
107 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
107 | +spl_autoload_register(function($class) use ($sourcedir) |
|
108 | 108 | { |
109 | 109 | $classMap = array( |
110 | 110 | 'ReCaptcha\\' => 'ReCaptcha/', |