@@ -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. |
@@ -881,7 +881,6 @@ discard block |
||
881 | 881 | $is_writable = true; |
882 | 882 | break; |
883 | 883 | } |
884 | - |
|
885 | 884 | else |
886 | 885 | { |
887 | 886 | // Convert the chmod value from octal (0777) to text ("777"). |
@@ -935,8 +934,9 @@ discard block |
||
935 | 934 | { |
936 | 935 | // Wait for a response that isn't continued with -, but don't wait too long. |
937 | 936 | $time = time(); |
938 | - do |
|
939 | - $this->last_message = fgets($this->connection, 1024); |
|
937 | + do { |
|
938 | + $this->last_message = fgets($this->connection, 1024); |
|
939 | + } |
|
940 | 940 | while ((strlen($this->last_message) < 4 || strpos($this->last_message, ' ') === 0 || strpos($this->last_message, ' ', 3) !== 3) && time() - $time < 5); |
941 | 941 | |
942 | 942 | // Was the desired response returned? |
@@ -957,8 +957,9 @@ discard block |
||
957 | 957 | // Request a passive connection - this means, we'll talk to you, you don't talk to us. |
958 | 958 | @fwrite($this->connection, 'PASV' . "\r\n"); |
959 | 959 | $time = time(); |
960 | - do |
|
961 | - $response = fgets($this->connection, 1024); |
|
960 | + do { |
|
961 | + $response = fgets($this->connection, 1024); |
|
962 | + } |
|
962 | 963 | while (strpos($response, ' ', 3) !== 3 && time() - $time < 5); |
963 | 964 | |
964 | 965 | // If it's not 227, we weren't given an IP and port, which means it failed. |
@@ -1080,8 +1081,9 @@ discard block |
||
1080 | 1081 | |
1081 | 1082 | @fwrite($this->connection, 'PWD' . "\r\n"); |
1082 | 1083 | $time = time(); |
1083 | - do |
|
1084 | - $response = fgets($this->connection, 1024); |
|
1084 | + do { |
|
1085 | + $response = fgets($this->connection, 1024); |
|
1086 | + } |
|
1085 | 1087 | while ($response[3] != ' ' && time() - $time < 5); |
1086 | 1088 | |
1087 | 1089 | // Check for 257! |
@@ -722,12 +722,12 @@ |
||
722 | 722 | $where = ''; |
723 | 723 | $count_pk = 0; |
724 | 724 | |
725 | - If ($replace_support) |
|
725 | + if ($replace_support) |
|
726 | 726 | { |
727 | 727 | foreach ($columns as $columnName => $type) |
728 | 728 | { |
729 | 729 | //check pk fiel |
730 | - IF (in_array($columnName, $keys)) |
|
730 | + if (in_array($columnName, $keys)) |
|
731 | 731 | { |
732 | 732 | $key_str .= ($count_pk > 0 ? ',' : ''); |
733 | 733 | $key_str .= $columnName; |
@@ -979,7 +979,8 @@ discard block |
||
979 | 979 | $error_array[2] = null; |
980 | 980 | |
981 | 981 | if(empty($db_persist)) |
982 | - { // without pooling |
|
982 | + { |
|
983 | +// without pooling |
|
983 | 984 | if (empty($pg_error_data_prep)) |
984 | 985 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
985 | 986 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -990,7 +991,8 @@ discard block |
||
990 | 991 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
991 | 992 | } |
992 | 993 | else |
993 | - { //with pooling |
|
994 | + { |
|
995 | +//with pooling |
|
994 | 996 | $pg_error_data_prep = pg_prepare($db_connection, '', |
995 | 997 | 'INSERT INTO ' . $db_prefix . 'log_errors |
996 | 998 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | display_db_error(); |
74 | 74 | |
75 | 75 | // We need to escape ' and \ |
76 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
76 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
77 | 77 | |
78 | 78 | if (!empty($db_options['persist'])) |
79 | 79 | $connection = @pg_pconnect((empty($db_server) ? '' : 'host=' . $db_server . ' ') . 'dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
926 | 926 | $error_array[2] = null; |
927 | 927 | |
928 | - if(empty($db_persist)) |
|
928 | + if (empty($db_persist)) |
|
929 | 929 | { // without pooling |
930 | 930 | if (empty($pg_error_data_prep)) |
931 | 931 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -1252,7 +1252,6 @@ |
||
1252 | 1252 | if (!empty($modSettings['enableAllMessages']) && $topic_length < $modSettings['enableAllMessages']) |
1253 | 1253 | $pages .= ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0;all">' . $txt['all'] . '</a>'; |
1254 | 1254 | } |
1255 | - |
|
1256 | 1255 | else |
1257 | 1256 | $pages = ''; |
1258 | 1257 |
@@ -463,20 +463,20 @@ |
||
463 | 463 | $context['posts'][$key]['quickbuttons'] = array( |
464 | 464 | 'reply' => array( |
465 | 465 | 'label' => $txt['reply'], |
466 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
466 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
467 | 467 | 'icon' => 'reply_button', |
468 | 468 | 'show' => $post['can_reply'] |
469 | 469 | ), |
470 | 470 | 'quote' => array( |
471 | 471 | 'label' => $txt['quote_action'], |
472 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
472 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
473 | 473 | 'icon' => 'quote', |
474 | 474 | 'show' => $post['can_quote'] |
475 | 475 | ), |
476 | 476 | 'delete' => array( |
477 | 477 | 'label' => $txt['remove'], |
478 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';recent;'.$context['session_var'].'='.$context['session_id'], |
|
479 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'" class="you_sure"', |
|
478 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';recent;' . $context['session_var'] . '=' . $context['session_id'], |
|
479 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '" class="you_sure"', |
|
480 | 480 | 'icon' => 'remove_button', |
481 | 481 | 'show' => $post['can_delete'] |
482 | 482 | ), |
@@ -2291,7 +2291,6 @@ |
||
2291 | 2291 | list ($hookData['class'], $hookData['method']) = explode('::', $modFunc); |
2292 | 2292 | $hookData['pureFunc'] = $hookData['method']; |
2293 | 2293 | } |
2294 | - |
|
2295 | 2294 | else |
2296 | 2295 | $hookData['pureFunc'] = $modFunc; |
2297 | 2296 |
@@ -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']('', ' |
@@ -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; |