@@ -964,7 +964,7 @@ |
||
964 | 964 | $incontext['continue'] = 1; |
965 | 965 | |
966 | 966 | // Check Postgres setting |
967 | - if ( $db_type === 'postgresql') |
|
967 | + if ($db_type === 'postgresql') |
|
968 | 968 | { |
969 | 969 | load_database(); |
970 | 970 | $result = $smcFunc['db_query']('', ' |
@@ -816,7 +816,7 @@ |
||
816 | 816 | |
817 | 817 | $out = 'POST /smf/stats/collect_stats.php HTTP/1.1' . "\r\n"; |
818 | 818 | $out .= 'Host: www.simplemachines.org' . "\r\n"; |
819 | - $out .= 'user-agent: '. SMF_USER_AGENT . "\r\n"; |
|
819 | + $out .= 'user-agent: ' . SMF_USER_AGENT . "\r\n"; |
|
820 | 820 | $out .= 'content-type: application/x-www-form-urlencoded' . "\r\n"; |
821 | 821 | $out .= 'connection: Close' . "\r\n"; |
822 | 822 | $out .= 'content-length: ' . $length . "\r\n\r\n"; |
@@ -330,7 +330,7 @@ |
||
330 | 330 | WHERE t.id_board = {int:current_board} ' |
331 | 331 | . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' |
332 | 332 | AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . (!empty($message_index_topic_wheres) ? ' |
333 | - AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : ''). ' |
|
333 | + AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : '') . ' |
|
334 | 334 | ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' |
335 | 335 | LIMIT {int:maxindex} |
336 | 336 | OFFSET {int:start} '; |
@@ -1259,7 +1259,7 @@ |
||
1259 | 1259 | // File Upload. |
1260 | 1260 | if ($context['can_post_attachment']) |
1261 | 1261 | { |
1262 | - $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function ($val) use ($smcFunc) |
|
1262 | + $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function($val) use ($smcFunc) |
|
1263 | 1263 | { |
1264 | 1264 | return !empty($val) ? ('.' . $smcFunc['htmltrim']($val)) : ''; |
1265 | 1265 | }, explode(',', $context['allowed_extensions']))); |
@@ -1736,7 +1736,7 @@ discard block |
||
1736 | 1736 | // Prevents warnings about constants that are already defined. |
1737 | 1737 | $settingsText = preg_replace_callback( |
1738 | 1738 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
1739 | - function ($matches) |
|
1739 | + function($matches) |
|
1740 | 1740 | { |
1741 | 1741 | return 'define(\'' . md5(mt_rand()) . '\''; |
1742 | 1742 | }, |
@@ -1746,7 +1746,7 @@ discard block |
||
1746 | 1746 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
1747 | 1747 | try |
1748 | 1748 | { |
1749 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
1749 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
1750 | 1750 | throw new ErrorException('eval error'); |
1751 | 1751 | |
1752 | 1752 | unset($mtime, $settingsFile, $settingsText); |
@@ -1953,7 +1953,7 @@ discard block |
||
1953 | 1953 | } |
1954 | 1954 | |
1955 | 1955 | // Everything is simpler if we convert heredocs to normal strings first. |
1956 | - if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches)) |
|
1956 | + if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches)) |
|
1957 | 1957 | { |
1958 | 1958 | foreach ($matches[0] as $mkey => $heredoc) |
1959 | 1959 | { |
@@ -1967,7 +1967,7 @@ discard block |
||
1967 | 1967 | } |
1968 | 1968 | |
1969 | 1969 | // Split before everything that could possibly delimit a comment or a string. |
1970 | - $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
1970 | + $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
1971 | 1971 | |
1972 | 1972 | $in_string = 0; |
1973 | 1973 | $in_comment = 0; |
@@ -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', |
@@ -67,8 +67,7 @@ |
||
67 | 67 | $sound_letter = substr($sound_letter, strpos($sound_letter, 'data') + 8); |
68 | 68 | switch ($word[$i] === 's' ? 0 : mt_rand(0, 2)) |
69 | 69 | { |
70 | - case 0 : |
|
71 | - for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
70 | + case 0 : for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
72 | 71 | for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++) |
73 | 72 | $sound_word .= $word[$i] === 's' ? $sound_letter[$j] : chr(mt_rand(max(ord($sound_letter[$j]) - 1, 0x00), min(ord($sound_letter[$j]) + 1, 0xFF))); |
74 | 73 | break; |
@@ -282,7 +282,7 @@ |
||
282 | 282 | '{db_prefix}log_notify', |
283 | 283 | array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'), |
284 | 284 | array($user_info['id'], $log['id_topic'], 0), |
285 | - array('id_member','id_topic', 'id_board') |
|
285 | + array('id_member', 'id_topic', 'id_board') |
|
286 | 286 | ); |
287 | 287 | } |
288 | 288 | else |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if ($type == 'edit') |
119 | 119 | { |
120 | 120 | // Filter out members who have already been notified about this post's topic |
121 | - $unnotified = array_filter($watched, function ($member) |
|
121 | + $unnotified = array_filter($watched, function($member) |
|
122 | 122 | { |
123 | 123 | return empty($member['sent']); |
124 | 124 | }); |
@@ -204,8 +204,7 @@ discard block |
||
204 | 204 | if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($prefs[$member_id])) |
205 | 205 | { |
206 | 206 | $pref = !empty($prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ? |
207 | - $prefs[$member_id]['topic_notify_' . $topicOptions['id']] : |
|
208 | - (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0); |
|
207 | + $prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0); |
|
209 | 208 | |
210 | 209 | $message_type = 'notification_' . $type; |
211 | 210 | |
@@ -224,8 +223,7 @@ discard block |
||
224 | 223 | elseif ($type == 'topic') |
225 | 224 | { |
226 | 225 | $pref = !empty($prefs[$member_id]['board_notify_' . $topicOptions['board']]) ? |
227 | - $prefs[$member_id]['board_notify_' . $topicOptions['board']] : |
|
228 | - (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0); |
|
226 | + $prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0); |
|
229 | 227 | |
230 | 228 | $content_type = 'board'; |
231 | 229 |