@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | // This ensures you can't search someones email address if you can't see it. |
| 394 | 394 | if (($use_wildcards || $maybe_email) && allowedTo('moderate_forum')) |
| 395 | 395 | $email_condition = ' |
| 396 | - OR (email_address ' . $comparison . ' \'' . implode( '\') OR (email_address ' . $comparison . ' \'', $names) . '\')'; |
|
| 396 | + OR (email_address ' . $comparison . ' \'' . implode('\') OR (email_address ' . $comparison . ' \'', $names) . '\')'; |
|
| 397 | 397 | else |
| 398 | 398 | $email_condition = ''; |
| 399 | 399 | |
@@ -412,8 +412,8 @@ discard block |
||
| 412 | 412 | LIMIT {int:limit}', |
| 413 | 413 | array( |
| 414 | 414 | 'buddy_list' => $user_info['buddies'], |
| 415 | - 'member_name_search' => $member_name . ' ' . $comparison . ' \'' . implode( '\' OR ' . $member_name . ' ' . $comparison . ' \'', $names) . '\'', |
|
| 416 | - 'real_name_search' => $real_name . ' ' . $comparison . ' \'' . implode( '\' OR ' . $real_name . ' ' . $comparison . ' \'', $names) . '\'', |
|
| 415 | + 'member_name_search' => $member_name . ' ' . $comparison . ' \'' . implode('\' OR ' . $member_name . ' ' . $comparison . ' \'', $names) . '\'', |
|
| 416 | + 'real_name_search' => $real_name . ' ' . $comparison . ' \'' . implode('\' OR ' . $real_name . ' ' . $comparison . ' \'', $names) . '\'', |
|
| 417 | 417 | 'email_condition' => $email_condition, |
| 418 | 418 | 'limit' => $max, |
| 419 | 419 | ) |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | 56 | // Make our known/enable themes a little easier to work with. |
| 57 | - $knownThemes = !empty($modSettings['knownThemes']) ? explode(',',$modSettings['knownThemes']) : array(); |
|
| 58 | - $enableThemes = !empty($modSettings['enableThemes']) ? explode(',',$modSettings['enableThemes']) : array(); |
|
| 57 | + $knownThemes = !empty($modSettings['knownThemes']) ? explode(',', $modSettings['knownThemes']) : array(); |
|
| 58 | + $enableThemes = !empty($modSettings['enableThemes']) ? explode(',', $modSettings['enableThemes']) : array(); |
|
| 59 | 59 | |
| 60 | 60 | $request = $smcFunc['db_query']('', ' |
| 61 | 61 | SELECT id_theme, variable, value |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | global $modSettings, $context, $smcFunc; |
| 103 | 103 | |
| 104 | 104 | // Make our known/enable themes a little easier to work with. |
| 105 | - $knownThemes = !empty($modSettings['knownThemes']) ? explode(',',$modSettings['knownThemes']) : array(); |
|
| 106 | - $enableThemes = !empty($modSettings['enableThemes']) ? explode(',',$modSettings['enableThemes']) : array(); |
|
| 105 | + $knownThemes = !empty($modSettings['knownThemes']) ? explode(',', $modSettings['knownThemes']) : array(); |
|
| 106 | + $enableThemes = !empty($modSettings['enableThemes']) ? explode(',', $modSettings['enableThemes']) : array(); |
|
| 107 | 107 | |
| 108 | 108 | // List of all possible themes values. |
| 109 | 109 | $themeValues = array( |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | 'no_member' => 0, |
| 285 | 285 | 'name' => 'name', |
| 286 | 286 | 'version' => 'version', |
| 287 | - 'name_value' => '%'. $context['to_install']['name'] .'%', |
|
| 287 | + 'name_value' => '%' . $context['to_install']['name'] . '%', |
|
| 288 | 288 | ) |
| 289 | 289 | ); |
| 290 | 290 | |
@@ -439,11 +439,11 @@ discard block |
||
| 439 | 439 | foreach ($objects as $object) |
| 440 | 440 | if ($object != '.' && $object != '..') |
| 441 | 441 | { |
| 442 | - if (filetype($path .'/'. $object) == 'dir') |
|
| 443 | - remove_dir($path .'/'.$object); |
|
| 442 | + if (filetype($path . '/' . $object) == 'dir') |
|
| 443 | + remove_dir($path . '/' . $object); |
|
| 444 | 444 | |
| 445 | 445 | else |
| 446 | - unlink($path .'/'. $object); |
|
| 446 | + unlink($path . '/' . $object); |
|
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | if ((!isset($match[3]) || trim($match[3]) != '/') && (!isset($match[2]) || trim($match[2]) != '/')) |
| 425 | 425 | { |
| 426 | 426 | // Because PHP 5.2.0+ seems to croak using regex, we'll have to do this the less fun way. |
| 427 | - $last_tag_end = strpos($data, '</' . $match[1]. '>'); |
|
| 427 | + $last_tag_end = strpos($data, '</' . $match[1] . '>'); |
|
| 428 | 428 | if ($last_tag_end === false) |
| 429 | 429 | continue; |
| 430 | 430 | |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | break; |
| 439 | 439 | |
| 440 | 440 | // If not then find the next ending tag. |
| 441 | - $next_tag_end = strpos($data, '</' . $match[1]. '>', $offset); |
|
| 441 | + $next_tag_end = strpos($data, '</' . $match[1] . '>', $offset); |
|
| 442 | 442 | |
| 443 | 443 | // Didn't find one? Then just use the last and sod it. |
| 444 | 444 | if ($next_tag_end === false) |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | // Parse the insides. |
| 453 | 453 | $inner_match = substr($data, 0, $last_tag_end); |
| 454 | 454 | // Data now starts from where this section ends. |
| 455 | - $data = substr($data, $last_tag_end + strlen('</' . $match[1]. '>')); |
|
| 455 | + $data = substr($data, $last_tag_end + strlen('</' . $match[1] . '>')); |
|
| 456 | 456 | |
| 457 | 457 | if (!empty($inner_match)) |
| 458 | 458 | { |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | $trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES)); |
| 619 | 619 | |
| 620 | 620 | // Translate all the entities out. |
| 621 | - $data = strtr(preg_replace_callback('~&#(\d{1,4});~', function ($m) |
|
| 621 | + $data = strtr(preg_replace_callback('~&#(\d{1,4});~', function($m) |
|
| 622 | 622 | { |
| 623 | 623 | return chr("$m[1]"); |
| 624 | 624 | }, $data), $trans_tbl); |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | // Set different modes. |
| 874 | 874 | $chmod_values = $is_dir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
| 875 | 875 | |
| 876 | - foreach($chmod_values as $val) |
|
| 876 | + foreach ($chmod_values as $val) |
|
| 877 | 877 | { |
| 878 | 878 | // If it's writable, break out of the loop. |
| 879 | 879 | if (is_writable($ftp_file)) |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | // Get the report details. |
| 188 | 188 | $report = getReportDetails($report_id); |
| 189 | 189 | |
| 190 | - if(!$report) |
|
| 190 | + if (!$report) |
|
| 191 | 191 | fatal_lang_error('mc_no_modreport_found'); |
| 192 | 192 | |
| 193 | 193 | // Build the report data - basic details first, then extra stuff based on the type |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | if ($context['report_type'] == 'members') |
| 251 | 251 | { |
| 252 | 252 | // Find their ID in the serialized action string... |
| 253 | - $user_id_length = strlen((string)$context['report']['user']['id']); |
|
| 253 | + $user_id_length = strlen((string) $context['report']['user']['id']); |
|
| 254 | 254 | $member = 's:6:"member";s:' . $user_id_length . ':"' . $context['report']['user']['id'] . '";}'; |
| 255 | 255 | |
| 256 | 256 | $params = array( |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | // What are we gonna do? |
| 530 | 530 | $action = isset($_GET['ignore']) ? 'ignore' : 'closed'; |
| 531 | 531 | |
| 532 | - validateToken('mod-report-'. $action, 'get'); |
|
| 532 | + validateToken('mod-report-' . $action, 'get'); |
|
| 533 | 533 | |
| 534 | 534 | // Are we ignore or "un-ignore"? "un-ignore" that's a funny word! |
| 535 | 535 | $value = (int) $_GET[$action]; |
@@ -1326,7 +1326,7 @@ discard block |
||
| 1326 | 1326 | 'class' => 'centercol', |
| 1327 | 1327 | ), |
| 1328 | 1328 | 'data' => array( |
| 1329 | - 'function' => function ($rowData) |
|
| 1329 | + 'function' => function($rowData) |
|
| 1330 | 1330 | { |
| 1331 | 1331 | $isChecked = $rowData['disabled'] ? '' : ' checked'; |
| 1332 | 1332 | $onClickHandler = $rowData['can_show_register'] ? sprintf(' onclick="document.getElementById(\'reg_%1$s\').disabled = !this.checked;"', $rowData['id']) : ''; |
@@ -1342,7 +1342,7 @@ discard block |
||
| 1342 | 1342 | 'class' => 'centercol', |
| 1343 | 1343 | ), |
| 1344 | 1344 | 'data' => array( |
| 1345 | - 'function' => function ($rowData) |
|
| 1345 | + 'function' => function($rowData) |
|
| 1346 | 1346 | { |
| 1347 | 1347 | $isChecked = $rowData['on_register'] && !$rowData['disabled'] ? ' checked' : ''; |
| 1348 | 1348 | $isDisabled = $rowData['can_show_register'] ? '' : ' disabled'; |
@@ -1389,15 +1389,15 @@ discard block |
||
| 1389 | 1389 | 'value' => $txt['custom_profile_fieldorder'], |
| 1390 | 1390 | ), |
| 1391 | 1391 | 'data' => array( |
| 1392 | - 'function' => function ($rowData) use ($context, $txt, $scripturl) |
|
| 1392 | + 'function' => function($rowData) use ($context, $txt, $scripturl) |
|
| 1393 | 1393 | { |
| 1394 | - $return = '<p class="centertext bold_text">'. $rowData['field_order'] .'<br />'; |
|
| 1394 | + $return = '<p class="centertext bold_text">' . $rowData['field_order'] . '<br />'; |
|
| 1395 | 1395 | |
| 1396 | 1396 | if ($rowData['field_order'] > 1) |
| 1397 | - $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_up'] .'"></span></a>'; |
|
| 1397 | + $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_up'] . '"></span></a>'; |
|
| 1398 | 1398 | |
| 1399 | 1399 | if ($rowData['field_order'] < $context['custFieldsMaxOrder']) |
| 1400 | - $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_down'] .'"></span></a>'; |
|
| 1400 | + $return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_down'] . '"></span></a>'; |
|
| 1401 | 1401 | |
| 1402 | 1402 | $return .= '</p>'; |
| 1403 | 1403 | |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | 'value' => $txt['custom_profile_fieldname'], |
| 1416 | 1416 | ), |
| 1417 | 1417 | 'data' => array( |
| 1418 | - 'function' => function ($rowData) use ($scripturl) |
|
| 1418 | + 'function' => function($rowData) use ($scripturl) |
|
| 1419 | 1419 | { |
| 1420 | 1420 | return sprintf('<a href="%1$s?action=admin;area=featuresettings;sa=profileedit;fid=%2$d">%3$s</a><div class="smalltext">%4$s</div>', $scripturl, $rowData['id_field'], $rowData['field_name'], $rowData['field_desc']); |
| 1421 | 1421 | }, |
@@ -1431,7 +1431,7 @@ discard block |
||
| 1431 | 1431 | 'value' => $txt['custom_profile_fieldtype'], |
| 1432 | 1432 | ), |
| 1433 | 1433 | 'data' => array( |
| 1434 | - 'function' => function ($rowData) use ($txt) |
|
| 1434 | + 'function' => function($rowData) use ($txt) |
|
| 1435 | 1435 | { |
| 1436 | 1436 | $textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']); |
| 1437 | 1437 | return isset($txt[$textKey]) ? $txt[$textKey] : $textKey; |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | 'value' => $txt['custom_profile_active'], |
| 1450 | 1450 | ), |
| 1451 | 1451 | 'data' => array( |
| 1452 | - 'function' => function ($rowData) use ($txt) |
|
| 1452 | + 'function' => function($rowData) use ($txt) |
|
| 1453 | 1453 | { |
| 1454 | 1454 | return $rowData['active'] ? $txt['yes'] : $txt['no']; |
| 1455 | 1455 | }, |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | 'value' => $txt['custom_profile_placement'], |
| 1467 | 1467 | ), |
| 1468 | 1468 | 'data' => array( |
| 1469 | - 'function' => function ($rowData) |
|
| 1469 | + 'function' => function($rowData) |
|
| 1470 | 1470 | { |
| 1471 | 1471 | global $txt, $context; |
| 1472 | 1472 | |
@@ -1701,7 +1701,7 @@ discard block |
||
| 1701 | 1701 | redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler |
| 1702 | 1702 | |
| 1703 | 1703 | // All good, proceed. |
| 1704 | - $smcFunc['db_query']('',' |
|
| 1704 | + $smcFunc['db_query']('', ' |
|
| 1705 | 1705 | UPDATE {db_prefix}custom_fields |
| 1706 | 1706 | SET field_order = {int:old_order} |
| 1707 | 1707 | WHERE field_order = {int:new_order}', |
@@ -1710,7 +1710,7 @@ discard block |
||
| 1710 | 1710 | 'old_order' => $context['field']['order'], |
| 1711 | 1711 | ) |
| 1712 | 1712 | ); |
| 1713 | - $smcFunc['db_query']('',' |
|
| 1713 | + $smcFunc['db_query']('', ' |
|
| 1714 | 1714 | UPDATE {db_prefix}custom_fields |
| 1715 | 1715 | SET field_order = {int:new_order} |
| 1716 | 1716 | WHERE id_field = {int:id_field}', |
@@ -1812,7 +1812,7 @@ discard block |
||
| 1812 | 1812 | $smcFunc['db_free_result']($request); |
| 1813 | 1813 | |
| 1814 | 1814 | $unique = false; |
| 1815 | - for ($i = 0; !$unique && $i < 9; $i ++) |
|
| 1815 | + for ($i = 0; !$unique && $i < 9; $i++) |
|
| 1816 | 1816 | { |
| 1817 | 1817 | if (!in_array($col_name, $current_fields)) |
| 1818 | 1818 | $unique = true; |
@@ -1985,7 +1985,7 @@ discard block |
||
| 1985 | 1985 | ); |
| 1986 | 1986 | |
| 1987 | 1987 | // Re-arrange the order. |
| 1988 | - $smcFunc['db_query']('',' |
|
| 1988 | + $smcFunc['db_query']('', ' |
|
| 1989 | 1989 | UPDATE {db_prefix}custom_fields |
| 1990 | 1990 | SET field_order = field_order - 1 |
| 1991 | 1991 | WHERE field_order > {int:current_order}', |
@@ -2249,7 +2249,7 @@ discard block |
||
| 2249 | 2249 | $context['token_check'] = 'noti-admin'; |
| 2250 | 2250 | |
| 2251 | 2251 | // Specify our action since we'll want to post back here instead of the profile |
| 2252 | - $context['action'] = 'action=admin;area=featuresettings;sa=alerts;'. $context['session_var'] .'='. $context['session_id']; |
|
| 2252 | + $context['action'] = 'action=admin;area=featuresettings;sa=alerts;' . $context['session_var'] . '=' . $context['session_id']; |
|
| 2253 | 2253 | |
| 2254 | 2254 | loadTemplate('Profile'); |
| 2255 | 2255 | loadLanguage('Profile'); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | require_once($sourcedir . '/Subs-Auth.php'); |
| 53 | 53 | |
| 54 | 54 | // Posting the password... check it. |
| 55 | - if (isset($_POST[$type. '_pass'])) |
|
| 55 | + if (isset($_POST[$type . '_pass'])) |
|
| 56 | 56 | { |
| 57 | 57 | // Check to ensure we're forcing SSL for authentication |
| 58 | 58 | if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')) |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | if ($ip_number == 'ip2' && $user_info['ip2'] == $user_info['ip']) |
| 181 | 181 | continue; |
| 182 | - $ban_query[] = ' {inet:'.$ip_number.'} BETWEEN bi.ip_low and bi.ip_high'; |
|
| 182 | + $ban_query[] = ' {inet:' . $ip_number . '} BETWEEN bi.ip_low and bi.ip_high'; |
|
| 183 | 183 | $ban_query_vars[$ip_number] = $user_info[$ip_number]; |
| 184 | 184 | // IP was valid, maybe there's also a hostname... |
| 185 | 185 | if (empty($modSettings['disableHostnameLookup']) && $user_info[$ip_number] != 'unknown') |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | $hostname = host_from_ip($user_info[$ip_number]); |
| 188 | 188 | if (strlen($hostname) > 0) |
| 189 | 189 | { |
| 190 | - $ban_query[] = '({string:hostname'.$ip_number.'} LIKE bi.hostname)'; |
|
| 191 | - $ban_query_vars['hostname'.$ip_number] = $hostname; |
|
| 190 | + $ban_query[] = '({string:hostname' . $ip_number . '} LIKE bi.hostname)'; |
|
| 191 | + $ban_query_vars['hostname' . $ip_number] = $hostname; |
|
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | return true; |
| 913 | 913 | |
| 914 | 914 | // Let's ensure this is an array. |
| 915 | - $permission = (array)$permission; |
|
| 915 | + $permission = (array) $permission; |
|
| 916 | 916 | |
| 917 | 917 | // Are we checking the _current_ board, or some other boards? |
| 918 | 918 | if ($boards === null) |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | $replacement[$key] = 'null'; |
| 252 | 252 | if (!isValidIP($value)) |
| 253 | 253 | smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
| 254 | - $replacement[$key] = sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($value))); |
|
| 254 | + $replacement[$key] = sprintf('unhex(\'%1$s\')', bin2hex(inet_pton($value))); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | return implode(', ', $replacement); |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | * @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards. |
| 811 | 811 | * @return string The escaped string |
| 812 | 812 | */ |
| 813 | -function smf_db_escape_wildcard_string($string, $translate_human_wildcards=false) |
|
| 813 | +function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false) |
|
| 814 | 814 | { |
| 815 | 815 | $replacements = array( |
| 816 | 816 | '%' => '\%', |
@@ -501,7 +501,7 @@ |
||
| 501 | 501 | { |
| 502 | 502 | call_integration_hook('integrate_activate', array($regOptions['username'])); |
| 503 | 503 | |
| 504 | - setLoginCookie(60 * $modSettings['cookieTime'], $memberID, hash_salt($regOptions['register_vars']['passwd'], $regOptions['register_vars']['password_salt'])); |
|
| 504 | + setLoginCookie(60 * $modSettings['cookieTime'], $memberID, hash_salt($regOptions['register_vars']['passwd'], $regOptions['register_vars']['password_salt'])); |
|
| 505 | 505 | |
| 506 | 506 | redirectexit('action=login2;sa=check;member=' . $memberID, $context['server']['needs_login_fix']); |
| 507 | 507 | } |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // Set a list of common functions. |
| 78 | 78 | $ent_list = empty($modSettings['disableEntityCheck']) ? '&(#\d{1,7}|quot|amp|lt|gt|nbsp);' : '&(#021|quot|amp|lt|gt|nbsp);'; |
| 79 | - $ent_check = empty($modSettings['disableEntityCheck']) ? function ($string) |
|
| 79 | + $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
|
| 80 | 80 | { |
| 81 | 81 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
| 82 | 82 | return $string; |
| 83 | - } : function ($string) |
|
| 83 | + } : function($string) |
|
| 84 | 84 | { |
| 85 | 85 | return $string; |
| 86 | 86 | }; |
| 87 | - $fix_utf8mb4 = function ($string) use ($utf8) |
|
| 87 | + $fix_utf8mb4 = function($string) use ($utf8) |
|
| 88 | 88 | { |
| 89 | 89 | if (!$utf8) |
| 90 | 90 | return $string; |
@@ -102,21 +102,21 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | elseif ($ord < 224) |
| 104 | 104 | { |
| 105 | - $new_string .= $string[$i] . $string[$i+1]; |
|
| 105 | + $new_string .= $string[$i] . $string[$i + 1]; |
|
| 106 | 106 | $i += 2; |
| 107 | 107 | } |
| 108 | 108 | elseif ($ord < 240) |
| 109 | 109 | { |
| 110 | - $new_string .= $string[$i] . $string[$i+1] . $string[$i+2]; |
|
| 110 | + $new_string .= $string[$i] . $string[$i + 1] . $string[$i + 2]; |
|
| 111 | 111 | $i += 3; |
| 112 | 112 | } |
| 113 | 113 | elseif ($ord < 248) |
| 114 | 114 | { |
| 115 | 115 | // Magic happens. |
| 116 | 116 | $val = (ord($string[$i]) & 0x07) << 18; |
| 117 | - $val += (ord($string[$i+1]) & 0x3F) << 12; |
|
| 118 | - $val += (ord($string[$i+2]) & 0x3F) << 6; |
|
| 119 | - $val += (ord($string[$i+3]) & 0x3F); |
|
| 117 | + $val += (ord($string[$i + 1]) & 0x3F) << 12; |
|
| 118 | + $val += (ord($string[$i + 2]) & 0x3F) << 6; |
|
| 119 | + $val += (ord($string[$i + 3]) & 0x3F); |
|
| 120 | 120 | $new_string .= '&#' . $val . ';'; |
| 121 | 121 | $i += 4; |
| 122 | 122 | } |
@@ -129,24 +129,24 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | // global array of anonymous helper functions, used mostly to properly handle multi byte strings |
| 131 | 131 | $smcFunc += array( |
| 132 | - 'entity_fix' => function ($string) |
|
| 132 | + 'entity_fix' => function($string) |
|
| 133 | 133 | { |
| 134 | 134 | $num = $string[0] === 'x' ? hexdec(substr($string, 1)) : (int) $string; |
| 135 | 135 | return $num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num === 0x202E || $num === 0x202D ? '' : '&#' . $num . ';'; |
| 136 | 136 | }, |
| 137 | - 'htmlspecialchars' => function ($string, $quote_style = ENT_COMPAT, $charset = 'ISO-8859-1') use ($ent_check, $utf8, $fix_utf8mb4) |
|
| 137 | + 'htmlspecialchars' => function($string, $quote_style = ENT_COMPAT, $charset = 'ISO-8859-1') use ($ent_check, $utf8, $fix_utf8mb4) |
|
| 138 | 138 | { |
| 139 | 139 | return $fix_utf8mb4($ent_check(htmlspecialchars($string, $quote_style, $utf8 ? 'UTF-8' : $charset))); |
| 140 | 140 | }, |
| 141 | - 'htmltrim' => function ($string) use ($utf8, $space_chars, $ent_check) |
|
| 141 | + 'htmltrim' => function($string) use ($utf8, $space_chars, $ent_check) |
|
| 142 | 142 | { |
| 143 | 143 | return preg_replace('~^(?:[ \t\n\r\x0B\x00' . $space_chars . ']| )+|(?:[ \t\n\r\x0B\x00' . $space_chars . ']| )+$~' . ($utf8 ? 'u' : ''), '', $ent_check($string)); |
| 144 | 144 | }, |
| 145 | - 'strlen' => function ($string) use ($ent_list, $utf8, $ent_check) |
|
| 145 | + 'strlen' => function($string) use ($ent_list, $utf8, $ent_check) |
|
| 146 | 146 | { |
| 147 | 147 | return strlen(preg_replace('~' . $ent_list . ($utf8 ? '|.~u' : '~'), '_', $ent_check($string))); |
| 148 | 148 | }, |
| 149 | - 'strpos' => function ($haystack, $needle, $offset = 0) use ($utf8, $ent_check, $modSettings) |
|
| 149 | + 'strpos' => function($haystack, $needle, $offset = 0) use ($utf8, $ent_check, $modSettings) |
|
| 150 | 150 | { |
| 151 | 151 | $haystack_arr = preg_split('~(&#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . ';|"|&|<|>| |.)~' . ($utf8 ? 'u' : ''), $ent_check($haystack), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
| 152 | 152 | |
@@ -171,12 +171,12 @@ discard block |
||
| 171 | 171 | return false; |
| 172 | 172 | } |
| 173 | 173 | }, |
| 174 | - 'substr' => function ($string, $start, $length = null) use ($utf8, $ent_check, $modSettings) |
|
| 174 | + 'substr' => function($string, $start, $length = null) use ($utf8, $ent_check, $modSettings) |
|
| 175 | 175 | { |
| 176 | 176 | $ent_arr = preg_split('~(&#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . ';|"|&|<|>| |.)~' . ($utf8 ? 'u' : '') . '', $ent_check($string), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
| 177 | 177 | return $length === null ? implode('', array_slice($ent_arr, $start)) : implode('', array_slice($ent_arr, $start, $length)); |
| 178 | 178 | }, |
| 179 | - 'strtolower' => $utf8 ? function ($string) use ($sourcedir) |
|
| 179 | + 'strtolower' => $utf8 ? function($string) use ($sourcedir) |
|
| 180 | 180 | { |
| 181 | 181 | if (!function_exists('mb_strtolower')) |
| 182 | 182 | { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | return mb_strtolower($string, 'UTF-8'); |
| 188 | 188 | } : 'strtolower', |
| 189 | - 'strtoupper' => $utf8 ? function ($string) |
|
| 189 | + 'strtoupper' => $utf8 ? function($string) |
|
| 190 | 190 | { |
| 191 | 191 | global $sourcedir; |
| 192 | 192 | |
@@ -201,17 +201,17 @@ discard block |
||
| 201 | 201 | 'truncate' => function($string, $length) use ($utf8, $ent_check, $ent_list, &$smcFunc) |
| 202 | 202 | { |
| 203 | 203 | $string = $ent_check($string); |
| 204 | - preg_match('~^(' . $ent_list . '|.){' . $smcFunc['strlen'](substr($string, 0, $length)) . '}~'. ($utf8 ? 'u' : ''), $string, $matches); |
|
| 204 | + preg_match('~^(' . $ent_list . '|.){' . $smcFunc['strlen'](substr($string, 0, $length)) . '}~' . ($utf8 ? 'u' : ''), $string, $matches); |
|
| 205 | 205 | $string = $matches[0]; |
| 206 | 206 | while (strlen($string) > $length) |
| 207 | - $string = preg_replace('~(?:' . $ent_list . '|.)$~'. ($utf8 ? 'u' : ''), '', $string); |
|
| 207 | + $string = preg_replace('~(?:' . $ent_list . '|.)$~' . ($utf8 ? 'u' : ''), '', $string); |
|
| 208 | 208 | return $string; |
| 209 | 209 | }, |
| 210 | - 'ucfirst' => $utf8 ? function ($string) use (&$smcFunc) |
|
| 210 | + 'ucfirst' => $utf8 ? function($string) use (&$smcFunc) |
|
| 211 | 211 | { |
| 212 | 212 | return $smcFunc['strtoupper']($smcFunc['substr']($string, 0, 1)) . $smcFunc['substr']($string, 1); |
| 213 | 213 | } : 'ucfirst', |
| 214 | - 'ucwords' => $utf8 ? function ($string) use (&$smcFunc) |
|
| 214 | + 'ucwords' => $utf8 ? function($string) use (&$smcFunc) |
|
| 215 | 215 | { |
| 216 | 216 | $words = preg_split('~([\s\r\n\t]+)~', $string, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 217 | 217 | for ($i = 0, $n = count($words); $i < $n; $i += 2) |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | else |
| 611 | 611 | { |
| 612 | 612 | // !!! Compatibility. |
| 613 | - $user_info['time_offset'] = empty($user_settings['time_offset']) ? 0 :$user_settings['time_offset']; |
|
| 613 | + $user_info['time_offset'] = empty($user_settings['time_offset']) ? 0 : $user_settings['time_offset']; |
|
| 614 | 614 | } |
| 615 | 615 | } |
| 616 | 616 | // If the user is a guest, initialize all the critical user settings. |
@@ -1265,9 +1265,9 @@ discard block |
||
| 1265 | 1265 | if ($image_proxy_enabled && !empty($row['avatar']) && stripos($row['avatar'], 'http://') !== false) |
| 1266 | 1266 | $row['avatar'] = $boardurl . '/proxy.php?request=' . urlencode($row['avatar']) . '&hash=' . md5($row['avatar'] . $image_proxy_secret); |
| 1267 | 1267 | |
| 1268 | - if ( isset($row['member_ip']) ) |
|
| 1268 | + if (isset($row['member_ip'])) |
|
| 1269 | 1269 | $row['member_ip'] = inet_dtop($row['member_ip']); |
| 1270 | - if ( isset($row['member_ip2']) ) |
|
| 1270 | + if (isset($row['member_ip2'])) |
|
| 1271 | 1271 | $row['member_ip2'] = inet_dtop($row['member_ip2']); |
| 1272 | 1272 | $new_loaded_ids[] = $row['id_member']; |
| 1273 | 1273 | $loaded_ids[] = $row['id_member']; |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | 'name' => $profile['real_name'], |
| 1416 | 1416 | 'id' => $profile['id_member'], |
| 1417 | 1417 | 'href' => $scripturl . '?action=profile;u=' . $profile['id_member'], |
| 1418 | - 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" '. (!empty($modSettings['onlineEnable']) ? 'class="pm_icon"' : '').'>' . $profile['real_name'] . '</a>', |
|
| 1418 | + 'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" ' . (!empty($modSettings['onlineEnable']) ? 'class="pm_icon"' : '') . '>' . $profile['real_name'] . '</a>', |
|
| 1419 | 1419 | 'email' => $profile['email_address'], |
| 1420 | 1420 | 'show_email' => !$user_info['is_guest'] && ($user_info['id'] == $profile['id_member'] || allowedTo('moderate_forum')), |
| 1421 | 1421 | 'registered' => empty($profile['date_registered']) ? $txt['not_applicable'] : timeformat($profile['date_registered']), |
@@ -1430,9 +1430,9 @@ discard block |
||
| 1430 | 1430 | $loadedLanguages = getLanguages(); |
| 1431 | 1431 | |
| 1432 | 1432 | $memberContext[$user] += array( |
| 1433 | - 'username_color' => '<span '. (!empty($profile['member_group_color']) ? 'style="color:'. $profile['member_group_color'] .';"' : '') .'>'. $profile['member_name'] .'</span>', |
|
| 1434 | - 'name_color' => '<span '. (!empty($profile['member_group_color']) ? 'style="color:'. $profile['member_group_color'] .';"' : '') .'>'. $profile['real_name'] .'</span>', |
|
| 1435 | - 'link_color' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" '. (!empty($profile['member_group_color']) ? 'style="color:'. $profile['member_group_color'] .';"' : '') .'>' . $profile['real_name'] . '</a>', |
|
| 1433 | + 'username_color' => '<span ' . (!empty($profile['member_group_color']) ? 'style="color:' . $profile['member_group_color'] . ';"' : '') . '>' . $profile['member_name'] . '</span>', |
|
| 1434 | + 'name_color' => '<span ' . (!empty($profile['member_group_color']) ? 'style="color:' . $profile['member_group_color'] . ';"' : '') . '>' . $profile['real_name'] . '</span>', |
|
| 1435 | + 'link_color' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '" ' . (!empty($profile['member_group_color']) ? 'style="color:' . $profile['member_group_color'] . ';"' : '') . '>' . $profile['real_name'] . '</a>', |
|
| 1436 | 1436 | 'is_buddy' => $profile['buddy'], |
| 1437 | 1437 | 'is_reverse_buddy' => in_array($user_info['id'], $buddy_list), |
| 1438 | 1438 | 'buddies' => $buddy_list, |
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | if (!empty($image)) |
| 1503 | 1503 | $memberContext[$user]['avatar'] = array( |
| 1504 | 1504 | 'name' => $profile['avatar'], |
| 1505 | - 'image' => '<img class="avatar" src="' . $image . '" alt="avatar_'. $profile['member_name'].'">', |
|
| 1505 | + 'image' => '<img class="avatar" src="' . $image . '" alt="avatar_' . $profile['member_name'] . '">', |
|
| 1506 | 1506 | 'href' => $image, |
| 1507 | 1507 | 'url' => $image, |
| 1508 | 1508 | ); |
@@ -2828,7 +2828,7 @@ discard block |
||
| 2828 | 2828 | $langName = $smcFunc['ucwords'](strtr($matches[1], array('_' => ' '))); |
| 2829 | 2829 | |
| 2830 | 2830 | // Get the line we need. |
| 2831 | - $fp = @fopen($language_dir .'/'. $entry); |
|
| 2831 | + $fp = @fopen($language_dir . '/' . $entry); |
|
| 2832 | 2832 | |
| 2833 | 2833 | // Yay! |
| 2834 | 2834 | if ($fp) |