@@ -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! |
@@ -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 | |
@@ -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 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | // Set a list of common functions. |
| 79 | 79 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
| 80 | 80 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
| 81 | - { |
|
| 81 | + { |
|
| 82 | 82 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
| 83 | 83 | return $string; |
| 84 | 84 | } : function($string) |
@@ -2131,7 +2131,6 @@ discard block |
||
| 2131 | 2131 | loadLanguage('index+Modifications'); |
| 2132 | 2132 | $context['template_layers'] = array(); |
| 2133 | 2133 | } |
| 2134 | - |
|
| 2135 | 2134 | else |
| 2136 | 2135 | { |
| 2137 | 2136 | // Custom templates to load, or just default? |
@@ -2510,14 +2509,12 @@ discard block |
||
| 2510 | 2509 | $fileUrl = $settings['default_theme_url'] . '/css/' . $fileName . ($has_seed ? '' : $params['seed']); |
| 2511 | 2510 | $filePath = $settings['default_theme_dir'] . '/css/' . $fileName . ($has_seed ? '' : $params['seed']); |
| 2512 | 2511 | } |
| 2513 | - |
|
| 2514 | 2512 | else |
| 2515 | 2513 | { |
| 2516 | 2514 | $fileUrl = false; |
| 2517 | 2515 | $filePath = false; |
| 2518 | 2516 | } |
| 2519 | 2517 | } |
| 2520 | - |
|
| 2521 | 2518 | else |
| 2522 | 2519 | { |
| 2523 | 2520 | $fileUrl = $settings[$themeRef . '_url'] . '/css/' . $fileName . ($has_seed ? '' : $params['seed']); |
@@ -2618,14 +2615,12 @@ discard block |
||
| 2618 | 2615 | $fileUrl = $settings['default_theme_url'] . '/scripts/' . $fileName . ($has_seed ? '' : $params['seed']); |
| 2619 | 2616 | $filePath = $settings['default_theme_dir'] . '/scripts/' . $fileName . ($has_seed ? '' : $params['seed']); |
| 2620 | 2617 | } |
| 2621 | - |
|
| 2622 | 2618 | else |
| 2623 | 2619 | { |
| 2624 | 2620 | $fileUrl = false; |
| 2625 | 2621 | $filePath = false; |
| 2626 | 2622 | } |
| 2627 | 2623 | } |
| 2628 | - |
|
| 2629 | 2624 | else |
| 2630 | 2625 | { |
| 2631 | 2626 | $fileUrl = $settings[$themeRef . '_url'] . '/scripts/' . $fileName . ($has_seed ? '' : $params['seed']); |
@@ -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; |
@@ -419,7 +419,7 @@ |
||
| 419 | 419 | $board['last_post']['last_post_message'] = sprintf($txt['last_post_message'], $board['last_post']['member']['link'], $board['last_post']['link'], $board['last_post']['time'] > 0 ? timeformat($board['last_post']['time']) : $txt['not_applicable']); |
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | - else |
|
| 422 | + else |
|
| 423 | 423 | foreach ($this_category as &$board) |
| 424 | 424 | { |
| 425 | 425 | if (!empty($moderators[$board['id']])) |
@@ -332,7 +332,6 @@ discard block |
||
| 332 | 332 | $replacement .= $precedingStyle . $extra_attr . $afterStyle; |
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | - |
|
| 336 | 335 | elseif (preg_match('~</([A-Za-z]+)>~', $part, $matches) === 1) |
| 337 | 336 | { |
| 338 | 337 | // Is this the element that we've been waiting for to be closed? |
@@ -592,7 +591,6 @@ discard block |
||
| 592 | 591 | $parts[$i + 2] = str_repeat("\t", $listDepth) . '[/list]'; |
| 593 | 592 | $parts[$i + 3] = ''; |
| 594 | 593 | } |
| 595 | - |
|
| 596 | 594 | else |
| 597 | 595 | { |
| 598 | 596 | // We're in a list item. |
@@ -631,7 +629,6 @@ discard block |
||
| 631 | 629 | $parts[$i + 2] = ''; |
| 632 | 630 | $parts[$i + 3] = ''; |
| 633 | 631 | } |
| 634 | - |
|
| 635 | 632 | else |
| 636 | 633 | { |
| 637 | 634 | // Remove the trailing breaks from the list item. |