@@ -222,7 +222,6 @@ |
||
222 | 222 | |
223 | 223 | $this->_validLikes['can_like'] = ($this->_user['id'] == $topicOwner ? 'cannot_like_content' : (allowedTo('likes_like') ? true : 'cannot_like_content')); |
224 | 224 | } |
225 | - |
|
226 | 225 | else |
227 | 226 | { |
228 | 227 | // Modders: This will give you whatever the user offers up in terms of liking, e.g. $this->_type=msg, $this->_content=1 |
@@ -93,7 +93,6 @@ |
||
93 | 93 | |
94 | 94 | continue; |
95 | 95 | } |
96 | - |
|
97 | 96 | elseif (empty($row['show_online']) && empty($membersOnlineOptions['show_hidden'])) |
98 | 97 | { |
99 | 98 | // Just increase the stats and don't add this hidden user to any list. |
@@ -3219,7 +3219,7 @@ discard block |
||
3219 | 3219 | // Deleting an existing label? |
3220 | 3220 | elseif (isset($_POST['delete'], $_POST['delete_label'])) |
3221 | 3221 | { |
3222 | - foreach ($_POST['delete_label'] AS $label => $dummy) |
|
3222 | + foreach ($_POST['delete_label'] as $label => $dummy) |
|
3223 | 3223 | { |
3224 | 3224 | unset($the_labels[$label]); |
3225 | 3225 | $labels_to_remove[] = $label; |
@@ -3260,7 +3260,7 @@ discard block |
||
3260 | 3260 | if (!empty($labels_to_add)) |
3261 | 3261 | { |
3262 | 3262 | $inserts = array(); |
3263 | - foreach ($labels_to_add AS $label) |
|
3263 | + foreach ($labels_to_add as $label) |
|
3264 | 3264 | $inserts[] = array($user_info['id'], $label); |
3265 | 3265 | |
3266 | 3266 | $smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array()); |
@@ -3269,7 +3269,7 @@ discard block |
||
3269 | 3269 | // Update existing labels as needed |
3270 | 3270 | if (!empty($label_upates)) |
3271 | 3271 | { |
3272 | - foreach ($label_updates AS $id => $name) |
|
3272 | + foreach ($label_updates as $id => $name) |
|
3273 | 3273 | { |
3274 | 3274 | $smcFunc['db_query']('', ' |
3275 | 3275 | UPDATE {db_prefix}labels |
@@ -849,7 +849,6 @@ |
||
849 | 849 | die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); |
850 | 850 | } |
851 | 851 | } |
852 | - |
|
853 | 852 | elseif ($_REQUEST['format'] === '.wav') |
854 | 853 | { |
855 | 854 | require_once($sourcedir . '/Subs-Sound.php'); |
@@ -756,7 +756,6 @@ |
||
756 | 756 | $groups[$row['id_group']]['num_members'] += $row['num_members']; |
757 | 757 | $smcFunc['db_free_result']($query); |
758 | 758 | } |
759 | - |
|
760 | 759 | else |
761 | 760 | { |
762 | 761 | $query = $smcFunc['db_query']('', ' |
@@ -253,9 +253,10 @@ discard block |
||
253 | 253 | |
254 | 254 | // Phar doesn't handle open_basedir restrictions very well and throws a PHP Warning. Ignore that. |
255 | 255 | set_error_handler(function($errno, $errstr, $errfile, $errline) |
256 | - { |
|
256 | + { |
|
257 | 257 | // error was suppressed with the @-operator |
258 | - if (0 === error_reporting()) { |
|
258 | + if (0 === error_reporting()) |
|
259 | + { |
|
259 | 260 | return false; |
260 | 261 | } |
261 | 262 | if (strpos($errstr, 'PharData::__construct(): open_basedir') === false) |
@@ -269,7 +270,7 @@ discard block |
||
269 | 270 | |
270 | 271 | // go though each file in the archive |
271 | 272 | foreach ($iterator as $file_info) |
272 | - { |
|
273 | + { |
|
273 | 274 | $i = $iterator->getSubPathname(); |
274 | 275 | // If this is a file, and it doesn't exist.... happy days! |
275 | 276 | if (substr($i, -1) != '/' && !file_exists($destination . '/' . $i)) |
@@ -425,7 +425,8 @@ discard block |
||
425 | 425 | if (!empty($day['events'])) |
426 | 426 | { |
427 | 427 | // Sort events by start time (all day events will be listed first) |
428 | - uasort($day['events'], function($a, $b) { |
|
428 | + uasort($day['events'], function($a, $b) |
|
429 | + { |
|
429 | 430 | if ($a['start_timestamp'] == $b['start_timestamp']) |
430 | 431 | return 0; |
431 | 432 | |
@@ -619,7 +620,8 @@ discard block |
||
619 | 620 | if (!empty($day['events'])) |
620 | 621 | { |
621 | 622 | // Sort events by start time (all day events will be listed first) |
622 | - uasort($day['events'], function($a, $b) { |
|
623 | + uasort($day['events'], function($a, $b) |
|
624 | + { |
|
623 | 625 | if ($a['start_timestamp'] == $b['start_timestamp']) |
624 | 626 | return 0; |
625 | 627 | return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1; |
@@ -371,7 +371,7 @@ |
||
371 | 371 | } |
372 | 372 | |
373 | 373 | return (string) substr( |
374 | - (string )$binary_string, |
|
374 | + (string) $binary_string, |
|
375 | 375 | (int) $start, |
376 | 376 | (int) $length |
377 | 377 | ); |
@@ -679,10 +679,10 @@ discard block |
||
679 | 679 | if (!is_callable('random_bytes') && extension_loaded('com_dotnet') && class_exists('COM')) |
680 | 680 | { |
681 | 681 | /** |
682 | - * Class COM |
|
683 | - * |
|
684 | - * This is just a stub class. |
|
685 | - */ |
|
682 | + * Class COM |
|
683 | + * |
|
684 | + * This is just a stub class. |
|
685 | + */ |
|
686 | 686 | class com_exception extends Exception |
687 | 687 | { |
688 | 688 | |
@@ -793,15 +793,15 @@ discard block |
||
793 | 793 | if (!is_callable('random_int')) |
794 | 794 | { |
795 | 795 | /** |
796 | - * Fetch a random integer between $min and $max inclusive |
|
797 | - * |
|
798 | - * @param int $min |
|
799 | - * @param int $max |
|
800 | - * |
|
801 | - * @throws Exception |
|
802 | - * |
|
803 | - * @return int |
|
804 | - */ |
|
796 | + * Fetch a random integer between $min and $max inclusive |
|
797 | + * |
|
798 | + * @param int $min |
|
799 | + * @param int $max |
|
800 | + * |
|
801 | + * @throws Exception |
|
802 | + * |
|
803 | + * @return int |
|
804 | + */ |
|
805 | 805 | function random_int($min, $max) |
806 | 806 | { |
807 | 807 | /** |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | 'member_name' => $regOptions['username'], |
587 | 587 | 'email_address' => $regOptions['email'], |
588 | 588 | 'passwd' => hash_password($regOptions['username'], $regOptions['password']), |
589 | - 'password_salt' => substr(md5($smcFunc['random_int']()), 0, 4) , |
|
589 | + 'password_salt' => substr(md5($smcFunc['random_int']()), 0, 4), |
|
590 | 590 | 'posts' => 0, |
591 | 591 | 'date_registered' => time(), |
592 | 592 | 'member_ip' => $regOptions['interface'] == 'admin' ? '127.0.0.1' : $user_info['ip'], |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | 'time_offset', |
677 | 677 | ); |
678 | 678 | $knownInets = array( |
679 | - 'member_ip','member_ip2', |
|
679 | + 'member_ip', 'member_ip2', |
|
680 | 680 | ); |
681 | 681 | |
682 | 682 | // Call an optional function to validate the users' input. |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | $checkName = strtr($name, array('_' => '\\_', '%' => '\\%')); |
905 | 905 | |
906 | 906 | //when we got no wildcard we can use equal -> fast |
907 | - $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '=' ); |
|
907 | + $operator = (strpos($checkName, '%') || strpos($checkName, '_') ? 'LIKE' : '='); |
|
908 | 908 | |
909 | 909 | // Make sure they don't want someone else's name. |
910 | 910 | $request = $smcFunc['db_query']('', ' |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | $user_info['buddies'][] = $userReceiver; |
1274 | 1274 | |
1275 | 1275 | // And add a nice alert. Don't abuse though! |
1276 | - if ((cache_get_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, 86400)) == null) |
|
1276 | + if ((cache_get_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, 86400)) == null) |
|
1277 | 1277 | { |
1278 | 1278 | $smcFunc['db_insert']('insert', |
1279 | 1279 | '{db_prefix}background_tasks', |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | ); |
1289 | 1289 | |
1290 | 1290 | // Store this in a cache entry to avoid creating multiple alerts. Give it a long life cycle. |
1291 | - cache_put_data('Buddy-sent-'. $user_info['id'] .'-'. $userReceiver, '1', 86400); |
|
1291 | + cache_put_data('Buddy-sent-' . $user_info['id'] . '-' . $userReceiver, '1', 86400); |
|
1292 | 1292 | } |
1293 | 1293 | } |
1294 | 1294 |