@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | $parameter = strtolower(strtr($smcFunc['htmlspecialchars']($search_params[$param_name], ENT_QUOTES), array('%' => '\%', '_' => '\_', '*' => '%', '?' => '_'))); |
358 | 358 | |
359 | 359 | if ($smcFunc['db_case_sensitive']) |
360 | - $query_parts[] = '(LOWER(' . implode( ') LIKE {string:' . $param_name . '_normal} OR LOWER(', $param_info['db_fields']) . ') LIKE {string:' . $param_name . '_normal})'; |
|
360 | + $query_parts[] = '(LOWER(' . implode(') LIKE {string:' . $param_name . '_normal} OR LOWER(', $param_info['db_fields']) . ') LIKE {string:' . $param_name . '_normal})'; |
|
361 | 361 | else |
362 | - $query_parts[] = '(' . implode( ' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})'; |
|
362 | + $query_parts[] = '(' . implode(' LIKE {string:' . $param_name . '_normal} OR ', $param_info['db_fields']) . ' LIKE {string:' . $param_name . '_normal})'; |
|
363 | 363 | $where_params[$param_name . '_normal'] = '%' . $parameter . '%'; |
364 | 364 | } |
365 | 365 | } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | 'value' => $txt['viewmembers_online'], |
519 | 519 | ), |
520 | 520 | 'data' => array( |
521 | - 'function' => function ($rowData) use ($txt) |
|
521 | + 'function' => function($rowData) use ($txt) |
|
522 | 522 | { |
523 | 523 | // Calculate number of days since last online. |
524 | 524 | if (empty($rowData['last_login'])) |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | 'class' => 'centercol', |
573 | 573 | ), |
574 | 574 | 'data' => array( |
575 | - 'function' => function ($rowData) use ($user_info) |
|
575 | + 'function' => function($rowData) use ($user_info) |
|
576 | 576 | { |
577 | 577 | return '<input type="checkbox" name="delete[]" value="' . $rowData['id_member'] . '" class="input_check"' . ($rowData['id_member'] == $user_info['id'] || $rowData['id_group'] == 1 || in_array(1, explode(',', $rowData['additional_groups'])) ? ' disabled' : '') . '>'; |
578 | 578 | }, |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | 'value' => $txt['hostname'], |
878 | 878 | ), |
879 | 879 | 'data' => array( |
880 | - 'function' => function ($rowData) |
|
880 | + 'function' => function($rowData) |
|
881 | 881 | { |
882 | 882 | return host_from_ip(inet_dtop($rowData['member_ip'])); |
883 | 883 | }, |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | 'value' => $context['current_filter'] == 4 ? $txt['viewmembers_online'] : $txt['date_registered'], |
890 | 890 | ), |
891 | 891 | 'data' => array( |
892 | - 'function' => function ($rowData) use ($context) |
|
892 | + 'function' => function($rowData) use ($context) |
|
893 | 893 | { |
894 | 894 | return timeformat($rowData['' . ($context['current_filter'] == 4 ? 'last_login' : 'date_registered') . '']); |
895 | 895 | }, |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | 'style' => 'width: 20%;', |
907 | 907 | ), |
908 | 908 | 'data' => array( |
909 | - 'function' => function ($rowData) use ($scripturl, $txt) |
|
909 | + 'function' => function($rowData) use ($scripturl, $txt) |
|
910 | 910 | { |
911 | 911 | $member_links = array(); |
912 | 912 | foreach ($rowData['duplicate_members'] as $member) |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | else |
917 | 917 | $member_links[] = $member['name'] . ' (' . $txt['guest'] . ')'; |
918 | 918 | } |
919 | - return implode (', ', $member_links); |
|
919 | + return implode(', ', $member_links); |
|
920 | 920 | }, |
921 | 921 | 'class' => 'smalltext', |
922 | 922 | ), |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'type' => 'callback', |
87 | 87 | 'callback_func' => 'birthdate', |
88 | 88 | 'permission' => 'profile_extra', |
89 | - 'preload' => function () use ($cur_profile, &$context) |
|
89 | + 'preload' => function() use ($cur_profile, &$context) |
|
90 | 90 | { |
91 | 91 | // Split up the birthdate.... |
92 | 92 | list ($uyear, $umonth, $uday) = explode('-', empty($cur_profile['birthdate']) || $cur_profile['birthdate'] == '0001-01-01' ? '0000-00-00' : $cur_profile['birthdate']); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | return true; |
100 | 100 | }, |
101 | - 'input_validate' => function (&$value) use (&$cur_profile, &$profile_vars) |
|
101 | + 'input_validate' => function(&$value) use (&$cur_profile, &$profile_vars) |
|
102 | 102 | { |
103 | 103 | if (isset($_POST['bday2'], $_POST['bday3']) && $value > 0 && $_POST['bday2'] > 0) |
104 | 104 | { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'birthdate' => array( |
121 | 121 | 'type' => 'hidden', |
122 | 122 | 'permission' => 'profile_extra', |
123 | - 'input_validate' => function (&$value) use ($cur_profile) |
|
123 | + 'input_validate' => function(&$value) use ($cur_profile) |
|
124 | 124 | { |
125 | 125 | // @todo Should we check for this year and tell them they made a mistake :P? (based on coppa at least?) |
126 | 126 | if (preg_match('/(\d{4})[\-\., ](\d{2})[\-\., ](\d{2})/', $value, $dates) === 1) |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'label' => $txt['date_registered'], |
142 | 142 | 'log_change' => true, |
143 | 143 | 'permission' => 'moderate_forum', |
144 | - 'input_validate' => function (&$value) use ($txt, $user_info, $modSettings, $cur_profile, $context) |
|
144 | + 'input_validate' => function(&$value) use ($txt, $user_info, $modSettings, $cur_profile, $context) |
|
145 | 145 | { |
146 | 146 | // Bad date! Go try again - please? |
147 | 147 | if (($value = strtotime($value)) === -1) |
@@ -167,13 +167,13 @@ discard block |
||
167 | 167 | 'js_submit' => !empty($modSettings['send_validation_onChange']) ? ' |
168 | 168 | form_handle.addEventListener(\'submit\', function(event) |
169 | 169 | { |
170 | - if (this.email_address.value != "'. $cur_profile['email_address'] .'") |
|
170 | + if (this.email_address.value != "'. $cur_profile['email_address'] . '") |
|
171 | 171 | { |
172 | - alert('. JavaScriptEscape($txt['email_change_logout']) .'); |
|
172 | + alert('. JavaScriptEscape($txt['email_change_logout']) . '); |
|
173 | 173 | return true; |
174 | 174 | } |
175 | 175 | }, false);' : '', |
176 | - 'input_validate' => function (&$value) |
|
176 | + 'input_validate' => function(&$value) |
|
177 | 177 | { |
178 | 178 | global $context, $old_profile, $profile_vars, $sourcedir, $modSettings; |
179 | 179 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | 'callback_func' => 'theme_pick', |
210 | 210 | 'permission' => 'profile_extra', |
211 | 211 | 'enabled' => $modSettings['theme_allow'] || allowedTo('admin_forum'), |
212 | - 'preload' => function () use ($smcFunc, &$context, $cur_profile, $txt) |
|
212 | + 'preload' => function() use ($smcFunc, &$context, $cur_profile, $txt) |
|
213 | 213 | { |
214 | 214 | $request = $smcFunc['db_query']('', ' |
215 | 215 | SELECT value |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | ); |
231 | 231 | return true; |
232 | 232 | }, |
233 | - 'input_validate' => function (&$value) |
|
233 | + 'input_validate' => function(&$value) |
|
234 | 234 | { |
235 | 235 | $value = (int) $value; |
236 | 236 | return true; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | ), |
239 | 239 | 'lngfile' => array( |
240 | 240 | 'type' => 'select', |
241 | - 'options' => function () use (&$context) |
|
241 | + 'options' => function() use (&$context) |
|
242 | 242 | { |
243 | 243 | return $context['profile_languages']; |
244 | 244 | }, |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | 'preload' => 'profileLoadLanguages', |
248 | 248 | 'enabled' => !empty($modSettings['userLanguage']), |
249 | 249 | 'value' => empty($cur_profile['lngfile']) ? $language : $cur_profile['lngfile'], |
250 | - 'input_validate' => function (&$value) use (&$context, $cur_profile) |
|
250 | + 'input_validate' => function(&$value) use (&$context, $cur_profile) |
|
251 | 251 | { |
252 | 252 | // Load the languages. |
253 | 253 | profileLoadLanguages(); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | 'log_change' => true, |
274 | 274 | 'permission' => 'profile_identity', |
275 | 275 | 'prehtml' => allowedTo('admin_forum') && isset($_GET['changeusername']) ? '<div class="alert">' . $txt['username_warning'] . '</div>' : '', |
276 | - 'input_validate' => function (&$value) use ($sourcedir, $context, $user_info, $cur_profile) |
|
276 | + 'input_validate' => function(&$value) use ($sourcedir, $context, $user_info, $cur_profile) |
|
277 | 277 | { |
278 | 278 | if (allowedTo('admin_forum')) |
279 | 279 | { |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | 'permission' => 'profile_password', |
310 | 310 | 'save_key' => 'passwd', |
311 | 311 | // Note this will only work if passwrd2 also exists! |
312 | - 'input_validate' => function (&$value) use ($sourcedir, $user_info, $smcFunc, $cur_profile) |
|
312 | + 'input_validate' => function(&$value) use ($sourcedir, $user_info, $smcFunc, $cur_profile) |
|
313 | 313 | { |
314 | 314 | // If we didn't try it then ignore it! |
315 | 315 | if ($value == '') |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | 'input_attr' => array('maxlength="50"'), |
349 | 349 | 'size' => 50, |
350 | 350 | 'permission' => 'profile_blurb', |
351 | - 'input_validate' => function (&$value) use ($smcFunc) |
|
351 | + 'input_validate' => function(&$value) use ($smcFunc) |
|
352 | 352 | { |
353 | 353 | if ($smcFunc['strlen']($value) > 50) |
354 | 354 | return 'personal_text_too_long'; |
@@ -361,14 +361,14 @@ discard block |
||
361 | 361 | 'type' => 'callback', |
362 | 362 | 'callback_func' => 'pm_settings', |
363 | 363 | 'permission' => 'pm_read', |
364 | - 'preload' => function () use (&$context, $cur_profile) |
|
364 | + 'preload' => function() use (&$context, $cur_profile) |
|
365 | 365 | { |
366 | 366 | $context['display_mode'] = $cur_profile['pm_prefs'] & 3; |
367 | 367 | $context['receive_from'] = !empty($cur_profile['pm_receive_from']) ? $cur_profile['pm_receive_from'] : 0; |
368 | 368 | |
369 | 369 | return true; |
370 | 370 | }, |
371 | - 'input_validate' => function (&$value) use (&$cur_profile, &$profile_vars) |
|
371 | + 'input_validate' => function(&$value) use (&$cur_profile, &$profile_vars) |
|
372 | 372 | { |
373 | 373 | // Simple validate and apply the two "sub settings" |
374 | 374 | $value = max(min($value, 2), 0); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | 'log_change' => true, |
385 | 385 | 'size' => 7, |
386 | 386 | 'permission' => 'moderate_forum', |
387 | - 'input_validate' => function (&$value) |
|
387 | + 'input_validate' => function(&$value) |
|
388 | 388 | { |
389 | 389 | if (!is_numeric($value)) |
390 | 390 | return 'digits_only'; |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | 'input_attr' => array('maxlength="60"'), |
402 | 402 | 'permission' => 'profile_displayed_name', |
403 | 403 | 'enabled' => allowedTo('profile_displayed_name_own') || allowedTo('profile_displayed_name_any') || allowedTo('moderate_forum'), |
404 | - 'input_validate' => function (&$value) use ($context, $smcFunc, $sourcedir, $cur_profile) |
|
404 | + 'input_validate' => function(&$value) use ($context, $smcFunc, $sourcedir, $cur_profile) |
|
405 | 405 | { |
406 | 406 | $value = 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' : ''), ' ', $value)); |
407 | 407 | |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | 'postinput' => '<span class="smalltext"><a href="' . $scripturl . '?action=helpadmin;help=secret_why_blank" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help"></span> ' . $txt['secret_why_blank'] . '</a></span>', |
434 | 434 | 'value' => '', |
435 | 435 | 'permission' => 'profile_password', |
436 | - 'input_validate' => function (&$value) |
|
436 | + 'input_validate' => function(&$value) |
|
437 | 437 | { |
438 | 438 | $value = $value != '' ? md5($value) : ''; |
439 | 439 | return true; |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | 'callback_func' => 'smiley_pick', |
459 | 459 | 'enabled' => !empty($modSettings['smiley_sets_enable']), |
460 | 460 | 'permission' => 'profile_extra', |
461 | - 'preload' => function () use ($modSettings, &$context, $txt, $cur_profile, $smcFunc) |
|
461 | + 'preload' => function() use ($modSettings, &$context, $txt, $cur_profile, $smcFunc) |
|
462 | 462 | { |
463 | 463 | $context['member']['smiley_set']['id'] = empty($cur_profile['smiley_set']) ? '' : $cur_profile['smiley_set']; |
464 | 464 | $context['smiley_sets'] = explode(',', 'none,,' . $modSettings['smiley_sets_known']); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | } |
477 | 477 | return true; |
478 | 478 | }, |
479 | - 'input_validate' => function (&$value) |
|
479 | + 'input_validate' => function(&$value) |
|
480 | 480 | { |
481 | 481 | global $modSettings; |
482 | 482 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | 'callback_func' => 'theme_settings', |
493 | 493 | 'permission' => 'profile_extra', |
494 | 494 | 'is_dummy' => true, |
495 | - 'preload' => function () use (&$context, $user_info, $modSettings) |
|
495 | + 'preload' => function() use (&$context, $user_info, $modSettings) |
|
496 | 496 | { |
497 | 497 | loadLanguage('Settings'); |
498 | 498 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | 'type' => 'callback', |
520 | 520 | 'callback_func' => 'timeformat_modify', |
521 | 521 | 'permission' => 'profile_extra', |
522 | - 'preload' => function () use (&$context, $user_info, $txt, $cur_profile, $modSettings) |
|
522 | + 'preload' => function() use (&$context, $user_info, $txt, $cur_profile, $modSettings) |
|
523 | 523 | { |
524 | 524 | $context['easy_timeformats'] = array( |
525 | 525 | array('format' => '', 'title' => $txt['timeformat_default']), |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | 'options' => smf_list_timezones(), |
543 | 543 | 'permission' => 'profile_extra', |
544 | 544 | 'label' => $txt['timezone'], |
545 | - 'input_validate' => function ($value) |
|
545 | + 'input_validate' => function($value) |
|
546 | 546 | { |
547 | 547 | $tz = smf_list_timezones(); |
548 | 548 | if (!isset($tz[$value])) |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | 'size' => 50, |
560 | 560 | 'permission' => 'profile_title', |
561 | 561 | 'enabled' => !empty($modSettings['titlesEnable']), |
562 | - 'input_validate' => function (&$value) use ($smcFunc) |
|
562 | + 'input_validate' => function(&$value) use ($smcFunc) |
|
563 | 563 | { |
564 | 564 | if ($smcFunc['strlen']($value) > 50) |
565 | 565 | return 'user_title_too_long'; |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | 'size' => 50, |
583 | 583 | 'permission' => 'profile_website', |
584 | 584 | // Fix the URL... |
585 | - 'input_validate' => function (&$value) |
|
585 | + 'input_validate' => function(&$value) |
|
586 | 586 | { |
587 | 587 | if (strlen(trim($value)) > 0 && strpos($value, '://') === false) |
588 | 588 | $value = 'http://' . $value; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | if (this.oldpasswrd.value == "") |
708 | 708 | { |
709 | 709 | event.preventDefault(); |
710 | - alert('. (JavaScriptEscape($txt['required_security_reasons'])) .'); |
|
710 | + alert('. (JavaScriptEscape($txt['required_security_reasons'])) . '); |
|
711 | 711 | return false; |
712 | 712 | } |
713 | 713 | }, false);' : ''), true); |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | if (isset($_POST['ignore_brd'])) |
907 | 907 | { |
908 | 908 | if (!is_array($_POST['ignore_brd'])) |
909 | - $_POST['ignore_brd'] = array ($_POST['ignore_brd']); |
|
909 | + $_POST['ignore_brd'] = array($_POST['ignore_brd']); |
|
910 | 910 | |
911 | 911 | foreach ($_POST['ignore_brd'] as $k => $d) |
912 | 912 | { |
@@ -1872,7 +1872,7 @@ discard block |
||
1872 | 1872 | |
1873 | 1873 | // Now load all the values for this user. |
1874 | 1874 | require_once($sourcedir . '/Subs-Notify.php'); |
1875 | - $prefs = getNotifyPrefs($memID, '', $memID != 0); |
|
1875 | + $prefs = getNotifyPrefs($memID, '', $memID != 0); |
|
1876 | 1876 | |
1877 | 1877 | $context['alert_prefs'] = !empty($prefs[$memID]) ? $prefs[$memID] : array(); |
1878 | 1878 | |
@@ -2171,7 +2171,7 @@ discard block |
||
2171 | 2171 | ); |
2172 | 2172 | |
2173 | 2173 | // Gotta know how many unread alerts are left. |
2174 | - $count = alert_count($memID, true); |
|
2174 | + $count = alert_count($memID, true); |
|
2175 | 2175 | |
2176 | 2176 | updateMemberData($memID, array('alerts' => $count)); |
2177 | 2177 | |
@@ -2206,7 +2206,7 @@ discard block |
||
2206 | 2206 | // Gotta know how many unread alerts are left. |
2207 | 2207 | if ($memID) |
2208 | 2208 | { |
2209 | - $count = alert_count($memID, true); |
|
2209 | + $count = alert_count($memID, true); |
|
2210 | 2210 | |
2211 | 2211 | updateMemberData($memID, array('alerts' => $count)); |
2212 | 2212 | |
@@ -2242,7 +2242,7 @@ discard block |
||
2242 | 2242 | ) |
2243 | 2243 | ); |
2244 | 2244 | |
2245 | - $count = $smcFunc['db_num_rows']($request); |
|
2245 | + $count = $smcFunc['db_num_rows']($request); |
|
2246 | 2246 | $smcFunc['db_free_result']($request); |
2247 | 2247 | |
2248 | 2248 | return $count; |
@@ -2302,7 +2302,7 @@ discard block |
||
2302 | 2302 | 'class' => 'lefttext', |
2303 | 2303 | ), |
2304 | 2304 | 'data' => array( |
2305 | - 'function' => function ($topic) use ($txt) |
|
2305 | + 'function' => function($topic) use ($txt) |
|
2306 | 2306 | { |
2307 | 2307 | $link = $topic['link']; |
2308 | 2308 | |
@@ -2357,7 +2357,7 @@ discard block |
||
2357 | 2357 | 'class' => 'lefttext', |
2358 | 2358 | ), |
2359 | 2359 | 'data' => array( |
2360 | - 'function' => function ($topic) use ($txt) |
|
2360 | + 'function' => function($topic) use ($txt) |
|
2361 | 2361 | { |
2362 | 2362 | $pref = $topic['notify_pref']; |
2363 | 2363 | $mode = !empty($topic['unwatched']) ? 0 : ($pref & 0x02 ? 3 : ($pref & 0x01 ? 2 : 1)); |
@@ -2454,7 +2454,7 @@ discard block |
||
2454 | 2454 | 'class' => 'lefttext', |
2455 | 2455 | ), |
2456 | 2456 | 'data' => array( |
2457 | - 'function' => function ($board) use ($txt) |
|
2457 | + 'function' => function($board) use ($txt) |
|
2458 | 2458 | { |
2459 | 2459 | $link = $board['link']; |
2460 | 2460 | |
@@ -2475,7 +2475,7 @@ discard block |
||
2475 | 2475 | 'class' => 'lefttext', |
2476 | 2476 | ), |
2477 | 2477 | 'data' => array( |
2478 | - 'function' => function ($board) use ($txt) |
|
2478 | + 'function' => function($board) use ($txt) |
|
2479 | 2479 | { |
2480 | 2480 | $pref = $board['notify_pref']; |
2481 | 2481 | $mode = $pref & 0x02 ? 3 : ($pref & 0x01 ? 2 : 1); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | // Prepare the pagination vars. |
369 | 369 | $maxIndex = 10; |
370 | 370 | $start = (int) isset($_REQUEST['start']) ? $_REQUEST['start'] : 0; |
371 | - $count = alert_count($memID); |
|
371 | + $count = alert_count($memID); |
|
372 | 372 | |
373 | 373 | // Get the alerts. |
374 | 374 | $context['alerts'] = fetch_alerts($memID, true, false, array('start' => $start, 'maxIndex' => $maxIndex)); |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | ), |
834 | 834 | ), |
835 | 835 | 'data_check' => array( |
836 | - 'class' => function ($data) |
|
836 | + 'class' => function($data) |
|
837 | 837 | { |
838 | 838 | return $data['approved'] ? '' : 'approvebg'; |
839 | 839 | } |
@@ -1536,7 +1536,7 @@ discard block |
||
1536 | 1536 | ), |
1537 | 1537 | 'data' => array( |
1538 | 1538 | 'sprintf' => array( |
1539 | - 'format' => '<a href="' . $scripturl . '?action=profile;area=tracking;sa=ip;searchip=%1$s;u=' . $memID. '">%1$s</a>', |
|
1539 | + 'format' => '<a href="' . $scripturl . '?action=profile;area=tracking;sa=ip;searchip=%1$s;u=' . $memID . '">%1$s</a>', |
|
1540 | 1540 | 'params' => array( |
1541 | 1541 | 'ip' => false, |
1542 | 1542 | ), |
@@ -111,7 +111,7 @@ |
||
111 | 111 | require_once($sourcedir . '/Subs-Post.php'); |
112 | 112 | |
113 | 113 | $errors = array(); |
114 | - $news = !isset($_POST['news'])? '' : $smcFunc['htmlspecialchars']($_POST['news'], ENT_QUOTES); |
|
114 | + $news = !isset($_POST['news']) ? '' : $smcFunc['htmlspecialchars']($_POST['news'], ENT_QUOTES); |
|
115 | 115 | if (empty($news)) |
116 | 116 | $errors[] = array('value' => 'no_news'); |
117 | 117 | else |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if (filemtime($boarddir . '/db_last_error.php') === $last_db_error_change) |
176 | 176 | { |
177 | 177 | // Write the change |
178 | - $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
178 | + $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
179 | 179 | $written_bytes = file_put_contents($boarddir . '/db_last_error.php', $write_db_change, LOCK_EX); |
180 | 180 | |
181 | 181 | // survey says ... |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | ', $txt['debug_language_files'], count($context['debug']['language_files']), ': <em>', implode('</em>, <em>', $context['debug']['language_files']), '</em>.<br> |
249 | 249 | ', $txt['debug_stylesheets'], count($context['debug']['sheets']), ': <em>', implode('</em>, <em>', $context['debug']['sheets']), '</em>.<br> |
250 | 250 | ', $txt['debug_hooks'], empty($context['debug']['hooks']) ? 0 : count($context['debug']['hooks']) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_hooks\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_hooks" style="display: none;"><em>' . implode('</em>, <em>', $context['debug']['hooks']), '</em></span>)', '<br> |
251 | - ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">'. $txt['debug_show'] .'</a><span id="debug_instances" style="display: none;"><em>'. implode('</em>, <em>', array_keys($context['debug']['instances'])) .'</em></span>)'. '<br>') : ''),' |
|
251 | + ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">' . $txt['debug_show'] . '</a><span id="debug_instances" style="display: none;"><em>' . implode('</em>, <em>', array_keys($context['debug']['instances'])) . '</em></span>)' . '<br>') : ''), ' |
|
252 | 252 | ', $txt['debug_files_included'], count($files), ' - ', round($total_size / 1024), $txt['debug_kb'], ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_include_info\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_include_info" style="display: none;"><em>', implode('</em>, <em>', $files), '</em></span>)<br>'; |
253 | 253 | |
254 | 254 | if (function_exists('memory_get_peak_usage')) |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if (!empty($db_options['persist'])) |
64 | 64 | $connection = @pg_pconnect('host=' . $db_server . ' dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
65 | 65 | else |
66 | - $connection = @pg_connect( 'host=' . $db_server . ' dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
|
66 | + $connection = @pg_connect('host=' . $db_server . ' dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
|
67 | 67 | |
68 | 68 | // Something's wrong, show an error if its fatal (which we assume it is) |
69 | 69 | if (!$connection) |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @param string $type Indicates which additional file to load. ('extra', 'packages') |
89 | 89 | */ |
90 | -function db_extend ($type = 'extra') |
|
90 | +function db_extend($type = 'extra') |
|
91 | 91 | { |
92 | 92 | global $sourcedir, $db_type; |
93 | 93 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param string $db_prefix The database prefix |
104 | 104 | * @param string $db_name The database name |
105 | 105 | */ |
106 | -function db_fix_prefix (&$db_prefix, $db_name) |
|
106 | +function db_fix_prefix(&$db_prefix, $db_name) |
|
107 | 107 | { |
108 | 108 | return; |
109 | 109 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $replacement[$key] = 'null'; |
236 | 236 | if (!isValidIP($value)) |
237 | 237 | smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__); |
238 | - $replacement[$key] = sprintf('\'%1$s\'::inet', pg_escape_string($value)); |
|
238 | + $replacement[$key] = sprintf('\'%1$s\'::inet', pg_escape_string($value)); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | return implode(', ', $replacement); |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | |
549 | 549 | // Log the error. |
550 | 550 | if (function_exists('log_error')) |
551 | - log_error($txt['database_error'] . ': ' . $query_error . (!empty($modSettings['enableErrorQueryLogging']) ? "\n\n" .$db_string : ''), 'database', $file, $line); |
|
551 | + log_error($txt['database_error'] . ': ' . $query_error . (!empty($modSettings['enableErrorQueryLogging']) ? "\n\n" . $db_string : ''), 'database', $file, $line); |
|
552 | 552 | |
553 | 553 | // Nothing's defined yet... just die with it. |
554 | 554 | if (empty($context) || empty($txt)) |
@@ -684,31 +684,31 @@ discard block |
||
684 | 684 | static $pg_version; |
685 | 685 | static $replace_support; |
686 | 686 | |
687 | - if(empty($pg_version)) |
|
687 | + if (empty($pg_version)) |
|
688 | 688 | { |
689 | 689 | db_extend(); |
690 | 690 | //pg 9.5 got replace support |
691 | 691 | $pg_version = $smcFunc['db_get_version'](); |
692 | 692 | // if we got a Beta Version |
693 | 693 | if (stripos($pg_version, 'beta') !== false) |
694 | - $pg_version = substr($pg_version, 0, stripos($pg_version, 'beta')).'.0'; |
|
694 | + $pg_version = substr($pg_version, 0, stripos($pg_version, 'beta')) . '.0'; |
|
695 | 695 | // or RC |
696 | 696 | if (stripos($pg_version, 'rc') !== false) |
697 | - $pg_version = substr($pg_version, 0, stripos($pg_version, 'rc')).'.0'; |
|
697 | + $pg_version = substr($pg_version, 0, stripos($pg_version, 'rc')) . '.0'; |
|
698 | 698 | |
699 | - $replace_support = (version_compare($pg_version,'9.5.0','>=') ? true : false); |
|
699 | + $replace_support = (version_compare($pg_version, '9.5.0', '>=') ? true : false); |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | $count = 0; |
703 | 703 | $where = ''; |
704 | 704 | $count_pk = 0; |
705 | 705 | |
706 | - If($replace_support) |
|
706 | + If ($replace_support) |
|
707 | 707 | { |
708 | 708 | foreach ($columns as $columnName => $type) |
709 | 709 | { |
710 | 710 | //check pk fiel |
711 | - IF(in_array($columnName, $keys)) |
|
711 | + IF (in_array($columnName, $keys)) |
|
712 | 712 | { |
713 | 713 | $key_str .= ($count_pk > 0 ? ',' : ''); |
714 | 714 | $key_str .= $columnName; |
@@ -717,11 +717,11 @@ discard block |
||
717 | 717 | else //normal field |
718 | 718 | { |
719 | 719 | $col_str .= ($count > 0 ? ',' : ''); |
720 | - $col_str .= $columnName.' = EXCLUDED.'.$columnName; |
|
720 | + $col_str .= $columnName . ' = EXCLUDED.' . $columnName; |
|
721 | 721 | $count++; |
722 | 722 | } |
723 | 723 | } |
724 | - $replace = ' ON CONFLICT ('.$key_str.') DO UPDATE SET '.$col_str; |
|
724 | + $replace = ' ON CONFLICT (' . $key_str . ') DO UPDATE SET ' . $col_str; |
|
725 | 725 | } |
726 | 726 | else |
727 | 727 | { |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | $smcFunc['db_query']('', ' |
782 | 782 | INSERT INTO ' . $table . '("' . implode('", "', $indexed_columns) . '") |
783 | 783 | VALUES |
784 | - ' . $entry.$replace, |
|
784 | + ' . $entry . $replace, |
|
785 | 785 | array( |
786 | 786 | 'security_override' => true, |
787 | 787 | 'db_error_skip' => $method == 'ignore' || $table === $db_prefix . 'log_errors', |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | * @param bool $translate_human_wildcards If true, turns human readable wildcards into SQL wildcards. |
877 | 877 | * @return string The escaped string |
878 | 878 | */ |
879 | -function smf_db_escape_wildcard_string($string, $translate_human_wildcards=false) |
|
879 | +function smf_db_escape_wildcard_string($string, $translate_human_wildcards = false) |
|
880 | 880 | { |
881 | 881 | $replacements = array( |
882 | 882 | '%' => '\%', |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | else |
238 | 238 | { |
239 | 239 | $query_this_board = '{query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? ' |
240 | - AND b.id_board != {int:recycle_board}' : ''). ' |
|
240 | + AND b.id_board != {int:recycle_board}' : '') . ' |
|
241 | 241 | AND m.id_msg >= {int:max_id_msg}'; |
242 | 242 | $query_parameters['max_id_msg'] = max(0, $modSettings['maxMsgID'] - 100 - $_REQUEST['start'] * 6); |
243 | 243 | $query_parameters['recycle_board'] = $modSettings['recycle_board']; |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | ); |
1125 | 1125 | else |
1126 | 1126 | $request = $smcFunc['db_query']('', ' |
1127 | - SELECT DISTINCT t.id_topic,'.$_REQUEST['sort'].' |
|
1127 | + SELECT DISTINCT t.id_topic,'.$_REQUEST['sort'] . ' |
|
1128 | 1128 | FROM {db_prefix}topics AS t |
1129 | 1129 | INNER JOIN {db_prefix}messages AS m ON (m.id_topic = t.id_topic AND m.id_member = {int:current_member})' . (strpos($_REQUEST['sort'], 'ms.') === false ? '' : ' |
1130 | 1130 | INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)') . (strpos($_REQUEST['sort'], 'mems.') === false ? '' : ' |
@@ -1391,7 +1391,7 @@ discard block |
||
1391 | 1391 | if ($is_topics) |
1392 | 1392 | { |
1393 | 1393 | $context['recent_buttons'] = array( |
1394 | - 'markread' => array('text' => !empty($context['no_board_limits']) ? 'mark_as_read' : 'mark_read_short', 'image' => 'markread.png', 'custom' => 'data-confirm="'. $txt['are_sure_mark_read'] .'"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=' . (!empty($context['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
1394 | + 'markread' => array('text' => !empty($context['no_board_limits']) ? 'mark_as_read' : 'mark_read_short', 'image' => 'markread.png', 'custom' => 'data-confirm="' . $txt['are_sure_mark_read'] . '"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=' . (!empty($context['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
1395 | 1395 | ); |
1396 | 1396 | |
1397 | 1397 | if ($context['showCheckboxes']) |
@@ -1407,7 +1407,7 @@ discard block |
||
1407 | 1407 | elseif (!$is_topics && isset($context['topics_to_mark'])) |
1408 | 1408 | { |
1409 | 1409 | $context['recent_buttons'] = array( |
1410 | - 'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'custom' => 'data-confirm="'. $txt['are_sure_mark_read'] .'"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
1410 | + 'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'custom' => 'data-confirm="' . $txt['are_sure_mark_read'] . '"', 'class' => 'you_sure', 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';' . $context['session_var'] . '=' . $context['session_id']), |
|
1411 | 1411 | ); |
1412 | 1412 | |
1413 | 1413 | if ($context['showCheckboxes']) |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | 'class' => 'centercol', |
257 | 257 | ), |
258 | 258 | 'data' => array( |
259 | - 'function' => function ($entry) |
|
259 | + 'function' => function($entry) |
|
260 | 260 | { |
261 | 261 | return '<input type="checkbox" class="input_check" name="delete[]" value="' . $entry['id'] . '"' . ($entry['editable'] ? '' : ' disabled') . '>'; |
262 | 262 | }, |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | if (empty($entries[$k]['action_text'])) |
639 | 639 | $entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action']; |
640 | 640 | $entries[$k]['action_text'] = preg_replace_callback('~\{([A-Za-z\d_]+)\}~i', |
641 | - function ($matches) use ($entries, $k) |
|
641 | + function($matches) use ($entries, $k) |
|
642 | 642 | { |
643 | 643 | return isset($entries[$k]['extra'][$matches[1]]) ? $entries[$k]['extra'][$matches[1]] : ''; |
644 | 644 | }, $entries[$k]['action_text']); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function get($property = '') |
168 | 168 | { |
169 | 169 | // All properties inside Likes are protected, thus, an underscore is used. |
170 | - $property = '_'. $property; |
|
170 | + $property = '_' . $property; |
|
171 | 171 | return property_exists($this, $property) ? $this->$property : false; |
172 | 172 | } |
173 | 173 | |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | |
572 | 572 | // Nope? then just do a redirect to whatever URL was provided. |
573 | 573 | else |
574 | - redirectexit(!empty($this->_validLikes['redirect']) ? $this->_validLikes['redirect'] .';error='. $this->_error : ''); |
|
574 | + redirectexit(!empty($this->_validLikes['redirect']) ? $this->_validLikes['redirect'] . ';error=' . $this->_error : ''); |
|
575 | 575 | |
576 | 576 | return; |
577 | 577 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | if (in_array($this->_sa, $generic)) |
589 | 589 | { |
590 | 590 | $context['sub_template'] = 'generic'; |
591 | - $context['data'] = isset($txt['like_'. $this->_data]) ? $txt['like_'. $this->_data] : $this->_data; |
|
591 | + $context['data'] = isset($txt['like_' . $this->_data]) ? $txt['like_' . $this->_data] : $this->_data; |
|
592 | 592 | } |
593 | 593 | |
594 | 594 | // Directly pass the current called sub-action and the data generated by its associated Method. |