@@ -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'])) |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | 'callback_func' => 'theme_pick', |
| 399 | 399 | 'permission' => 'profile_extra', |
| 400 | 400 | 'enabled' => empty($settings['disable_user_variant']) || !empty($modSettings['theme_allow']) || allowedTo('admin_forum'), |
| 401 | - 'preload' => static function () { |
|
| 401 | + 'preload' => static function() { |
|
| 402 | 402 | global $context, $cur_profile, $txt; |
| 403 | 403 | |
| 404 | 404 | $db = database(); |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | |
| 422 | 422 | return true; |
| 423 | 423 | }, |
| 424 | - 'input_validate' => static function (&$value) { |
|
| 424 | + 'input_validate' => static function(&$value) { |
|
| 425 | 425 | $value = (int) $value; |
| 426 | 426 | return true; |
| 427 | 427 | }, |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | 'callback_func' => 'karma_modify', |
| 432 | 432 | 'permission' => 'admin_forum', |
| 433 | 433 | // Set karma_bad too! |
| 434 | - 'input_validate' => static function (&$value) { |
|
| 434 | + 'input_validate' => static function(&$value) { |
|
| 435 | 435 | global $profile_vars, $cur_profile; |
| 436 | 436 | |
| 437 | 437 | $value = (int) $value; |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | |
| 444 | 444 | return true; |
| 445 | 445 | }, |
| 446 | - 'preload' => static function () { |
|
| 446 | + 'preload' => static function() { |
|
| 447 | 447 | global $context, $cur_profile; |
| 448 | 448 | |
| 449 | 449 | $context['member']['karma'] = [ |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | 'preload' => 'profileLoadLanguages', |
| 464 | 464 | 'enabled' => !empty($modSettings['userLanguage']), |
| 465 | 465 | 'value' => empty($cur_profile['lngfile']) ? Util::ucfirst($language) . '.php' : Util::ucfirst(basename($cur_profile['lngfile'], '.php')) . '.php', |
| 466 | - 'input_validate' => static function (&$value) { |
|
| 466 | + 'input_validate' => static function(&$value) { |
|
| 467 | 467 | global $context, $cur_profile; |
| 468 | 468 | |
| 469 | 469 | // Load the languages. |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | 'log_change' => true, |
| 492 | 492 | 'permission' => 'profile_identity', |
| 493 | 493 | 'prehtml' => allowedTo('admin_forum') && isset($_GET['changeusername']) ? '<div class="warningbox">' . $txt['username_warning'] . '</div>' : '', |
| 494 | - 'input_validate' => static function (&$value) { |
|
| 494 | + 'input_validate' => static function(&$value) { |
|
| 495 | 495 | global $context, $cur_profile; |
| 496 | 496 | |
| 497 | 497 | if (allowedTo('admin_forum')) |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | 'permission' => 'profile_identity', |
| 549 | 549 | 'save_key' => 'passwd', |
| 550 | 550 | // Note this will only work if passwrd2 also exists! |
| 551 | - 'input_validate' => static function (&$value) { |
|
| 551 | + 'input_validate' => static function(&$value) { |
|
| 552 | 552 | global $cur_profile; |
| 553 | 553 | |
| 554 | 554 | // If we didn't try it then ignore it! |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | ], |
| 618 | 618 | 'subtext' => $txt['receive_from_description'], |
| 619 | 619 | 'value' => empty($cur_profile['receive_from']) ? 0 : $cur_profile['receive_from'], |
| 620 | - 'input_validate' => static function (&$value) { |
|
| 620 | + 'input_validate' => static function(&$value) { |
|
| 621 | 621 | global $cur_profile, $profile_vars; |
| 622 | 622 | |
| 623 | 623 | // Simple validate and apply the two "sub settings" |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | 'callback_func' => 'pm_settings', |
| 634 | 634 | 'permission' => 'pm_read', |
| 635 | 635 | 'save_key' => 'pm_prefs', |
| 636 | - 'preload' => static function () { |
|
| 636 | + 'preload' => static function() { |
|
| 637 | 637 | global $context, $cur_profile; |
| 638 | 638 | |
| 639 | 639 | $context['display_mode'] = $cur_profile['pm_prefs'] & 3; |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | return true; |
| 643 | 643 | }, |
| 644 | - 'input_validate' => static function (&$value) { |
|
| 644 | + 'input_validate' => static function(&$value) { |
|
| 645 | 645 | global $cur_profile, $profile_vars; |
| 646 | 646 | |
| 647 | 647 | // Simple validate and apply the two "sub settings" |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | 'log_change' => true, |
| 658 | 658 | 'size' => 7, |
| 659 | 659 | 'permission' => 'moderate_forum', |
| 660 | - 'input_validate' => static function (&$value) { |
|
| 660 | + 'input_validate' => static function(&$value) { |
|
| 661 | 661 | // Account for comma_format presentation up front |
| 662 | 662 | $check = strtr($value, [',' => '', '.' => '', ' ' => '']); |
| 663 | 663 | if (!is_numeric($check)) |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | 'input_attr' => ['maxlength="60"'], |
| 678 | 678 | 'permission' => 'profile_identity', |
| 679 | 679 | 'enabled' => !empty($modSettings['allow_editDisplayName']) || allowedTo('moderate_forum'), |
| 680 | - 'input_validate' => static function (&$value) { |
|
| 680 | + 'input_validate' => static function(&$value) { |
|
| 681 | 681 | global $context, $cur_profile; |
| 682 | 682 | |
| 683 | 683 | $value = trim(preg_replace('~\s~u', ' ', $value)); |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | '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>', |
| 719 | 719 | 'value' => '', |
| 720 | 720 | 'permission' => 'profile_identity', |
| 721 | - 'input_validate' => static function (&$value) { |
|
| 721 | + 'input_validate' => static function(&$value) { |
|
| 722 | 722 | global $cur_profile; |
| 723 | 723 | |
| 724 | 724 | if (empty($value)) |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | 'callback_func' => 'theme_settings', |
| 765 | 765 | 'permission' => 'profile_extra', |
| 766 | 766 | 'is_dummy' => true, |
| 767 | - 'preload' => static function () { |
|
| 767 | + 'preload' => static function() { |
|
| 768 | 768 | global $context; |
| 769 | 769 | |
| 770 | 770 | Txt::load('Settings'); |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | 'type' => 'callback', |
| 784 | 784 | 'callback_func' => 'timeformat_modify', |
| 785 | 785 | 'permission' => 'profile_extra', |
| 786 | - 'preload' => static function () { |
|
| 786 | + 'preload' => static function() { |
|
| 787 | 787 | global $context, $txt, $cur_profile, $modSettings; |
| 788 | 788 | |
| 789 | 789 | $context['easy_timeformats'] = [ |
@@ -806,14 +806,14 @@ discard block |
||
| 806 | 806 | 'type' => 'callback', |
| 807 | 807 | 'callback_func' => 'timeoffset_modify', |
| 808 | 808 | 'permission' => 'profile_extra', |
| 809 | - 'preload' => static function () { |
|
| 809 | + 'preload' => static function() { |
|
| 810 | 810 | global $context, $cur_profile; |
| 811 | 811 | |
| 812 | 812 | $context['member']['time_offset'] = $cur_profile['time_offset']; |
| 813 | 813 | |
| 814 | 814 | return true; |
| 815 | 815 | }, |
| 816 | - 'input_validate' => static function (&$value) { |
|
| 816 | + 'input_validate' => static function(&$value) { |
|
| 817 | 817 | // Validate the time_offset... |
| 818 | 818 | $value = (float) str_replace(',', '.', $value); |
| 819 | 819 | if ($value < -23.5 || $value > 23.5) |
@@ -832,7 +832,7 @@ discard block |
||
| 832 | 832 | 'size' => 50, |
| 833 | 833 | 'permission' => 'profile_title', |
| 834 | 834 | 'enabled' => !empty($modSettings['titlesEnable']), |
| 835 | - 'input_validate' => static function ($value) { |
|
| 835 | + 'input_validate' => static function($value) { |
|
| 836 | 836 | if (Util::strlen($value) > 50) |
| 837 | 837 | { |
| 838 | 838 | return 'user_title_too_long'; |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | 'size' => 50, |
| 857 | 857 | 'permission' => 'profile_extra', |
| 858 | 858 | // Fix the URL... |
| 859 | - 'input_validate' => static function (&$value) { |
|
| 859 | + 'input_validate' => static function(&$value) { |
|
| 860 | 860 | $value = addProtocol($value, ['http://', 'https://', 'ftp://', 'ftps://']); |
| 861 | 861 | if (strlen($value) < 8) |
| 862 | 862 | { |