@@ -425,7 +425,8 @@ discard block |
||
425 | 425 | if (!empty($day['events'])) |
426 | 426 | { |
427 | 427 | // Sort events by start time (all day events will be listed first) |
428 | - uasort($day['events'], function($a, $b) { |
|
428 | + uasort($day['events'], function($a, $b) |
|
429 | + { |
|
429 | 430 | if ($a['start_timestamp'] == $b['start_timestamp']) |
430 | 431 | return 0; |
431 | 432 | |
@@ -619,7 +620,8 @@ discard block |
||
619 | 620 | if (!empty($day['events'])) |
620 | 621 | { |
621 | 622 | // Sort events by start time (all day events will be listed first) |
622 | - uasort($day['events'], function($a, $b) { |
|
623 | + uasort($day['events'], function($a, $b) |
|
624 | + { |
|
623 | 625 | if ($a['start_timestamp'] == $b['start_timestamp']) |
624 | 626 | return 0; |
625 | 627 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
@@ -295,7 +295,8 @@ discard block |
||
295 | 295 | // Call the step and if it returns false that means pause! |
296 | 296 | if (function_exists($step[2]) && $step[2]() === false) |
297 | 297 | break; |
298 | - elseif (function_exists($step[2])) { |
|
298 | + elseif (function_exists($step[2])) |
|
299 | + { |
|
299 | 300 | //Start each new step with this unset, so the 'normal' template is called first |
300 | 301 | unset($_GET['xml']); |
301 | 302 | //Clear out warnings at the start of each step |
@@ -2911,7 +2912,8 @@ discard block |
||
2911 | 2912 | $upcontext['step_progress'] = (int) (($upcontext['cur_table_num'] / $upcontext['table_count']) * 100); |
2912 | 2913 | |
2913 | 2914 | // Make sure we're ready & have painted the template before proceeding |
2914 | - if ($support_js && !isset($_GET['xml'])) { |
|
2915 | + if ($support_js && !isset($_GET['xml'])) |
|
2916 | + { |
|
2915 | 2917 | $_GET['substep'] = 0; |
2916 | 2918 | return false; |
2917 | 2919 | } |
@@ -2964,7 +2966,8 @@ discard block |
||
2964 | 2966 | list($charset) = explode('_', $collation); |
2965 | 2967 | |
2966 | 2968 | // Build structure of columns to operate on organized by charset; only operate on columns not yet utf8 |
2967 | - if ($charset != 'utf8') { |
|
2969 | + if ($charset != 'utf8') |
|
2970 | + { |
|
2968 | 2971 | if (!isset($table_charsets[$charset])) |
2969 | 2972 | $table_charsets[$charset] = array(); |
2970 | 2973 |
@@ -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'); |
@@ -467,7 +467,9 @@ |
||
467 | 467 | $regOptions['username'] = trim(preg_replace('~[\t\n\r \x0B\0' . ($context['utf8'] ? '\x{A0}\x{AD}\x{2000}-\x{200F}\x{201F}\x{202F}\x{3000}\x{FEFF}' : '\x00-\x08\x0B\x0C\x0E-\x19\xA0') . ']+~' . ($context['utf8'] ? 'u' : ''), ' ', $regOptions['username'])); |
468 | 468 | |
469 | 469 | // 4-byte Unicode characters are not permitted within user names where db_mb4 is false |
470 | - $regOptions['username'] = !$smcFunc['db_mb4'] && max(array_map('ord', str_split($regOptions['username']))) >= 240 ? preg_replace_callback('/[\x{10000}-\x{10FFFF}]/u', function($name) use($smcFunc){return $smcFunc['htmlspecialchars']($name[0]);}, $regOptions['username']) : $regOptions['username']; |
|
470 | + $regOptions['username'] = !$smcFunc['db_mb4'] && max(array_map('ord', str_split($regOptions['username']))) >= 240 ? preg_replace_callback('/[\x{10000}-\x{10FFFF}]/u', function($name) use($smcFunc) |
|
471 | + { |
|
472 | +return $smcFunc['htmlspecialchars']($name[0]);}, $regOptions['username']) : $regOptions['username']; |
|
471 | 473 | |
472 | 474 | // @todo Separate the sprintf? |
473 | 475 | if (empty($regOptions['email']) || !filter_var($regOptions['email'], FILTER_VALIDATE_EMAIL) || strlen($regOptions['email']) > 255) |