@@ -1107,7 +1107,7 @@ |
||
1107 | 1107 | 'left_join' => array(), |
1108 | 1108 | 'where' => array( |
1109 | 1109 | 't.id_redirect_topic = {int:not_redirected}', |
1110 | - 't.redirect_expires = {int:never_expires}', |
|
1110 | + 't.redirect_expires = {int:never_expires}', |
|
1111 | 1111 | ), |
1112 | 1112 | ); |
1113 | 1113 |
@@ -2060,7 +2060,7 @@ |
||
2060 | 2060 | new RecursiveIteratorIterator( |
2061 | 2061 | new RecursiveCallbackFilterIterator( |
2062 | 2062 | new RecursiveDirectoryIterator($dirname, FilesystemIterator::UNIX_PATHS), |
2063 | - function ($fileInfo, $currentFile, $iterator) |
|
2063 | + function($fileInfo, $currentFile, $iterator) |
|
2064 | 2064 | { |
2065 | 2065 | // Allow recursion |
2066 | 2066 | if ($iterator->hasChildren()) |
@@ -2214,7 +2214,6 @@ |
||
2214 | 2214 | $hookData['pureFunc'] = $hookData['method']; |
2215 | 2215 | $hookData['call'] = $modFunc; |
2216 | 2216 | } |
2217 | - |
|
2218 | 2217 | else |
2219 | 2218 | $hookData['call'] = $hookData['pureFunc'] = $modFunc; |
2220 | 2219 |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $combining_classes = utf8_combining_classes(); |
250 | 250 | |
251 | 251 | // Replace characters with decomposed forms. |
252 | - for ($i=0; $i < count($chars); $i++) |
|
252 | + for ($i = 0; $i < count($chars); $i++) |
|
253 | 253 | { |
254 | 254 | // Hangul characters. |
255 | 255 | if ($chars[$i] >= "\xEA\xB0\x80" && $chars[$i] <= "\xED\x9E\xA3") |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | { |
284 | 284 | $temp = $chars[$i]; |
285 | 285 | $chars[$i] = $chars[$i - 1]; |
286 | - $chars[$i -1] = $temp; |
|
286 | + $chars[$i - 1] = $temp; |
|
287 | 287 | |
288 | 288 | // Backtrack and check again. |
289 | 289 | if ($i > 1) |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | |
528 | 528 | // Use placeholders to preserve known emoji from further processing. |
529 | 529 | // Regex source is https://unicode.org/reports/tr51/#EBNF_and_Regex |
530 | - $string = preg_replace_callback( |
|
530 | + $string = preg_replace_callback( |
|
531 | 531 | '/' . |
532 | 532 | // Flag emojis |
533 | 533 | '[' . $prop_classes['Regional_Indicator'] . ']{2}' . |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | ')?' . |
557 | 557 | ')*' . |
558 | 558 | '/u', |
559 | - function ($matches) use (&$placeholders) |
|
559 | + function($matches) use (&$placeholders) |
|
560 | 560 | { |
561 | 561 | // Skip lone ASCII characters that are not actully part of an emoji sequence. |
562 | 562 | // This can happen because the digits 0-9 and the '*' and '#' characters are |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | // Use placeholders for sanctioned variation selectors. |
588 | 588 | $string = preg_replace_callback( |
589 | 589 | $patterns, |
590 | - function ($matches) use (&$placeholders) |
|
590 | + function($matches) use (&$placeholders) |
|
591 | 591 | { |
592 | 592 | $placeholders[$matches[0]] = "\xEE\xB3\x9B" . md5($matches[0]) . "\xEE\xB3\x9C"; |
593 | 593 | return $placeholders[$matches[0]]; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | // Do the thing. |
668 | 668 | $string = preg_replace_callback( |
669 | 669 | '/' . $pattern . '/u', |
670 | - function ($matches) use ($placeholders) |
|
670 | + function($matches) use ($placeholders) |
|
671 | 671 | { |
672 | 672 | return strtr($matches[0], $placeholders); |
673 | 673 | }, |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | } |
753 | 753 | } |
754 | 754 | // This sort works decently well to ensure widely used scripts are ranked before rare scripts. |
755 | -uasort($funcs['utf8_regex_joining_type']['data'], function ($a, $b) |
|
755 | +uasort($funcs['utf8_regex_joining_type']['data'], function($a, $b) |
|
756 | 756 | { |
757 | 757 | if ($a['stats']['age'] == $b['stats']['age']) |
758 | 758 | { |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | } |
829 | 829 | } |
830 | 830 | // Again, sort commonly used scripts before rare scripts. |
831 | -uasort($funcs['utf8_regex_indic']['data'], function ($a, $b) |
|
831 | +uasort($funcs['utf8_regex_indic']['data'], function($a, $b) |
|
832 | 832 | { |
833 | 833 | if ($a['stats']['age'] == $b['stats']['age']) |
834 | 834 | { |
@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | $class_name = $this->getImplementationClassKeyName(); |
132 | 132 | $class_name_txt_key = strtolower($class_name); |
133 | 133 | |
134 | - $config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings']; |
|
134 | + $config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings']; |
|
135 | 135 | $config_vars[] = array( |
136 | - 'cachedir_'. $class_name_txt_key, |
|
137 | - $txt['cachedir_'. $class_name_txt_key], |
|
136 | + 'cachedir_' . $class_name_txt_key, |
|
137 | + $txt['cachedir_' . $class_name_txt_key], |
|
138 | 138 | 'file', |
139 | 139 | 'text', |
140 | 140 | 36, |
141 | - 'cache_'. $class_name_txt_key .'_cachedir', |
|
141 | + 'cache_' . $class_name_txt_key . '_cachedir', |
|
142 | 142 | ); |
143 | 143 | |
144 | 144 | if (!isset($context['settings_post_javascript'])) |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $context['settings_post_javascript'] .= ' |
148 | 148 | $("#cache_accelerator").change(function (e) { |
149 | 149 | var cache_type = e.currentTarget.value; |
150 | - $("#cachedir_'. $class_name_txt_key .'").prop("disabled", cache_type != "'. $class_name .'"); |
|
150 | + $("#cachedir_'. $class_name_txt_key . '").prop("disabled", cache_type != "' . $class_name . '"); |
|
151 | 151 | });'; |
152 | 152 | } |
153 | 153 |
@@ -156,7 +156,6 @@ discard block |
||
156 | 156 | $diff = $cur_profile['date_registered'] - strtotime(smf_strftime('%Y-%m-%d', $cur_profile['date_registered'])); |
157 | 157 | $value = $value + $diff; |
158 | 158 | } |
159 | - |
|
160 | 159 | else |
161 | 160 | $value = $cur_profile['date_registered']; |
162 | 161 | |
@@ -507,7 +506,7 @@ discard block |
||
507 | 506 | log_error(sprintf($txt['smiley_set_dir_not_found'], $set_names[array_search($set, $context['smiley_sets'])])); |
508 | 507 | |
509 | 508 | $context['smiley_sets'] = array_filter($context['smiley_sets'], function($v) use ($set) |
510 | - { |
|
509 | + { |
|
511 | 510 | return $v != $set; |
512 | 511 | }); |
513 | 512 | } |
@@ -3518,7 +3517,6 @@ discard block |
||
3518 | 3517 | } |
3519 | 3518 | } |
3520 | 3519 | } |
3521 | - |
|
3522 | 3520 | elseif (($value == 'upload' && allowedTo('profile_upload_avatar')) || $downloadedExternalAvatar) |
3523 | 3521 | { |
3524 | 3522 | if ((isset($_FILES['attachment']['name']) && $_FILES['attachment']['name'] != '') || $downloadedExternalAvatar) |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return false; |
93 | 93 | }, |
94 | 94 | 'utf8_version' => '8.0', |
95 | - 'utf8_version_check' => function (){ |
|
95 | + 'utf8_version_check' => function() { |
|
96 | 96 | global $db_connection; |
97 | 97 | $request = pg_query($db_connection, 'SELECT version()'); |
98 | 98 | list ($version) = pg_fetch_row($request); |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | $incontext['continue'] = 1; |
988 | 988 | |
989 | 989 | // Check Postgres setting |
990 | - if ( $db_type === 'postgresql') |
|
990 | + if ($db_type === 'postgresql') |
|
991 | 991 | { |
992 | 992 | load_database(); |
993 | 993 | $result = $smcFunc['db_query']('', ' |
@@ -40,7 +40,8 @@ discard block |
||
40 | 40 | 'mysql' => array( |
41 | 41 | 'name' => 'MySQL', |
42 | 42 | 'version' => '5.6.0', |
43 | - 'version_check' => function() { |
|
43 | + 'version_check' => function() |
|
44 | + { |
|
44 | 45 | global $db_connection; |
45 | 46 | if (!function_exists('mysqli_fetch_row')) |
46 | 47 | return false; |
@@ -56,7 +57,8 @@ discard block |
||
56 | 57 | return true; |
57 | 58 | }, |
58 | 59 | 'utf8_version' => '5.0.22', |
59 | - 'utf8_version_check' => function() { |
|
60 | + 'utf8_version_check' => function() |
|
61 | + { |
|
60 | 62 | global $db_connection; |
61 | 63 | return mysqli_get_server_info($db_connection); |
62 | 64 | }, |
@@ -70,7 +72,8 @@ discard block |
||
70 | 72 | 'postgresql' => array( |
71 | 73 | 'name' => 'PostgreSQL', |
72 | 74 | 'version' => '9.6', |
73 | - 'version_check' => function() { |
|
75 | + 'version_check' => function() |
|
76 | + { |
|
74 | 77 | global $db_connection; |
75 | 78 | $request = pg_query($db_connection, 'SELECT version()'); |
76 | 79 | list ($version) = pg_fetch_row($request); |
@@ -92,7 +95,8 @@ discard block |
||
92 | 95 | return false; |
93 | 96 | }, |
94 | 97 | 'utf8_version' => '8.0', |
95 | - 'utf8_version_check' => function (){ |
|
98 | + 'utf8_version_check' => function () |
|
99 | + { |
|
96 | 100 | global $db_connection; |
97 | 101 | $request = pg_query($db_connection, 'SELECT version()'); |
98 | 102 | list ($version) = pg_fetch_row($request); |
@@ -1001,7 +1005,7 @@ discard block |
||
1001 | 1005 | { |
1002 | 1006 | $row = $smcFunc['db_fetch_assoc']($result); |
1003 | 1007 | if ($row['standard_conforming_strings'] !== 'on') |
1004 | - { |
|
1008 | + { |
|
1005 | 1009 | $incontext['continue'] = 0; |
1006 | 1010 | $incontext['error'] = $txt['error_pg_scs']; |
1007 | 1011 | } |
@@ -3304,7 +3304,7 @@ discard block |
||
3304 | 3304 | // Deleting an existing label? |
3305 | 3305 | elseif (isset($_POST['delete'], $_POST['delete_label'])) |
3306 | 3306 | { |
3307 | - foreach ($_POST['delete_label'] AS $label => $dummy) |
|
3307 | + foreach ($_POST['delete_label'] as $label => $dummy) |
|
3308 | 3308 | { |
3309 | 3309 | unset($the_labels[$label]); |
3310 | 3310 | $labels_to_remove[] = $label; |
@@ -3345,7 +3345,7 @@ discard block |
||
3345 | 3345 | if (!empty($labels_to_add)) |
3346 | 3346 | { |
3347 | 3347 | $inserts = array(); |
3348 | - foreach ($labels_to_add AS $label) |
|
3348 | + foreach ($labels_to_add as $label) |
|
3349 | 3349 | $inserts[] = array($user_info['id'], $label); |
3350 | 3350 | |
3351 | 3351 | $smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array()); |
@@ -3354,7 +3354,7 @@ discard block |
||
3354 | 3354 | // Update existing labels as needed |
3355 | 3355 | if (!empty($label_updates)) |
3356 | 3356 | { |
3357 | - foreach ($label_updates AS $id => $name) |
|
3357 | + foreach ($label_updates as $id => $name) |
|
3358 | 3358 | { |
3359 | 3359 | $smcFunc['db_query']('', ' |
3360 | 3360 | UPDATE {db_prefix}pm_labels |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | ), |
94 | 94 | 'ignore' => array( |
95 | 95 | 'label' => $report['ignore'] ? $txt['mc_reportedp_unignore'] : $txt['mc_reportedp_ignore'], |
96 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;ignore='.(int)!$report['ignore'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-ignore_token_var'].'='.$context['mod-report-ignore_token'], |
|
96 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;ignore=' . (int) !$report['ignore'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-ignore_token_var'] . '=' . $context['mod-report-ignore_token'], |
|
97 | 97 | 'javascript' => !$report['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : '', |
98 | 98 | 'class' => 'you_sure', |
99 | 99 | 'icon' => 'ignore' |
100 | 100 | ), |
101 | 101 | 'close' => array( |
102 | 102 | 'label' => $context['view_closed'] ? $txt['mc_reportedp_open'] : $txt['mc_reportedp_close'], |
103 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;closed='.(int)!$report['closed'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-closed_token_var'].'='.$context['mod-report-closed_token'], |
|
103 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;closed=' . (int) !$report['closed'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-closed_token_var'] . '=' . $context['mod-report-closed_token'], |
|
104 | 104 | 'icon' => $context['view_closed'] ? 'folder' : 'close', |
105 | 105 | ), |
106 | 106 | ); |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | if ($context['report_type'] == 'posts') |
110 | 110 | $context['reports'][$key]['quickbuttons']['delete'] = array( |
111 | 111 | 'label' => $txt['mc_reportedp_delete'], |
112 | - 'href' => $scripturl.'?action=deletemsg;topic='.$report['topic']['id'].'.0;msg='.$report['topic']['id_msg'].';modcenter;'.$context['session_var'].'='.$context['session_id'], |
|
113 | - 'javascript' => 'data-confirm="'.$txt['mc_reportedp_delete_confirm'].'"', |
|
112 | + 'href' => $scripturl . '?action=deletemsg;topic=' . $report['topic']['id'] . '.0;msg=' . $report['topic']['id_msg'] . ';modcenter;' . $context['session_var'] . '=' . $context['session_id'], |
|
113 | + 'javascript' => 'data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '"', |
|
114 | 114 | 'class' => 'you_sure', |
115 | 115 | 'icon' => 'delete', |
116 | 116 | 'show' => !$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])) |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | |
119 | 119 | // Ban reported member/post author link |
120 | 120 | if ($context['report_type'] == 'members') |
121 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add;u='.$report['user']['id'].';'.$context['session_var'].'='.$context['session_id']; |
|
121 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add;u=' . $report['user']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
122 | 122 | else |
123 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add'.(!empty($report['author']['id']) ? ';u='.$report['author']['id'] : ';msg='.$report['topic']['id_msg']).';'.$context['session_var'].'='.$context['session_id']; |
|
123 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add' . (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']) . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
124 | 124 | |
125 | 125 | $context['reports'][$key]['quickbuttons'] += array( |
126 | 126 | 'ban' => array( |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | ), |
132 | 132 | 'quickmod' => array( |
133 | 133 | 'class' => 'inline_mod_check', |
134 | - 'content' => '<input type="checkbox" name="close[]" value="'.$report['id'].'">', |
|
134 | + 'content' => '<input type="checkbox" name="close[]" value="' . $report['id'] . '">', |
|
135 | 135 | 'show' => !$context['view_closed'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 |
136 | 136 | ) |
137 | 137 | ); |