@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | 'not_guest' => 0, |
| 314 | 314 | ) |
| 315 | 315 | )->fetch_callback( |
| 316 | - function ($row) use (&$pollOptions) { |
|
| 316 | + function($row) use (&$pollOptions) { |
|
| 317 | 317 | $row['label'] = censor($row['label']); |
| 318 | 318 | $pollOptions[$row['id_choice']] = $row; |
| 319 | 319 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | 'id_poll' => $id_poll, |
| 345 | 345 | ) |
| 346 | 346 | )->fetch_callback( |
| 347 | - function ($row) use (&$pollOptions) { |
|
| 347 | + function($row) use (&$pollOptions) { |
|
| 348 | 348 | $row['label'] = censor($row['label']); |
| 349 | 349 | $pollOptions[$row['id_choice']] = $row; |
| 350 | 350 | } |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | 'id_poll' => $id_poll, |
| 728 | 728 | ) |
| 729 | 729 | )->fetch_callback( |
| 730 | - function ($row) use (&$pollOptions) { |
|
| 730 | + function($row) use (&$pollOptions) { |
|
| 731 | 731 | $pollOptions[] = $row[0]; |
| 732 | 732 | } |
| 733 | 733 | ); |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | 'id_poll' => $id_poll, |
| 793 | 793 | ) |
| 794 | 794 | )->fetch_callback( |
| 795 | - function ($row) use (&$choices, &$number) { |
|
| 795 | + function($row) use (&$choices, &$number) { |
|
| 796 | 796 | $row['label'] = censor($row['label']); |
| 797 | 797 | $choices[$row['id_choice']] = array( |
| 798 | 798 | 'id' => $row['id_choice'], |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | 'smiley_list' => $smileys, |
| 44 | 44 | ] |
| 45 | 45 | )->fetch_callback( |
| 46 | - function ($row) use (&$found) { |
|
| 46 | + function($row) use (&$found) { |
|
| 47 | 47 | $found[] = $row['filename']; |
| 48 | 48 | } |
| 49 | 49 | ); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | 'current_smiley' => $id, |
| 213 | 213 | ] |
| 214 | 214 | )->fetch_callback( |
| 215 | - function ($row) use (&$current_smiley) |
|
| 215 | + function($row) use (&$current_smiley) |
|
| 216 | 216 | { |
| 217 | 217 | $current_smiley = [ |
| 218 | 218 | 'id' => $row['id'], |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | 'hidden' => 1, |
| 381 | 381 | ] |
| 382 | 382 | )->fetch_callback( |
| 383 | - function ($row) use (&$smileys) { |
|
| 383 | + function($row) use (&$smileys) { |
|
| 384 | 384 | global $context; |
| 385 | 385 | |
| 386 | 386 | $location = empty($row['hidden']) ? 'postform' : 'popup'; |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | { |
| 630 | 630 | global $modSettings; |
| 631 | 631 | |
| 632 | - $smiley_types = ['jpg', 'gif', 'jpeg', 'png', 'webp', 'svg']; |
|
| 632 | + $smiley_types = ['jpg', 'gif', 'jpeg', 'png', 'webp', 'svg']; |
|
| 633 | 633 | $smileys_dir = empty($modSettings['smileys_dir']) ? BOARDDIR . '/smileys' : $modSettings['smileys_dir']; |
| 634 | 634 | $fileFunc = FileFunctions::instance(); |
| 635 | 635 | $extensionTypes = []; |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | ORDER BY smiley_row, smiley_order', |
| 688 | 688 | [] |
| 689 | 689 | )->fetch_callback( |
| 690 | - function ($row) use (&$smileys, $context) { |
|
| 690 | + function($row) use (&$smileys, $context) { |
|
| 691 | 691 | $filename = $row['filename'] . '.' . $context['smiley_extension']; |
| 692 | 692 | if (possibleSmileEmoji($row)) |
| 693 | 693 | { |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | if ($test !== $row['filename'] && preg_match('~data-emoji-code=["\'](.*?)["\']~', $test, $result)) |
| 739 | 739 | { |
| 740 | 740 | // Valid emoji, set the filename to the proper emoji file and type |
| 741 | - $row['emoji'] = $result[1]; |
|
| 741 | + $row['emoji'] = $result[1]; |
|
| 742 | 742 | return true; |
| 743 | 743 | } |
| 744 | 744 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | 'guest' => $txt['guest'], |
| 91 | 91 | )) |
| 92 | 92 | )->fetch_callback( |
| 93 | - function ($row) use (&$subscribers) { |
|
| 93 | + function($row) use (&$subscribers) { |
|
| 94 | 94 | global $txt; |
| 95 | 95 | |
| 96 | 96 | $subscribers[] = array( |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | 'current_time' => time(), |
| 150 | 150 | ) |
| 151 | 151 | )->fetch_callback( |
| 152 | - function ($row) use (&$groups) { |
|
| 152 | + function($row) use (&$groups) { |
|
| 153 | 153 | // Specific primary group? |
| 154 | 154 | if ($row['id_group'] != 0) |
| 155 | 155 | { |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | FROM {db_prefix}subscriptions', |
| 486 | 486 | array() |
| 487 | 487 | )->fetch_callback( |
| 488 | - function ($row) { |
|
| 488 | + function($row) { |
|
| 489 | 489 | global $context, $modSettings, $txt; |
| 490 | 490 | |
| 491 | 491 | // Pick a cost. |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | GROUP BY id_subscribe, status', |
| 556 | 556 | array() |
| 557 | 557 | )->fetch_callback( |
| 558 | - function ($row) { |
|
| 558 | + function($row) { |
|
| 559 | 559 | global $context; |
| 560 | 560 | |
| 561 | 561 | $ind = $row['status'] == 0 ? 'finished' : 'total'; |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | GROUP BY id_subscribe', |
| 576 | 576 | array() |
| 577 | 577 | )->fetch_callback( |
| 578 | - function ($row) { |
|
| 578 | + function($row) { |
|
| 579 | 579 | global $context; |
| 580 | 580 | |
| 581 | 581 | if (isset($context['subscriptions'][$row['id_subscribe']])) |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | 'selected_member' => $memID, |
| 610 | 610 | ) |
| 611 | 611 | )->fetch_callback( |
| 612 | - function ($row) use (&$current, $active_subscriptions) { |
|
| 612 | + function($row) use (&$current, $active_subscriptions) { |
|
| 613 | 613 | global $txt; |
| 614 | 614 | |
| 615 | 615 | // The subscription must exist! |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | 'guest' => $txt['guest'], |
| 671 | 671 | ) |
| 672 | 672 | )->fetch_callback( |
| 673 | - function ($row) use (&$members) { |
|
| 673 | + function($row) use (&$members) { |
|
| 674 | 674 | $members[$row['id_member']] = $row; |
| 675 | 675 | } |
| 676 | 676 | ); |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | 'current_subscription' => $sub_id, |
| 884 | 884 | ) |
| 885 | 885 | )->fetch_callback( |
| 886 | - function ($row) use (&$subscription) { |
|
| 886 | + function($row) use (&$subscription) { |
|
| 887 | 887 | // Sort the date. |
| 888 | 888 | preg_match('~(\d*)(\w)~', $row['length'], $match); |
| 889 | 889 | if (isset($match[2])) |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | 'subscription_list' => $toDelete, |
| 1112 | 1112 | ) |
| 1113 | 1113 | )->fetch_callback( |
| 1114 | - function ($row) use (&$delete) { |
|
| 1114 | + function($row) use (&$delete) { |
|
| 1115 | 1115 | $delete[$row['id_subscribe']] = $row['id_member']; |
| 1116 | 1116 | } |
| 1117 | 1117 | ); |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | 'is_active' => 1, |
| 1322 | 1322 | ) |
| 1323 | 1323 | )->fetch_callback( |
| 1324 | - function ($row) use (&$removals, &$allowed, &$member, &$new_id_group, $id_subscribe) { |
|
| 1324 | + function($row) use (&$removals, &$allowed, &$member, &$new_id_group, $id_subscribe) { |
|
| 1325 | 1325 | global $context; |
| 1326 | 1326 | |
| 1327 | 1327 | if (!isset($context['subscriptions'][$row['id_subscribe']])) |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | return false; |
| 343 | 343 | } |
| 344 | 344 | if (null !== $this->apcuPrefix) { |
| 345 | - $file = apcu_fetch($this->apcuPrefix.$class, $hit); |
|
| 345 | + $file = apcu_fetch($this->apcuPrefix . $class, $hit); |
|
| 346 | 346 | if ($hit) { |
| 347 | 347 | return $file; |
| 348 | 348 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | if (null !== $this->apcuPrefix) { |
| 359 | - apcu_add($this->apcuPrefix.$class, $file); |
|
| 359 | + apcu_add($this->apcuPrefix . $class, $file); |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | if (false === $file) { |
@@ -486,7 +486,7 @@ |
||
| 486 | 486 | { |
| 487 | 487 | // Now loop through the remaining (database-based) settings. |
| 488 | 488 | $this->configVars = array_map( |
| 489 | - static function ($configVar) { |
|
| 489 | + static function($configVar) { |
|
| 490 | 490 | // We just saved the file-based settings, so skip their definitions. |
| 491 | 491 | if (!is_array($configVar) || $configVar[2] === 'file') |
| 492 | 492 | { |
@@ -275,7 +275,7 @@ |
||
| 275 | 275 | { |
| 276 | 276 | global $modSettings; |
| 277 | 277 | |
| 278 | - set_error_handler(static function () { /* ignore errors */ }); |
|
| 278 | + set_error_handler(static function() { /* ignore errors */ }); |
|
| 279 | 279 | try |
| 280 | 280 | { |
| 281 | 281 | $mySphinx = mysqli_connect(($modSettings['sphinx_searchd_server'] === 'localhost' ? '127.0.0.1' : $modSettings['sphinx_searchd_server']), '', '', '', (int) $modSettings['sphinxql_searchd_port']); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | // Test for gzuncompress failing, our ErrorException will die on any E_WARNING with no |
| 92 | 92 | // Exception, so turn it off/on for this check. |
| 93 | - set_error_handler(static function () { /* ignore errors */ }); |
|
| 93 | + set_error_handler(static function() { /* ignore errors */ }); |
|
| 94 | 94 | try |
| 95 | 95 | { |
| 96 | 96 | $check = gzuncompress($temp_params); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | // Due to some potential browser/server limitations, attempt to compress |
| 131 | 131 | // old IE's 2083 character limit, we have to compress long search |
| 132 | - set_error_handler(static function () { /* ignore errors */ }); |
|
| 132 | + set_error_handler(static function() { /* ignore errors */ }); |
|
| 133 | 133 | try |
| 134 | 134 | { |
| 135 | 135 | $compressed = gzcompress($encoded); |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | */ |
| 559 | 559 | public function setSortAndDirection($params) |
| 560 | 560 | { |
| 561 | - $sort_columns = ['relevance', 'num_replies', 'id_msg',]; |
|
| 561 | + $sort_columns = ['relevance', 'num_replies', 'id_msg', ]; |
|
| 562 | 562 | |
| 563 | 563 | // Allow integration to add additional sort columns |
| 564 | 564 | call_integration_hook('integrate_search_sort_columns', array(&$sort_columns)); |
@@ -210,7 +210,7 @@ |
||
| 210 | 210 | // no socket, then we need to open one to do much |
| 211 | 211 | if (!is_resource($this->_fp)) |
| 212 | 212 | { |
| 213 | - set_error_handler(static function () { /* ignore errors */ }); |
|
| 213 | + set_error_handler(static function() { /* ignore errors */ }); |
|
| 214 | 214 | try |
| 215 | 215 | { |
| 216 | 216 | $this->_fp = fsockopen($this->_url['host'], $this->_url['port'], $errno, $errstr, 5); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | public function emojiFromHTML($string) |
| 164 | 164 | { |
| 165 | 165 | // If there are 4byte encoded values 🄣, change those back to utf8 characters |
| 166 | - return preg_replace_callback(self::POSSIBLE_HTML_EMOJI, static function ($match) { |
|
| 166 | + return preg_replace_callback(self::POSSIBLE_HTML_EMOJI, static function($match) { |
|
| 167 | 167 | $replace = html_entity_decode($match[0], ENT_NOQUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8'); |
| 168 | 168 | |
| 169 | 169 | // The Fitzpatrick Scale modifiers are not (well) supported across all graphics sets. For now |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | return $string; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - $result = preg_replace_callback($this->emoji_regex, function ($match) { |
|
| 267 | + $result = preg_replace_callback($this->emoji_regex, function($match) { |
|
| 268 | 268 | $hex_str = $this->unicodeCharacterToNumber($match[0]); |
| 269 | 269 | $found = $this->findEmojiByCode($hex_str); |
| 270 | 270 | |