@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | // INET. |
| 356 | 356 | elseif ($param_info['type'] == 'inet') |
| 357 | 357 | { |
| 358 | - if(count($search_params[$param_name]) === 1) |
|
| 358 | + if (count($search_params[$param_name]) === 1) |
|
| 359 | 359 | { |
| 360 | 360 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' = {inet:' . $param_name . '})'; |
| 361 | 361 | $where_params[$param_name] = $search_params[$param_name][0]; |
@@ -363,8 +363,8 @@ discard block |
||
| 363 | 363 | elseif (count($search_params[$param_name]) === 2) |
| 364 | 364 | { |
| 365 | 365 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' <= {inet:' . $param_name . '_high} and ' . $param_info['db_fields'][0] . ' >= {inet:' . $param_name . '_low})'; |
| 366 | - $where_params[$param_name.'_low'] = $search_params[$param_name]['low']; |
|
| 367 | - $where_params[$param_name.'_high'] = $search_params[$param_name]['high']; |
|
| 366 | + $where_params[$param_name . '_low'] = $search_params[$param_name]['low']; |
|
| 367 | + $where_params[$param_name . '_high'] = $search_params[$param_name]['high']; |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | } |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | if (!empty($context['show_filter']) && !empty($context['available_filters'])) |
| 1013 | 1013 | $listOptions['additional_rows'][] = array( |
| 1014 | 1014 | 'position' => 'above_column_headers', |
| 1015 | - 'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_'.$context['current_filter']])) ? $txt['admin_browse_filter_type_'.$context['current_filter']] : $context['available_filters'][0]['desc']), |
|
| 1015 | + 'value' => '<strong>' . $txt['admin_browse_filter_show'] . ':</strong> ' . ((isset($context['current_filter']) && isset($txt['admin_browse_filter_type_' . $context['current_filter']])) ? $txt['admin_browse_filter_type_' . $context['current_filter']] : $context['available_filters'][0]['desc']), |
|
| 1016 | 1016 | 'class' => 'filter_row generic_list_wrapper smalltext', |
| 1017 | 1017 | ); |
| 1018 | 1018 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $smcFunc['db_free_result']($result_boards); |
| 136 | 136 | |
| 137 | 137 | // Run through the categories and boards (or only boards).... |
| 138 | - for (reset($row_boards); key($row_boards)!==null; next($row_boards)) |
|
| 138 | + for (reset($row_boards); key($row_boards) !== null; next($row_boards)) |
|
| 139 | 139 | { |
| 140 | 140 | $row_board = current($row_boards); |
| 141 | 141 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $row_boards[$row_board['id_parent']]['id_msg'] = $row_board['id_msg']; |
| 304 | 304 | $row_boards[$row_board['id_parent']]['subject'] = $row_board['subject']; |
| 305 | 305 | $row_boards[$row_board['id_parent']]['poster_time'] = $row_board['poster_time']; |
| 306 | - $row_boards[$row_board['id_parent']]['short_subject'] = (!empty($row_board['short_subject']) ? $row_board['short_subject'] : '') ; |
|
| 306 | + $row_boards[$row_board['id_parent']]['short_subject'] = (!empty($row_board['short_subject']) ? $row_board['short_subject'] : ''); |
|
| 307 | 307 | $row_boards[$row_board['id_parent']]['poster_name'] = $row_board['poster_name']; |
| 308 | 308 | $row_boards[$row_board['id_parent']]['real_name'] = $row_board['real_name']; |
| 309 | 309 | $row_boards[$row_board['id_parent']]['id_member'] = $row_board['id_member']; |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | |
| 369 | 369 | // Set the last post in the root board |
| 370 | 370 | if (!$isChild && !empty($row_board['poster_time']) |
| 371 | - && ( empty($this_category[$row_board['id_board']]['last_post']['timestamp']) |
|
| 371 | + && (empty($this_category[$row_board['id_board']]['last_post']['timestamp']) |
|
| 372 | 372 | || $this_category[$row_board['id_board']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time']) |
| 373 | 373 | ) |
| 374 | 374 | ) |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | if ($boardIndexOptions['include_categories']) |
| 399 | 399 | foreach ($categories as &$category) |
| 400 | 400 | { |
| 401 | - foreach ($category['boards'] as &$board ) |
|
| 401 | + foreach ($category['boards'] as &$board) |
|
| 402 | 402 | { |
| 403 | 403 | if (!empty($moderators[$board['id']])) |
| 404 | 404 | { |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | else |
| 423 | - foreach ($this_category as &$board ) |
|
| 423 | + foreach ($this_category as &$board) |
|
| 424 | 424 | { |
| 425 | 425 | if (!empty($moderators[$board['id']])) |
| 426 | 426 | { |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | $board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']); |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - unset($category,$board); |
|
| 444 | + unset($category, $board); |
|
| 445 | 445 | |
| 446 | 446 | if ($boardIndexOptions['include_categories']) |
| 447 | 447 | sortCategories($categories); |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | $fields = ''; |
| 460 | 460 | foreach ($context['print_custom_fields']['below_signature'] as $field) |
| 461 | 461 | if (!empty($field['output_html'])) |
| 462 | - $fields .= ' |
|
| 462 | + $fields .= ' |
|
| 463 | 463 | <li>' . $field['output_html'] . '</li>'; |
| 464 | 464 | |
| 465 | 465 | if (!empty($fields)) |
@@ -3167,7 +3167,7 @@ discard block |
||
| 3167 | 3167 | <div class="floatright tfa_qrcode"> |
| 3168 | 3168 | <div id="qrcode"></div> |
| 3169 | 3169 | <script type="text/javascript"> |
| 3170 | - new QRCode(document.getElementById("qrcode"), "' , $context['tfa_qr_url'],'"); |
|
| 3170 | + new QRCode(document.getElementById("qrcode"), "' , $context['tfa_qr_url'], '"); |
|
| 3171 | 3171 | </script> |
| 3172 | 3172 | </div>'; |
| 3173 | 3173 | |
@@ -371,7 +371,7 @@ |
||
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | return (string) substr( |
| 374 | - (string )$binary_string, |
|
| 374 | + (string) $binary_string, |
|
| 375 | 375 | (int) $start, |
| 376 | 376 | (int) $length |
| 377 | 377 | ); |
@@ -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' |
@@ -3953,7 +3953,7 @@ discard block |
||
| 3953 | 3953 | } |
| 3954 | 3954 | |
| 3955 | 3955 | // No namespaces, sorry! |
| 3956 | - $classType = 'MatthiasMullie\\Minify\\'. strtoupper($type); |
|
| 3956 | + $classType = 'MatthiasMullie\\Minify\\' . strtoupper($type); |
|
| 3957 | 3957 | |
| 3958 | 3958 | $minifier = new $classType(); |
| 3959 | 3959 | |
@@ -4101,7 +4101,7 @@ discard block |
||
| 4101 | 4101 | else |
| 4102 | 4102 | $path = $modSettings['attachmentUploadDir']; |
| 4103 | 4103 | |
| 4104 | - return $path . '/' . $attachment_id . '_' . $file_hash .'.dat'; |
|
| 4104 | + return $path . '/' . $attachment_id . '_' . $file_hash . '.dat'; |
|
| 4105 | 4105 | } |
| 4106 | 4106 | |
| 4107 | 4107 | /** |
@@ -4145,10 +4145,10 @@ discard block |
||
| 4145 | 4145 | $valid_low = isValidIP($ip_parts[0]); |
| 4146 | 4146 | $valid_high = isValidIP($ip_parts[1]); |
| 4147 | 4147 | $count = 0; |
| 4148 | - $mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.'); |
|
| 4148 | + $mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.'); |
|
| 4149 | 4149 | $max = ($mode == ':' ? 'ffff' : '255'); |
| 4150 | 4150 | $min = 0; |
| 4151 | - if(!$valid_low) |
|
| 4151 | + if (!$valid_low) |
|
| 4152 | 4152 | { |
| 4153 | 4153 | $ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]); |
| 4154 | 4154 | $valid_low = isValidIP($ip_parts[0]); |
@@ -4162,7 +4162,7 @@ discard block |
||
| 4162 | 4162 | } |
| 4163 | 4163 | |
| 4164 | 4164 | $count = 0; |
| 4165 | - if(!$valid_high) |
|
| 4165 | + if (!$valid_high) |
|
| 4166 | 4166 | { |
| 4167 | 4167 | $ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]); |
| 4168 | 4168 | $valid_high = isValidIP($ip_parts[1]); |
@@ -4175,7 +4175,7 @@ discard block |
||
| 4175 | 4175 | } |
| 4176 | 4176 | } |
| 4177 | 4177 | |
| 4178 | - if($valid_high && $valid_low) |
|
| 4178 | + if ($valid_high && $valid_low) |
|
| 4179 | 4179 | { |
| 4180 | 4180 | $ip_array['low'] = $ip_parts[0]; |
| 4181 | 4181 | $ip_array['high'] = $ip_parts[1]; |
@@ -4356,7 +4356,7 @@ discard block |
||
| 4356 | 4356 | addInlineJavaScript(' |
| 4357 | 4357 | var user_menus = new smc_PopupMenu(); |
| 4358 | 4358 | user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup"); |
| 4359 | - user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true); |
|
| 4359 | + user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true); |
|
| 4360 | 4360 | if ($context['allow_pm']) |
| 4361 | 4361 | addInlineJavaScript(' |
| 4362 | 4362 | user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true); |
@@ -4651,7 +4651,7 @@ discard block |
||
| 4651 | 4651 | $context['total_admin_reports'] += $context['unapproved_members']; |
| 4652 | 4652 | } |
| 4653 | 4653 | |
| 4654 | - if($context['total_admin_reports'] > 0 && !empty($context['menu_buttons']['admin'])) |
|
| 4654 | + if ($context['total_admin_reports'] > 0 && !empty($context['menu_buttons']['admin'])) |
|
| 4655 | 4655 | { |
| 4656 | 4656 | $context['menu_buttons']['admin']['amt'] = $context['total_admin_reports']; |
| 4657 | 4657 | } |
@@ -4998,7 +4998,7 @@ discard block |
||
| 4998 | 4998 | // No? try a fallback to $sourcedir |
| 4999 | 4999 | else |
| 5000 | 5000 | { |
| 5001 | - $absPath = $sourcedir .'/'. $file; |
|
| 5001 | + $absPath = $sourcedir . '/' . $file; |
|
| 5002 | 5002 | |
| 5003 | 5003 | if (file_exists($absPath)) |
| 5004 | 5004 | require_once($absPath); |
@@ -5265,15 +5265,15 @@ discard block |
||
| 5265 | 5265 | |
| 5266 | 5266 | // UTF-8 occurences of MS special characters |
| 5267 | 5267 | $findchars_utf8 = array( |
| 5268 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5269 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5270 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5271 | - "\xe2\x80\x98", // left single curly quote |
|
| 5272 | - "\xe2\x80\x99", // right single curly quote |
|
| 5273 | - "\xe2\x80\x9c", // left double curly quote |
|
| 5274 | - "\xe2\x80\x9d", // right double curly quote |
|
| 5275 | - "\xe2\x80\x93", // en dash |
|
| 5276 | - "\xe2\x80\x94", // em dash |
|
| 5268 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5269 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5270 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5271 | + "\xe2\x80\x98", // left single curly quote |
|
| 5272 | + "\xe2\x80\x99", // right single curly quote |
|
| 5273 | + "\xe2\x80\x9c", // left double curly quote |
|
| 5274 | + "\xe2\x80\x9d", // right double curly quote |
|
| 5275 | + "\xe2\x80\x93", // en dash |
|
| 5276 | + "\xe2\x80\x94", // em dash |
|
| 5277 | 5277 | ); |
| 5278 | 5278 | |
| 5279 | 5279 | // windows 1252 / iso equivalents |
@@ -5291,15 +5291,15 @@ discard block |
||
| 5291 | 5291 | |
| 5292 | 5292 | // safe replacements |
| 5293 | 5293 | $replacechars = array( |
| 5294 | - ',', // ‚ |
|
| 5295 | - ',,', // „ |
|
| 5296 | - '...', // … |
|
| 5297 | - "'", // ‘ |
|
| 5298 | - "'", // ’ |
|
| 5299 | - '"', // “ |
|
| 5300 | - '"', // ” |
|
| 5301 | - '-', // – |
|
| 5302 | - '--', // — |
|
| 5294 | + ',', // ‚ |
|
| 5295 | + ',,', // „ |
|
| 5296 | + '...', // … |
|
| 5297 | + "'", // ‘ |
|
| 5298 | + "'", // ’ |
|
| 5299 | + '"', // “ |
|
| 5300 | + '"', // ” |
|
| 5301 | + '-', // – |
|
| 5302 | + '--', // — |
|
| 5303 | 5303 | ); |
| 5304 | 5304 | |
| 5305 | 5305 | if ($context['utf8']) |
@@ -5619,7 +5619,7 @@ discard block |
||
| 5619 | 5619 | */ |
| 5620 | 5620 | function inet_dtop($bin) |
| 5621 | 5621 | { |
| 5622 | - if(empty($bin)) |
|
| 5622 | + if (empty($bin)) |
|
| 5623 | 5623 | return ''; |
| 5624 | 5624 | |
| 5625 | 5625 | global $db_type; |
@@ -5650,28 +5650,28 @@ discard block |
||
| 5650 | 5650 | */ |
| 5651 | 5651 | function _safe_serialize($value) |
| 5652 | 5652 | { |
| 5653 | - if(is_null($value)) |
|
| 5653 | + if (is_null($value)) |
|
| 5654 | 5654 | return 'N;'; |
| 5655 | 5655 | |
| 5656 | - if(is_bool($value)) |
|
| 5657 | - return 'b:'. (int) $value .';'; |
|
| 5656 | + if (is_bool($value)) |
|
| 5657 | + return 'b:' . (int) $value . ';'; |
|
| 5658 | 5658 | |
| 5659 | - if(is_int($value)) |
|
| 5660 | - return 'i:'. $value .';'; |
|
| 5659 | + if (is_int($value)) |
|
| 5660 | + return 'i:' . $value . ';'; |
|
| 5661 | 5661 | |
| 5662 | - if(is_float($value)) |
|
| 5663 | - return 'd:'. str_replace(',', '.', $value) .';'; |
|
| 5662 | + if (is_float($value)) |
|
| 5663 | + return 'd:' . str_replace(',', '.', $value) . ';'; |
|
| 5664 | 5664 | |
| 5665 | - if(is_string($value)) |
|
| 5666 | - return 's:'. strlen($value) .':"'. $value .'";'; |
|
| 5665 | + if (is_string($value)) |
|
| 5666 | + return 's:' . strlen($value) . ':"' . $value . '";'; |
|
| 5667 | 5667 | |
| 5668 | - if(is_array($value)) |
|
| 5668 | + if (is_array($value)) |
|
| 5669 | 5669 | { |
| 5670 | 5670 | $out = ''; |
| 5671 | - foreach($value as $k => $v) |
|
| 5671 | + foreach ($value as $k => $v) |
|
| 5672 | 5672 | $out .= _safe_serialize($k) . _safe_serialize($v); |
| 5673 | 5673 | |
| 5674 | - return 'a:'. count($value) .':{'. $out .'}'; |
|
| 5674 | + return 'a:' . count($value) . ':{' . $out . '}'; |
|
| 5675 | 5675 | } |
| 5676 | 5676 | |
| 5677 | 5677 | // safe_serialize cannot serialize resources or objects. |
@@ -5713,7 +5713,7 @@ discard block |
||
| 5713 | 5713 | function _safe_unserialize($str) |
| 5714 | 5714 | { |
| 5715 | 5715 | // Input is not a string. |
| 5716 | - if(empty($str) || !is_string($str)) |
|
| 5716 | + if (empty($str) || !is_string($str)) |
|
| 5717 | 5717 | return false; |
| 5718 | 5718 | |
| 5719 | 5719 | $stack = array(); |
@@ -5727,40 +5727,40 @@ discard block |
||
| 5727 | 5727 | * 3 - in array, expecting value or another array |
| 5728 | 5728 | */ |
| 5729 | 5729 | $state = 0; |
| 5730 | - while($state != 1) |
|
| 5730 | + while ($state != 1) |
|
| 5731 | 5731 | { |
| 5732 | 5732 | $type = isset($str[0]) ? $str[0] : ''; |
| 5733 | - if($type == '}') |
|
| 5733 | + if ($type == '}') |
|
| 5734 | 5734 | $str = substr($str, 1); |
| 5735 | 5735 | |
| 5736 | - else if($type == 'N' && $str[1] == ';') |
|
| 5736 | + else if ($type == 'N' && $str[1] == ';') |
|
| 5737 | 5737 | { |
| 5738 | 5738 | $value = null; |
| 5739 | 5739 | $str = substr($str, 2); |
| 5740 | 5740 | } |
| 5741 | - else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
| 5741 | + else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
| 5742 | 5742 | { |
| 5743 | 5743 | $value = $matches[1] == '1' ? true : false; |
| 5744 | 5744 | $str = substr($str, 4); |
| 5745 | 5745 | } |
| 5746 | - else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
| 5746 | + else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
| 5747 | 5747 | { |
| 5748 | - $value = (int)$matches[1]; |
|
| 5748 | + $value = (int) $matches[1]; |
|
| 5749 | 5749 | $str = $matches[2]; |
| 5750 | 5750 | } |
| 5751 | - else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
| 5751 | + else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
| 5752 | 5752 | { |
| 5753 | - $value = (float)$matches[1]; |
|
| 5753 | + $value = (float) $matches[1]; |
|
| 5754 | 5754 | $str = $matches[3]; |
| 5755 | 5755 | } |
| 5756 | - else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";') |
|
| 5756 | + else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";') |
|
| 5757 | 5757 | { |
| 5758 | - $value = substr($matches[2], 0, (int)$matches[1]); |
|
| 5759 | - $str = substr($matches[2], (int)$matches[1] + 2); |
|
| 5758 | + $value = substr($matches[2], 0, (int) $matches[1]); |
|
| 5759 | + $str = substr($matches[2], (int) $matches[1] + 2); |
|
| 5760 | 5760 | } |
| 5761 | - else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
| 5761 | + else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
| 5762 | 5762 | { |
| 5763 | - $expectedLength = (int)$matches[1]; |
|
| 5763 | + $expectedLength = (int) $matches[1]; |
|
| 5764 | 5764 | $str = $matches[2]; |
| 5765 | 5765 | } |
| 5766 | 5766 | |
@@ -5768,10 +5768,10 @@ discard block |
||
| 5768 | 5768 | else |
| 5769 | 5769 | return false; |
| 5770 | 5770 | |
| 5771 | - switch($state) |
|
| 5771 | + switch ($state) |
|
| 5772 | 5772 | { |
| 5773 | 5773 | case 3: // In array, expecting value or another array. |
| 5774 | - if($type == 'a') |
|
| 5774 | + if ($type == 'a') |
|
| 5775 | 5775 | { |
| 5776 | 5776 | $stack[] = &$list; |
| 5777 | 5777 | $list[$key] = array(); |
@@ -5780,7 +5780,7 @@ discard block |
||
| 5780 | 5780 | $state = 2; |
| 5781 | 5781 | break; |
| 5782 | 5782 | } |
| 5783 | - if($type != '}') |
|
| 5783 | + if ($type != '}') |
|
| 5784 | 5784 | { |
| 5785 | 5785 | $list[$key] = $value; |
| 5786 | 5786 | $state = 2; |
@@ -5791,29 +5791,29 @@ discard block |
||
| 5791 | 5791 | return false; |
| 5792 | 5792 | |
| 5793 | 5793 | case 2: // in array, expecting end of array or a key |
| 5794 | - if($type == '}') |
|
| 5794 | + if ($type == '}') |
|
| 5795 | 5795 | { |
| 5796 | 5796 | // Array size is less than expected. |
| 5797 | - if(count($list) < end($expected)) |
|
| 5797 | + if (count($list) < end($expected)) |
|
| 5798 | 5798 | return false; |
| 5799 | 5799 | |
| 5800 | 5800 | unset($list); |
| 5801 | - $list = &$stack[count($stack)-1]; |
|
| 5801 | + $list = &$stack[count($stack) - 1]; |
|
| 5802 | 5802 | array_pop($stack); |
| 5803 | 5803 | |
| 5804 | 5804 | // Go to terminal state if we're at the end of the root array. |
| 5805 | 5805 | array_pop($expected); |
| 5806 | 5806 | |
| 5807 | - if(count($expected) == 0) |
|
| 5807 | + if (count($expected) == 0) |
|
| 5808 | 5808 | $state = 1; |
| 5809 | 5809 | |
| 5810 | 5810 | break; |
| 5811 | 5811 | } |
| 5812 | 5812 | |
| 5813 | - if($type == 'i' || $type == 's') |
|
| 5813 | + if ($type == 'i' || $type == 's') |
|
| 5814 | 5814 | { |
| 5815 | 5815 | // Array size exceeds expected length. |
| 5816 | - if(count($list) >= end($expected)) |
|
| 5816 | + if (count($list) >= end($expected)) |
|
| 5817 | 5817 | return false; |
| 5818 | 5818 | |
| 5819 | 5819 | $key = $value; |
@@ -5826,7 +5826,7 @@ discard block |
||
| 5826 | 5826 | |
| 5827 | 5827 | // Expecting array or value. |
| 5828 | 5828 | case 0: |
| 5829 | - if($type == 'a') |
|
| 5829 | + if ($type == 'a') |
|
| 5830 | 5830 | { |
| 5831 | 5831 | $data = array(); |
| 5832 | 5832 | $list = &$data; |
@@ -5835,7 +5835,7 @@ discard block |
||
| 5835 | 5835 | break; |
| 5836 | 5836 | } |
| 5837 | 5837 | |
| 5838 | - if($type != '}') |
|
| 5838 | + if ($type != '}') |
|
| 5839 | 5839 | { |
| 5840 | 5840 | $data = $value; |
| 5841 | 5841 | $state = 1; |
@@ -5848,7 +5848,7 @@ discard block |
||
| 5848 | 5848 | } |
| 5849 | 5849 | |
| 5850 | 5850 | // Trailing data in input. |
| 5851 | - if(!empty($str)) |
|
| 5851 | + if (!empty($str)) |
|
| 5852 | 5852 | return false; |
| 5853 | 5853 | |
| 5854 | 5854 | return $data; |
@@ -5902,7 +5902,7 @@ discard block |
||
| 5902 | 5902 | // Set different modes. |
| 5903 | 5903 | $chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
| 5904 | 5904 | |
| 5905 | - foreach($chmodValues as $val) |
|
| 5905 | + foreach ($chmodValues as $val) |
|
| 5906 | 5906 | { |
| 5907 | 5907 | // If it's writable, break out of the loop. |
| 5908 | 5908 | if (is_writable($file)) |
@@ -5937,13 +5937,13 @@ discard block |
||
| 5937 | 5937 | $returnArray = @json_decode($json, $returnAsArray); |
| 5938 | 5938 | |
| 5939 | 5939 | // PHP 5.3 so no json_last_error_msg() |
| 5940 | - switch(json_last_error()) |
|
| 5940 | + switch (json_last_error()) |
|
| 5941 | 5941 | { |
| 5942 | 5942 | case JSON_ERROR_NONE: |
| 5943 | 5943 | $jsonError = false; |
| 5944 | 5944 | break; |
| 5945 | 5945 | case JSON_ERROR_DEPTH: |
| 5946 | - $jsonError = 'JSON_ERROR_DEPTH'; |
|
| 5946 | + $jsonError = 'JSON_ERROR_DEPTH'; |
|
| 5947 | 5947 | break; |
| 5948 | 5948 | case JSON_ERROR_STATE_MISMATCH: |
| 5949 | 5949 | $jsonError = 'JSON_ERROR_STATE_MISMATCH'; |
@@ -5971,10 +5971,10 @@ discard block |
||
| 5971 | 5971 | loadLanguage('Errors'); |
| 5972 | 5972 | |
| 5973 | 5973 | if (!empty($jsonDebug)) |
| 5974 | - log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
| 5974 | + log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
| 5975 | 5975 | |
| 5976 | 5976 | else |
| 5977 | - log_error($txt['json_'. $jsonError], 'critical'); |
|
| 5977 | + log_error($txt['json_' . $jsonError], 'critical'); |
|
| 5978 | 5978 | |
| 5979 | 5979 | // Everyone expects an array. |
| 5980 | 5980 | return array(); |
@@ -6091,7 +6091,7 @@ discard block |
||
| 6091 | 6091 | // Convert Punycode to Unicode |
| 6092 | 6092 | require_once($sourcedir . '/Class-Punycode.php'); |
| 6093 | 6093 | $Punycode = new Punycode(); |
| 6094 | - $tlds = array_map(function ($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds); |
|
| 6094 | + $tlds = array_map(function($input) use ($Punycode) { return $Punycode->decode($input); }, $tlds); |
|
| 6095 | 6095 | } |
| 6096 | 6096 | // Otherwise, use the 2012 list of gTLDs and ccTLDs for now and schedule a background update |
| 6097 | 6097 | else |
@@ -6185,7 +6185,7 @@ discard block |
||
| 6185 | 6185 | } |
| 6186 | 6186 | |
| 6187 | 6187 | // This recursive function creates the index array from the strings |
| 6188 | - $add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
| 6188 | + $add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
| 6189 | 6189 | { |
| 6190 | 6190 | static $depth = 0; |
| 6191 | 6191 | $depth++; |
@@ -6212,7 +6212,7 @@ discard block |
||
| 6212 | 6212 | }; |
| 6213 | 6213 | |
| 6214 | 6214 | // This recursive function turns the index array into a regular expression |
| 6215 | - $index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex) |
|
| 6215 | + $index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex) |
|
| 6216 | 6216 | { |
| 6217 | 6217 | static $depth = 0; |
| 6218 | 6218 | $depth++; |
@@ -6236,11 +6236,11 @@ discard block |
||
| 6236 | 6236 | |
| 6237 | 6237 | if (count(array_keys($value)) == 1) |
| 6238 | 6238 | { |
| 6239 | - $new_key_array = explode('(?'.'>', $sub_regex); |
|
| 6239 | + $new_key_array = explode('(?' . '>', $sub_regex); |
|
| 6240 | 6240 | $new_key .= $new_key_array[0]; |
| 6241 | 6241 | } |
| 6242 | 6242 | else |
| 6243 | - $sub_regex = '(?'.'>' . $sub_regex . ')'; |
|
| 6243 | + $sub_regex = '(?' . '>' . $sub_regex . ')'; |
|
| 6244 | 6244 | } |
| 6245 | 6245 | |
| 6246 | 6246 | if ($depth > 1) |
@@ -6283,10 +6283,10 @@ discard block |
||
| 6283 | 6283 | { |
| 6284 | 6284 | $regex = array(); |
| 6285 | 6285 | while (!empty($index)) |
| 6286 | - $regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
| 6286 | + $regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
| 6287 | 6287 | } |
| 6288 | 6288 | else |
| 6289 | - $regex = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
| 6289 | + $regex = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
| 6290 | 6290 | |
| 6291 | 6291 | // Restore PHP's internal character encoding to whatever it was originally |
| 6292 | 6292 | if (!empty($current_encoding)) |
@@ -6447,8 +6447,8 @@ discard block |
||
| 6447 | 6447 | $query_part['query_see_board'] = '1=1'; |
| 6448 | 6448 | // Otherwise just the groups in $user_info['groups']. |
| 6449 | 6449 | else |
| 6450 | - $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) ' |
|
| 6451 | - . ( !empty($deny_boards_access) ? ' AND (bpv.id_group NOT IN ( '. implode(',', $groups) .') and bpv.deny = 1)' : '') |
|
| 6450 | + $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) ' |
|
| 6451 | + . (!empty($deny_boards_access) ? ' AND (bpv.id_group NOT IN ( ' . implode(',', $groups) . ') and bpv.deny = 1)' : '') |
|
| 6452 | 6452 | . ' AND bpv.id_board = b.id_board)'; |
| 6453 | 6453 | |
| 6454 | 6454 | // Build the list of boards they WANT to see. |
@@ -6512,7 +6512,7 @@ discard block |
||
| 6512 | 6512 | function sanitize_iri($iri) |
| 6513 | 6513 | { |
| 6514 | 6514 | // Encode any non-ASCII characters (but not space or control characters of any sort) |
| 6515 | - $iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function ($matches) { |
|
| 6515 | + $iri = preg_replace_callback('~[^\x00-\x7F\pZ\pC]~u', function($matches) { |
|
| 6516 | 6516 | return rawurlencode($matches[0]); |
| 6517 | 6517 | }, $iri); |
| 6518 | 6518 | |
@@ -6554,7 +6554,7 @@ discard block |
||
| 6554 | 6554 | $unescaped = array( |
| 6555 | 6555 | '%21'=>'!', '%23'=>'#', '%24'=>'$', '%26'=>'&', |
| 6556 | 6556 | '%27'=>"'", '%28'=>'(', '%29'=>')', '%2A'=>'*', |
| 6557 | - '%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':', |
|
| 6557 | + '%2B'=>'+', '%2C'=>',', '%2F'=>'/', '%3A'=>':', |
|
| 6558 | 6558 | '%3B'=>';', '%3D'=>'=', '%3F'=>'?', '%40'=>'@', |
| 6559 | 6559 | ); |
| 6560 | 6560 | $iri = strtr(rawurlencode($iri), $unescaped); |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | 'member_name' => $regOptions['username'], |
| 587 | 587 | 'email_address' => $regOptions['email'], |
| 588 | 588 | 'passwd' => hash_password($regOptions['username'], $regOptions['password']), |
| 589 | - 'password_salt' => substr(md5($smcFunc['random_int']()), 0, 4) , |
|
| 589 | + 'password_salt' => substr(md5($smcFunc['random_int']()), 0, 4), |
|
| 590 | 590 | 'posts' => 0, |
| 591 | 591 | 'date_registered' => time(), |
| 592 | 592 | 'member_ip' => $regOptions['interface'] == 'admin' ? '127.0.0.1' : $user_info['ip'], |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | 'time_offset', |
| 677 | 677 | ); |
| 678 | 678 | $knownInets = array( |
| 679 | - 'member_ip','member_ip2', |
|
| 679 | + 'member_ip', 'member_ip2', |
|
| 680 | 680 | ); |
| 681 | 681 | |
| 682 | 682 | // Call an optional function to validate the users' input. |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | $checkName = strtr($name, array('_' => '\\_', '%' => '\\%')); |
| 905 | 905 | |
| 906 | 906 | //when we got no wildcard we can use equal -> fast |
| 907 | - $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '=' ); |
|
| 907 | + $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '='); |
|
| 908 | 908 | |
| 909 | 909 | // Make sure they don't want someone else's name. |
| 910 | 910 | $request = $smcFunc['db_query']('', ' |
@@ -1273,7 +1273,7 @@ discard block |
||
| 1273 | 1273 | $user_info['buddies'][] = $userReceiver; |
| 1274 | 1274 | |
| 1275 | 1275 | // And add a nice alert. Don't abuse though! |
| 1276 | - if ((cache_get_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, 86400)) == null) |
|
| 1276 | + if ((cache_get_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, 86400)) == null) |
|
| 1277 | 1277 | { |
| 1278 | 1278 | $smcFunc['db_insert']('insert', |
| 1279 | 1279 | '{db_prefix}background_tasks', |
@@ -1288,7 +1288,7 @@ discard block |
||
| 1288 | 1288 | ); |
| 1289 | 1289 | |
| 1290 | 1290 | // Store this in a cache entry to avoid creating multiple alerts. Give it a long life cycle. |
| 1291 | - cache_put_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, '1', 86400); |
|
| 1291 | + cache_put_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, '1', 86400); |
|
| 1292 | 1292 | } |
| 1293 | 1293 | } |
| 1294 | 1294 | |