@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | 'type' => 'callback', |
282 | 282 | 'callback_func' => 'birthdate', |
283 | 283 | 'permission' => 'profile_extra', |
284 | - 'preload' => static function () { |
|
284 | + 'preload' => static function() { |
|
285 | 285 | global $cur_profile, $context; |
286 | 286 | |
287 | 287 | // Split up the birth date.... |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | return true; |
296 | 296 | }, |
297 | - 'input_validate' => static function (&$value) { |
|
297 | + 'input_validate' => static function(&$value) { |
|
298 | 298 | global $profile_vars, $cur_profile; |
299 | 299 | |
300 | 300 | if (isset($_POST['bday1'])) |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | 'label' => $txt['date_registered'], |
331 | 331 | 'log_change' => true, |
332 | 332 | 'permission' => 'moderate_forum', |
333 | - 'input_validate' => static function (&$value) { |
|
333 | + 'input_validate' => static function(&$value) { |
|
334 | 334 | global $txt, $modSettings, $cur_profile; |
335 | 335 | |
336 | 336 | // Bad date! Go try again - please? |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | 'subtext' => $txt['valid_email'], |
361 | 361 | 'log_change' => true, |
362 | 362 | 'permission' => 'profile_identity', |
363 | - 'input_validate' => function ($value) { |
|
363 | + 'input_validate' => function($value) { |
|
364 | 364 | global $context, $old_profile, $profile_vars, $modSettings; |
365 | 365 | |
366 | 366 | if (strtolower($value) === strtolower($old_profile['email_address'])) |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | 'value' => empty($cur_profile['hide_email']), |
390 | 390 | 'label' => $txt['allow_user_email'], |
391 | 391 | 'permission' => 'profile_identity', |
392 | - 'input_validate' => static function (&$value) { |
|
392 | + 'input_validate' => static function(&$value) { |
|
393 | 393 | $value = (int) $value === 0 ? 1 : 0; |
394 | 394 | |
395 | 395 | return true; |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | 'callback_func' => 'theme_pick', |
410 | 410 | 'permission' => 'profile_extra', |
411 | 411 | 'enabled' => empty($settings['disable_user_variant']) || !empty($modSettings['theme_allow']) || allowedTo('admin_forum'), |
412 | - 'preload' => static function () { |
|
412 | + 'preload' => static function() { |
|
413 | 413 | global $context, $cur_profile, $txt; |
414 | 414 | |
415 | 415 | $db = database(); |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | |
433 | 433 | return true; |
434 | 434 | }, |
435 | - 'input_validate' => static function (&$value) { |
|
435 | + 'input_validate' => static function(&$value) { |
|
436 | 436 | $value = (int) $value; |
437 | 437 | return true; |
438 | 438 | }, |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | 'callback_func' => 'karma_modify', |
443 | 443 | 'permission' => 'admin_forum', |
444 | 444 | // Set karma_bad too! |
445 | - 'input_validate' => static function (&$value) { |
|
445 | + 'input_validate' => static function(&$value) { |
|
446 | 446 | global $profile_vars, $cur_profile; |
447 | 447 | |
448 | 448 | $value = (int) $value; |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | |
455 | 455 | return true; |
456 | 456 | }, |
457 | - 'preload' => static function () { |
|
457 | + 'preload' => static function() { |
|
458 | 458 | global $context, $cur_profile; |
459 | 459 | |
460 | 460 | $context['member']['karma'] = [ |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | 'preload' => 'profileLoadLanguages', |
475 | 475 | 'enabled' => !empty($modSettings['userLanguage']), |
476 | 476 | 'value' => empty($cur_profile['lngfile']) ? $language : $cur_profile['lngfile'], |
477 | - 'input_validate' => static function (&$value) { |
|
477 | + 'input_validate' => static function(&$value) { |
|
478 | 478 | global $context, $cur_profile; |
479 | 479 | |
480 | 480 | // Load the languages. |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | 'log_change' => true, |
503 | 503 | 'permission' => 'profile_identity', |
504 | 504 | 'prehtml' => allowedTo('admin_forum') && isset($_GET['changeusername']) ? '<div class="warningbox">' . $txt['username_warning'] . '</div>' : '', |
505 | - 'input_validate' => static function (&$value) { |
|
505 | + 'input_validate' => static function(&$value) { |
|
506 | 506 | global $context, $cur_profile; |
507 | 507 | |
508 | 508 | if (allowedTo('admin_forum')) |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | 'permission' => 'profile_identity', |
560 | 560 | 'save_key' => 'passwd', |
561 | 561 | // Note this will only work if passwrd2 also exists! |
562 | - 'input_validate' => static function (&$value) { |
|
562 | + 'input_validate' => static function(&$value) { |
|
563 | 563 | global $cur_profile; |
564 | 564 | |
565 | 565 | // If we didn't try it then ignore it! |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | ], |
629 | 629 | 'subtext' => $txt['receive_from_description'], |
630 | 630 | 'value' => empty($cur_profile['receive_from']) ? 0 : $cur_profile['receive_from'], |
631 | - 'input_validate' => static function (&$value) { |
|
631 | + 'input_validate' => static function(&$value) { |
|
632 | 632 | global $cur_profile, $profile_vars; |
633 | 633 | |
634 | 634 | // Simple validate and apply the two "sub settings" |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | 'callback_func' => 'pm_settings', |
645 | 645 | 'permission' => 'pm_read', |
646 | 646 | 'save_key' => 'pm_prefs', |
647 | - 'preload' => static function () { |
|
647 | + 'preload' => static function() { |
|
648 | 648 | global $context, $cur_profile; |
649 | 649 | |
650 | 650 | $context['display_mode'] = $cur_profile['pm_prefs'] & 3; |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | |
653 | 653 | return true; |
654 | 654 | }, |
655 | - 'input_validate' => static function (&$value) { |
|
655 | + 'input_validate' => static function(&$value) { |
|
656 | 656 | global $cur_profile, $profile_vars; |
657 | 657 | |
658 | 658 | // Simple validate and apply the two "sub settings" |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | 'log_change' => true, |
669 | 669 | 'size' => 7, |
670 | 670 | 'permission' => 'moderate_forum', |
671 | - 'input_validate' => static function (&$value) { |
|
671 | + 'input_validate' => static function(&$value) { |
|
672 | 672 | // Account for comma_format presentation up front |
673 | 673 | $check = strtr($value, [',' => '', '.' => '', ' ' => '']); |
674 | 674 | if (!is_numeric($check)) |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | 'input_attr' => ['maxlength="60"'], |
689 | 689 | 'permission' => 'profile_identity', |
690 | 690 | 'enabled' => !empty($modSettings['allow_editDisplayName']) || allowedTo('moderate_forum'), |
691 | - 'input_validate' => static function (&$value) { |
|
691 | + 'input_validate' => static function(&$value) { |
|
692 | 692 | global $context, $cur_profile; |
693 | 693 | |
694 | 694 | $value = trim(preg_replace('~\s~u', ' ', $value)); |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | 'postinput' => '<span class="smalltext" style="margin-left: 4ex;">[<a href="' . $scripturl . '?action=quickhelp;help=secret_why_blank" onclick="return reqOverlayDiv(this.href);">' . $txt['secret_why_blank'] . '</a>]</span>', |
730 | 730 | 'value' => '', |
731 | 731 | 'permission' => 'profile_identity', |
732 | - 'input_validate' => static function (&$value) { |
|
732 | + 'input_validate' => static function(&$value) { |
|
733 | 733 | global $cur_profile; |
734 | 734 | |
735 | 735 | if (empty($value)) |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | 'callback_func' => 'theme_settings', |
776 | 776 | 'permission' => 'profile_extra', |
777 | 777 | 'is_dummy' => true, |
778 | - 'preload' => static function () { |
|
778 | + 'preload' => static function() { |
|
779 | 779 | global $context; |
780 | 780 | |
781 | 781 | Txt::load('Settings'); |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | 'type' => 'callback', |
795 | 795 | 'callback_func' => 'timeformat_modify', |
796 | 796 | 'permission' => 'profile_extra', |
797 | - 'preload' => static function () { |
|
797 | + 'preload' => static function() { |
|
798 | 798 | global $context, $txt, $cur_profile, $modSettings; |
799 | 799 | |
800 | 800 | $context['easy_timeformats'] = [ |
@@ -817,14 +817,14 @@ discard block |
||
817 | 817 | 'type' => 'callback', |
818 | 818 | 'callback_func' => 'timeoffset_modify', |
819 | 819 | 'permission' => 'profile_extra', |
820 | - 'preload' => static function () { |
|
820 | + 'preload' => static function() { |
|
821 | 821 | global $context, $cur_profile; |
822 | 822 | |
823 | 823 | $context['member']['time_offset'] = $cur_profile['time_offset']; |
824 | 824 | |
825 | 825 | return true; |
826 | 826 | }, |
827 | - 'input_validate' => static function (&$value) { |
|
827 | + 'input_validate' => static function(&$value) { |
|
828 | 828 | // Validate the time_offset... |
829 | 829 | $value = (float) str_replace(',', '.', $value); |
830 | 830 | if ($value < -23.5 || $value > 23.5) |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | 'size' => 50, |
844 | 844 | 'permission' => 'profile_title', |
845 | 845 | 'enabled' => !empty($modSettings['titlesEnable']), |
846 | - 'input_validate' => static function ($value) { |
|
846 | + 'input_validate' => static function($value) { |
|
847 | 847 | if (Util::strlen($value) > 50) |
848 | 848 | { |
849 | 849 | return 'user_title_too_long'; |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | 'size' => 50, |
868 | 868 | 'permission' => 'profile_extra', |
869 | 869 | // Fix the URL... |
870 | - 'input_validate' => static function (&$value) { |
|
870 | + 'input_validate' => static function(&$value) { |
|
871 | 871 | $value = addProtocol($value, ['http://', 'https://', 'ftp://', 'ftps://']); |
872 | 872 | if (strlen($value) < 8) |
873 | 873 | { |
@@ -735,7 +735,7 @@ |
||
735 | 735 | 'value' => '', |
736 | 736 | ], |
737 | 737 | 'data' => [ |
738 | - 'function' => static function ($rowData) { |
|
738 | + 'function' => static function($rowData) { |
|
739 | 739 | if ($rowData['is_image'] && !empty($rowData['id_thumb'])) |
740 | 740 | { |
741 | 741 | return '<img src="' . getUrl('action', ['action' => 'dlattach', 'attach' => $rowData['id_thumb'], 'image']) . '" loading="lazy" />'; |
@@ -314,7 +314,7 @@ |
||
314 | 314 | 'no_member' => 0, |
315 | 315 | ) |
316 | 316 | )->fetch_callback( |
317 | - static function ($row) use (&$posters) { |
|
317 | + static function($row) use (&$posters) { |
|
318 | 318 | $posters[] = $row['id_member']; |
319 | 319 | } |
320 | 320 | ); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | 'on' => 'on', |
195 | 195 | ] |
196 | 196 | )->fetch_callback( |
197 | - function ($row) { |
|
197 | + function($row) { |
|
198 | 198 | $this->context[$row['permission']][$row['id_group']]['status'] = $row['status']; |
199 | 199 | } |
200 | 200 | ); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | 'permissions' => $this->permissionList, |
216 | 216 | ] |
217 | 217 | )->fetch_callback( |
218 | - function ($row) { |
|
218 | + function($row) { |
|
219 | 219 | // Initialize each permission as being 'off' until proven otherwise. |
220 | 220 | foreach ($this->permissions as $permission) |
221 | 221 | { |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | 'time' => !empty($modSettings['drafts_keep_days']) ? (time() - ($modSettings['drafts_keep_days'] * 86400)) : 0, |
333 | 333 | ) |
334 | 334 | )->fetch_callback( |
335 | - function ($row) use (&$number) { |
|
335 | + function($row) use (&$number) { |
|
336 | 336 | $number = (int) $row['number']; |
337 | 337 | } |
338 | 338 | ); |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | 'poster_time_old' => time() - (86400 * $days), |
484 | 484 | ) |
485 | 485 | )->fetch_callback( |
486 | - function ($row) { |
|
486 | + function($row) { |
|
487 | 487 | return (int) $row['id_draft']; |
488 | 488 | } |
489 | 489 | ); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | 'users' => count($to_load) === 1 ? current($to_load) : $to_load, |
231 | 231 | ] |
232 | 232 | )->fetch_callback( |
233 | - function ($row) use (&$new_loaded_ids) { |
|
233 | + function($row) use (&$new_loaded_ids) { |
|
234 | 234 | $row['id_member'] = (int) $row['id_member']; |
235 | 235 | $row['id_group'] = (int) $row['id_group']; |
236 | 236 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | 'loaded_ids' => count($new_loaded_ids) === 1 ? $new_loaded_ids[0] : $new_loaded_ids, |
278 | 278 | ] |
279 | 279 | )->fetch_callback( |
280 | - static function ($row) use (&$data) { |
|
280 | + static function($row) use (&$data) { |
|
281 | 281 | $key = 0; |
282 | 282 | $row['id_member'] = (int) $row['id_member']; |
283 | 283 | if (!empty($row['field_options'])) |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | 'id_member' => $member, |
293 | 293 | ] |
294 | 294 | )->fetch_callback( |
295 | - static function ($row) use ($immutable_theme_data, &$themeData) { |
|
295 | + static function($row) use ($immutable_theme_data, &$themeData) { |
|
296 | 296 | // There are just things we shouldn't be able to change as members. |
297 | 297 | if ((int) $row['id_member'] !== 0 && in_array($row['variable'], $immutable_theme_data, true)) |
298 | 298 | { |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | return; |
529 | 529 | } |
530 | 530 | |
531 | - $context['admin_preferences'] = serializeToJson($options['admin_preferences'], static function ($array_form) { |
|
531 | + $context['admin_preferences'] = serializeToJson($options['admin_preferences'], static function($array_form) { |
|
532 | 532 | global $context; |
533 | 533 | |
534 | 534 | require_once(SUBSDIR . '/Admin.subs.php'); |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | // Update the option. |
556 | 556 | if (($this->user->is_guest === false) && !empty($options['minmax_preferences'])) |
557 | 557 | { |
558 | - $context['minmax_preferences'] = serializeToJson($options['minmax_preferences'], static function ($array_form) { |
|
558 | + $context['minmax_preferences'] = serializeToJson($options['minmax_preferences'], static function($array_form) { |
|
559 | 559 | global $settings; |
560 | 560 | |
561 | 561 | require_once(SUBSDIR . '/Themes.subs.php'); |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | 'theme_guests' => $modSettings['theme_guests'], |
878 | 878 | ] |
879 | 879 | )->fetch_callback( |
880 | - static function ($row) { |
|
880 | + static function($row) { |
|
881 | 881 | global $settings; |
882 | 882 | |
883 | 883 | $settings[$row['variable']] = $row['value']; |
@@ -934,8 +934,7 @@ |
||
934 | 934 | $lang = '', |
935 | 935 | $fatal = false, // @todo reset to true when appropriate |
936 | 936 | $force_reload = false |
937 | - ) |
|
938 | - { |
|
937 | + ) { |
|
939 | 938 | return static::loadLanguageFiles( |
940 | 939 | explode('+', $template_name), |
941 | 940 | $lang, |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | FROM {db_prefix}antispam_questions', |
138 | 138 | [] |
139 | 139 | )->fetch_callback( |
140 | - static function ($row) use (&$modSettings) { |
|
140 | + static function($row) use (&$modSettings) { |
|
141 | 141 | $modSettings['question_id_cache'][$row['language']][] = $row['id_question']; |
142 | 142 | } |
143 | 143 | ); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | 'current_filter' => $this->_filter === null ? '' : $this->_filter['value'], |
252 | 252 | ] |
253 | 253 | )->fetch_callback( |
254 | - static function ($row) use (&$question_answers) { |
|
254 | + static function($row) use (&$question_answers) { |
|
255 | 255 | $question_answers[$row['id_question']] = [ |
256 | 256 | 'id_question' => $row['id_question'], |
257 | 257 | 'question' => $row['question'], |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | 'limit' => count($this->_polls), |
256 | 256 | ) |
257 | 257 | )->fetch_callback( |
258 | - function ($row) use (&$polls) { |
|
258 | + function($row) use (&$polls) { |
|
259 | 259 | $polls[] = array( |
260 | 260 | 'id' => $row['id_poll'], |
261 | 261 | 'topic' => array( |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | 'topics' => $this->_topics, |
347 | 347 | ) |
348 | 348 | )->fetch_callback( |
349 | - static function ($row) use (&$topic_approved, &$first_msg, &$num_replies, &$last_msg, &$num_unapproved) { |
|
349 | + static function($row) use (&$topic_approved, &$first_msg, &$num_replies, &$last_msg, &$num_unapproved) { |
|
350 | 350 | // If this is approved, or is fully unapproved. |
351 | 351 | if ($row['approved'] || !isset($first_msg)) |
352 | 352 | { |