@@ -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; |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | display_db_error(); |
76 | 76 | |
77 | 77 | // We need to escape ' and \ |
78 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
78 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
79 | 79 | |
80 | 80 | // Since pg_connect doesn't feed error info to pg_last_error, we have to catch issues with a try/catch. |
81 | 81 | set_error_handler(function($errno, $errstr) { |
82 | - throw new ErrorException($errstr, $errno);}); |
|
82 | + throw new ErrorException($errstr, $errno); }); |
|
83 | 83 | try |
84 | 84 | { |
85 | 85 | if (!empty($db_options['persist'])) |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
939 | 939 | $error_array[2] = null; |
940 | 940 | |
941 | - if(empty($db_persist)) |
|
941 | + if (empty($db_persist)) |
|
942 | 942 | { // without pooling |
943 | 943 | if (empty($pg_error_data_prep)) |
944 | 944 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -78,7 +78,8 @@ discard block |
||
78 | 78 | $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
79 | 79 | |
80 | 80 | // Since pg_connect doesn't feed error info to pg_last_error, we have to catch issues with a try/catch. |
81 | - set_error_handler(function($errno, $errstr) { |
|
81 | + set_error_handler(function($errno, $errstr) |
|
82 | + { |
|
82 | 83 | throw new ErrorException($errstr, $errno);}); |
83 | 84 | try |
84 | 85 | { |
@@ -939,7 +940,8 @@ discard block |
||
939 | 940 | $error_array[2] = null; |
940 | 941 | |
941 | 942 | if(empty($db_persist)) |
942 | - { // without pooling |
|
943 | + { |
|
944 | +// without pooling |
|
943 | 945 | if (empty($pg_error_data_prep)) |
944 | 946 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
945 | 947 | 'INSERT INTO ' . $db_prefix . 'log_errors |
@@ -950,7 +952,8 @@ discard block |
||
950 | 952 | pg_execute($db_connection, 'smf_log_errors', $error_array); |
951 | 953 | } |
952 | 954 | else |
953 | - { //with pooling |
|
955 | + { |
|
956 | +//with pooling |
|
954 | 957 | $pg_error_data_prep = pg_prepare($db_connection, '', |
955 | 958 | 'INSERT INTO ' . $db_prefix . 'log_errors |
956 | 959 | (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace) |
@@ -419,7 +419,7 @@ |
||
419 | 419 | |
420 | 420 | if (checkImagick()) |
421 | 421 | { |
422 | - $imagick = New Imagick($destName); |
|
422 | + $imagick = new Imagick($destName); |
|
423 | 423 | $src_width = empty($src_width) ? $imagick->getImageWidth() : $src_width; |
424 | 424 | $src_height = empty($src_height) ? $imagick->getImageHeight() : $src_height; |
425 | 425 | $dest_width = empty($max_width) ? $src_width : $max_width; |
@@ -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! |
@@ -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; |
@@ -89,7 +89,9 @@ |
||
89 | 89 | <li><a href="#" onclick="showSSIBlock('ssi_quickSearch'); return false;">Quick Search Box</a></li> |
90 | 90 | <li><a href="#" onclick="showSSIBlock('ssi_recentAttachments'); return false;">Recent Attachments</a></li> |
91 | 91 | </ul> |
92 | - <?php if ($user_info['is_admin']) { ?> |
|
92 | + <?php if ($user_info['is_admin']) |
|
93 | +{ |
|
94 | +?> |
|
93 | 95 | <h3>Advanced Functions <img class="help" title="Functions that require additional tweaking, not just copy and paste." src="<?php echo $settings['images_url']; ?>/helptopics.png" alt=""></h3> |
94 | 96 | <ul> |
95 | 97 | <li><a href="#" onclick="showSSIBlock('ssi_showPoll'); return false;">Show Single Poll</a></li> |
@@ -310,7 +310,6 @@ discard block |
||
310 | 310 | $replacement .= $precedingStyle . $extra_attr . $afterStyle; |
311 | 311 | } |
312 | 312 | } |
313 | - |
|
314 | 313 | elseif (preg_match('~</([A-Za-z]+)>~', $part, $matches) === 1) |
315 | 314 | { |
316 | 315 | // Is this the element that we've been waiting for to be closed? |
@@ -570,7 +569,6 @@ discard block |
||
570 | 569 | $parts[$i + 2] = str_repeat("\t", $listDepth) . '[/list]'; |
571 | 570 | $parts[$i + 3] = ''; |
572 | 571 | } |
573 | - |
|
574 | 572 | else |
575 | 573 | { |
576 | 574 | // We're in a list item. |
@@ -609,7 +607,6 @@ discard block |
||
609 | 607 | $parts[$i + 2] = ''; |
610 | 608 | $parts[$i + 3] = ''; |
611 | 609 | } |
612 | - |
|
613 | 610 | else |
614 | 611 | { |
615 | 612 | // Remove the trailing breaks from the list item. |
@@ -280,7 +280,7 @@ |
||
280 | 280 | $ret .= |
281 | 281 | chr(($this->m_arColors[$i] & 0x000000FF)) . // R |
282 | 282 | chr(($this->m_arColors[$i] & 0x0000FF00) >> 8) . // G |
283 | - chr(($this->m_arColors[$i] & 0x00FF0000) >> 16); // B |
|
283 | + chr(($this->m_arColors[$i] & 0x00FF0000) >> 16); // B |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | return $ret; |
@@ -1254,7 +1254,6 @@ |
||
1254 | 1254 | |
1255 | 1255 | return array($charset, $string, 'base64'); |
1256 | 1256 | } |
1257 | - |
|
1258 | 1257 | else |
1259 | 1258 | return array($charset, $string, '7bit'); |
1260 | 1259 | } |