@@ -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) |
@@ -75,7 +75,7 @@ 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( |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
911 | 911 | $error_array[2] = null; |
912 | 912 | |
913 | - if(empty($db_persist)) |
|
913 | + if (empty($db_persist)) |
|
914 | 914 | { // without pooling |
915 | 915 | if (empty($pg_error_data_prep)) |
916 | 916 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -756,7 +756,7 @@ |
||
756 | 756 | } |
757 | 757 | |
758 | 758 | // Filter out any redundant separators before we start the loop |
759 | - $context['config_vars'] = array_filter($context['config_vars'], function ($v) use ($context) |
|
759 | + $context['config_vars'] = array_filter($context['config_vars'], function($v) use ($context) |
|
760 | 760 | { |
761 | 761 | static $config_vars, $prev; |
762 | 762 |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | // Figure out the filename we'll tell the browser. |
470 | 470 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
471 | 471 | $included_desc = array_map( |
472 | - function ($datatype) use ($txt) |
|
472 | + function($datatype) use ($txt) |
|
473 | 473 | { |
474 | 474 | return $txt[$datatype]; |
475 | 475 | }, |
@@ -789,9 +789,9 @@ discard block |
||
789 | 789 | $xslt_variables = array(); |
790 | 790 | |
791 | 791 | // Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function. |
792 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile'; |
|
793 | - $xslt_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform'; |
|
794 | - $html_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml'; |
|
792 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile'; |
|
793 | + $xslt_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform'; |
|
794 | + $html_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml'; |
|
795 | 795 | |
796 | 796 | require_once($sourcedir . DIRECTORY_SEPARATOR . 'News.php'); |
797 | 797 | |
@@ -1696,14 +1696,14 @@ discard block |
||
1696 | 1696 | |
1697 | 1697 | if (!empty($context['export_css_header'])) |
1698 | 1698 | { |
1699 | - $stylesheet['css_js'] .= ' |
|
1699 | + $stylesheet['css_js'] .= ' |
|
1700 | 1700 | <style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]> |
1701 | 1701 | </style>'; |
1702 | 1702 | } |
1703 | 1703 | |
1704 | 1704 | if (!empty($context['export_javascript_vars'])) |
1705 | 1705 | { |
1706 | - $stylesheet['css_js'] .= ' |
|
1706 | + $stylesheet['css_js'] .= ' |
|
1707 | 1707 | <script><![CDATA['; |
1708 | 1708 | |
1709 | 1709 | foreach ($context['export_javascript_vars'] as $var => $val) |
@@ -1739,7 +1739,7 @@ discard block |
||
1739 | 1739 | |
1740 | 1740 | if (!empty($context['export_javascript_inline']['standard'])) |
1741 | 1741 | { |
1742 | - $stylesheet['css_js'] .= ' |
|
1742 | + $stylesheet['css_js'] .= ' |
|
1743 | 1743 | <script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]> |
1744 | 1744 | </script>'; |
1745 | 1745 | } |
@@ -1751,7 +1751,7 @@ discard block |
||
1751 | 1751 | |
1752 | 1752 | $stylesheet['css_js'] .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer'])); |
1753 | 1753 | |
1754 | - $stylesheet['css_js'] .= "\n" . '});'. "\n" . ']]> |
|
1754 | + $stylesheet['css_js'] .= "\n" . '});' . "\n" . ']]> |
|
1755 | 1755 | </script>'; |
1756 | 1756 | } |
1757 | 1757 | |
@@ -1832,7 +1832,7 @@ discard block |
||
1832 | 1832 | $css_to_minify = array(); |
1833 | 1833 | $normal_css_files = array(); |
1834 | 1834 | |
1835 | - usort($context['css_files'], function ($a, $b) |
|
1835 | + usort($context['css_files'], function($a, $b) |
|
1836 | 1836 | { |
1837 | 1837 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
1838 | 1838 | }); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | AND a.is_read = 0' : '') . (!empty($alertIDs) ? ' |
263 | 263 | AND a.id_alert IN ({array_int:alertIDs})' : '') . ' |
264 | 264 | ORDER BY id_alert DESC' . (!empty($limit) ? ' |
265 | - LIMIT {int:limit}' : '') . (!empty($offset) ?' |
|
265 | + LIMIT {int:limit}' : '') . (!empty($offset) ? ' |
|
266 | 266 | OFFSET {int:offset}' : ''), |
267 | 267 | array( |
268 | 268 | 'id_member' => $memID, |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | |
362 | 362 | // Substitute $scripturl into the link formats. (Done here to make life easier for hooked mods.) |
363 | 363 | $formats = array_map( |
364 | - function ($format) use ($scripturl) |
|
364 | + function($format) use ($scripturl) |
|
365 | 365 | { |
366 | 366 | $format['link'] = str_replace('{scripturl}', $scripturl, $format['link']); |
367 | 367 | $format['text'] = str_replace('{scripturl}', $scripturl, $format['text']); |
@@ -1172,20 +1172,20 @@ discard block |
||
1172 | 1172 | $context['posts'][$key]['quickbuttons'] = array( |
1173 | 1173 | 'reply' => array( |
1174 | 1174 | 'label' => $txt['reply'], |
1175 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
1175 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
1176 | 1176 | 'icon' => 'reply_button', |
1177 | 1177 | 'show' => $post['can_reply'] |
1178 | 1178 | ), |
1179 | 1179 | 'quote' => array( |
1180 | 1180 | 'label' => $txt['quote_action'], |
1181 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
1181 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
1182 | 1182 | 'icon' => 'quote', |
1183 | 1183 | 'show' => $post['can_quote'] |
1184 | 1184 | ), |
1185 | 1185 | 'remove' => array( |
1186 | 1186 | 'label' => $txt['remove'], |
1187 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';profile;u='.$context['member']['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
1188 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'"', |
|
1187 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';profile;u=' . $context['member']['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
1188 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '"', |
|
1189 | 1189 | 'class' => 'you_sure', |
1190 | 1190 | 'icon' => 'remove_button', |
1191 | 1191 | 'show' => $post['can_delete'] |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $feed_meta = array( |
205 | 205 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
206 | 206 | 'desc' => sentence_list(array_map( |
207 | - function ($datatype) use ($txt) |
|
207 | + function($datatype) use ($txt) |
|
208 | 208 | { |
209 | 209 | return $txt[$datatype]; |
210 | 210 | }, |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | 'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"', |
727 | 727 | ), |
728 | 728 | $returnContext |
729 | - ) . $hidden_orig_link . '</span>' ; |
|
729 | + ) . $hidden_orig_link . '</span>'; |
|
730 | 730 | } |
731 | 731 | elseif (strpos($currentAttachment['mime_type'], 'video/') === 0) |
732 | 732 | { |
@@ -1277,7 +1277,7 @@ |
||
1277 | 1277 | if ($context['can_post_attachment']) |
1278 | 1278 | { |
1279 | 1279 | $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map( |
1280 | - function ($val) use ($smcFunc) |
|
1280 | + function($val) use ($smcFunc) |
|
1281 | 1281 | { |
1282 | 1282 | return !empty($val) ? ('.' . $smcFunc['htmltrim']($val)) : ''; |
1283 | 1283 | }, |
@@ -280,7 +280,6 @@ discard block |
||
280 | 280 | $condition = 'id_member IN ({array_int:members})'; |
281 | 281 | $parameters['members'] = $members; |
282 | 282 | } |
283 | - |
|
284 | 283 | elseif ($members === null) |
285 | 284 | $condition = '1=1'; |
286 | 285 | |
@@ -383,11 +382,9 @@ discard block |
||
383 | 382 | $val = $val . ' END'; |
384 | 383 | $type = 'raw'; |
385 | 384 | } |
386 | - |
|
387 | 385 | else |
388 | 386 | $val = alert_count($members, true); |
389 | 387 | } |
390 | - |
|
391 | 388 | elseif ($type == 'int' && ($val === '+' || $val === '-')) |
392 | 389 | { |
393 | 390 | $val = $var . ' ' . $val . ' 1'; |
@@ -2160,12 +2157,12 @@ discard block |
||
2160 | 2157 | 'tag' => 'cowsay', |
2161 | 2158 | 'parameters' => array( |
2162 | 2159 | 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
2163 | - { |
|
2160 | + { |
|
2164 | 2161 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
2165 | 2162 | }, |
2166 | 2163 | ), |
2167 | 2164 | 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
2168 | - { |
|
2165 | + { |
|
2169 | 2166 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
2170 | 2167 | }, |
2171 | 2168 | ), |
@@ -2494,7 +2491,8 @@ discard block |
||
2494 | 2491 | |
2495 | 2492 | foreach (array('path', 'query', 'fragment') as $part) |
2496 | 2493 | { |
2497 | - switch ($part) { |
|
2494 | + switch ($part) |
|
2495 | + { |
|
2498 | 2496 | case 'path': |
2499 | 2497 | $part_disallowed_chars = '<>' . $bracket_quote_chars . $space_chars . $excluded_trailing_chars . '/#&'; |
2500 | 2498 | $part_excluded_trailing_chars = str_replace('?', '', $excluded_trailing_chars); |
@@ -2807,7 +2805,9 @@ discard block |
||
2807 | 2805 | $look_for = strtolower(substr($message, $pos + 2, $pos2 - $pos - 2)); |
2808 | 2806 | |
2809 | 2807 | // A closing tag that doesn't match any open tags? Skip it. |
2810 | - if (!in_array($look_for, array_map(function($code) { return $code['tag']; }, $open_tags))) |
|
2808 | + if (!in_array($look_for, array_map(function($code) |
|
2809 | + { |
|
2810 | +return $code['tag']; }, $open_tags))) |
|
2811 | 2811 | continue; |
2812 | 2812 | |
2813 | 2813 | $to_close = array(); |
@@ -3537,7 +3537,7 @@ discard block |
||
3537 | 3537 | |
3538 | 3538 | // Replace away! |
3539 | 3539 | $message = preg_replace_callback($smileyPregSearch, function($matches) use ($smileyPregReplacements) |
3540 | - { |
|
3540 | + { |
|
3541 | 3541 | return $smileyPregReplacements[$matches[1]]; |
3542 | 3542 | }, $message); |
3543 | 3543 | } |
@@ -4348,7 +4348,6 @@ discard block |
||
4348 | 4348 | if (!isset($minSeed) && isset($js_file['options']['seed'])) |
4349 | 4349 | $minSeed = $js_file['options']['seed']; |
4350 | 4350 | } |
4351 | - |
|
4352 | 4351 | else |
4353 | 4352 | { |
4354 | 4353 | echo ' |
@@ -6274,7 +6273,8 @@ discard block |
||
6274 | 6273 | $zones[$tzkey]['tzid'] = $tzid; |
6275 | 6274 | $zones[$tzkey]['dst_type'] = count($tzinfo) > 1 ? 1 : ($tzinfo[0]['isdst'] ? 2 : 0); |
6276 | 6275 | |
6277 | - foreach ($tzinfo as $transition) { |
|
6276 | + foreach ($tzinfo as $transition) |
|
6277 | + { |
|
6278 | 6278 | $zones[$tzkey]['abbrs'][] = $transition['abbr']; |
6279 | 6279 | } |
6280 | 6280 | |
@@ -6359,7 +6359,8 @@ discard block |
||
6359 | 6359 | $desc = implode(', ', array_slice(array_unique($tzvalue['locations']), 0, 5)) . (count($tzvalue['locations']) > 5 ? ', ' . $txt['etc'] : ''); |
6360 | 6360 | |
6361 | 6361 | // We don't want abbreviations like '+03' or '-11'. |
6362 | - $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) { |
|
6362 | + $abbrs = array_filter($tzvalue['abbrs'], function ($abbr) |
|
6363 | + { |
|
6363 | 6364 | return !strspn($abbr, '+-'); |
6364 | 6365 | }); |
6365 | 6366 | $abbrs = count($abbrs) == count($tzvalue['abbrs']) ? array_unique($abbrs) : array(); |
@@ -6760,7 +6761,6 @@ discard block |
||
6760 | 6761 | $isWritable = true; |
6761 | 6762 | break; |
6762 | 6763 | } |
6763 | - |
|
6764 | 6764 | else |
6765 | 6765 | @chmod($file, $val); |
6766 | 6766 | } |