@@ -364,8 +364,8 @@ discard block |
||
364 | 364 | } |
365 | 365 | |
366 | 366 | // Clean up tags with children |
367 | - foreach($bbcTagsChildren as $parent_tag => $children) |
|
368 | - foreach($children as $index => $child_tag) |
|
367 | + foreach ($bbcTagsChildren as $parent_tag => $children) |
|
368 | + foreach ($children as $index => $child_tag) |
|
369 | 369 | { |
370 | 370 | // Remove entries where parent and child tag is the same |
371 | 371 | if ($child_tag == $parent_tag) |
@@ -1888,25 +1888,25 @@ discard block |
||
1888 | 1888 | $fields = array(); |
1889 | 1889 | $new_sort = array(); |
1890 | 1890 | |
1891 | - while($row = $smcFunc['db_fetch_assoc']($request)) |
|
1891 | + while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
1892 | 1892 | $fields[] = $row['id_field']; |
1893 | 1893 | $smcFunc['db_free_result']($request); |
1894 | 1894 | |
1895 | 1895 | $idx = array_search($context['fid'], $fields); |
1896 | 1896 | |
1897 | - if ($_GET['move'] == 'down' && count($fields) - 1 > $idx ) |
|
1897 | + if ($_GET['move'] == 'down' && count($fields) - 1 > $idx) |
|
1898 | 1898 | { |
1899 | - $new_sort = array_slice($fields ,0 ,$idx ,true); |
|
1899 | + $new_sort = array_slice($fields, 0, $idx, true); |
|
1900 | 1900 | $new_sort[] = $fields[$idx + 1]; |
1901 | 1901 | $new_sort[] = $fields[$idx]; |
1902 | - $new_sort += array_slice($fields ,$idx + 2 ,count($fields) ,true); |
|
1902 | + $new_sort += array_slice($fields, $idx + 2, count($fields), true); |
|
1903 | 1903 | } |
1904 | 1904 | elseif ($context['fid'] > 0 and $idx < count($fields)) |
1905 | 1905 | { |
1906 | - $new_sort = array_slice($fields ,0 ,($idx - 1) ,true); |
|
1906 | + $new_sort = array_slice($fields, 0, ($idx - 1), true); |
|
1907 | 1907 | $new_sort[] = $fields[$idx]; |
1908 | 1908 | $new_sort[] = $fields[$idx - 1]; |
1909 | - $new_sort += array_slice($fields ,($idx + 1) ,count($fields) ,true); |
|
1909 | + $new_sort += array_slice($fields, ($idx + 1), count($fields), true); |
|
1910 | 1910 | } |
1911 | 1911 | else |
1912 | 1912 | redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler |
@@ -393,18 +393,18 @@ discard block |
||
393 | 393 | $quickbuttons = array( |
394 | 394 | 'approve' => array( |
395 | 395 | 'label' => $txt['approve'], |
396 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';approve='.$item['id'], |
|
396 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';approve=' . $item['id'], |
|
397 | 397 | 'icon' => 'approve', |
398 | 398 | ), |
399 | 399 | 'delete' => array( |
400 | 400 | 'label' => $txt['remove'], |
401 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';delete='.$item['id'], |
|
401 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';delete=' . $item['id'], |
|
402 | 402 | 'icon' => 'remove_button', |
403 | 403 | 'show' => $item['can_delete'] |
404 | 404 | ), |
405 | 405 | 'quickmod' => array( |
406 | 406 | 'class' => 'inline_mod_check', |
407 | - 'content' => '<input type="checkbox" name="item[]" value="'.$item['id'].'" checked>', |
|
407 | + 'content' => '<input type="checkbox" name="item[]" value="' . $item['id'] . '" checked>', |
|
408 | 408 | 'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 |
409 | 409 | ), |
410 | 410 | ); |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $quickbuttons = array( |
470 | 470 | 'delete' => array( |
471 | 471 | 'label' => $txt['remove_message'], |
472 | - 'href' => $scripturl.'?action=moderate;area=userwatch;sa=post;delete='.$post['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
472 | + 'href' => $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
473 | 473 | 'javascript' => 'data-confirm="' . $txt['mc_watched_users_delete_post'] . '"', |
474 | 474 | 'class' => 'you_sure', |
475 | 475 | 'icon' => 'remove_button', |
@@ -1721,7 +1721,7 @@ discard block |
||
1721 | 1721 | { |
1722 | 1722 | // Avoid double separators and empty titled sections |
1723 | 1723 | $empty_section = true; |
1724 | - for ($j=$i+1; $j < count($context['theme_options']); $j++) |
|
1724 | + for ($j = $i + 1; $j < count($context['theme_options']); $j++) |
|
1725 | 1725 | { |
1726 | 1726 | // Found another separator, so we're done |
1727 | 1727 | if (!is_array($context['theme_options'][$j])) |
@@ -2700,8 +2700,7 @@ discard block |
||
2700 | 2700 | foreach ($context['post_errors'] as $error) |
2701 | 2701 | { |
2702 | 2702 | $text_key_error = $error == 'password_short' ? |
2703 | - sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : |
|
2704 | - (isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : ''); |
|
2703 | + sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : (isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : ''); |
|
2705 | 2704 | |
2706 | 2705 | echo ' |
2707 | 2706 | <li>', isset($txt['profile_error_' . $error]) ? $text_key_error : $error, '</li>'; |
@@ -862,7 +862,7 @@ |
||
862 | 862 | // Intercept cookie? |
863 | 863 | call_integration_hook('integrate_cookie', array($name, $value, $expire, $path, $domain, $secure, $httponly, $samesite)); |
864 | 864 | |
865 | - if(PHP_VERSION_ID < 70300) |
|
865 | + if (PHP_VERSION_ID < 70300) |
|
866 | 866 | return setcookie($name, $value, $expire, $path . ';samesite=' . $samesite, $domain, $secure, $httponly); |
867 | 867 | else |
868 | 868 | return setcookie($name, $value, array( |
@@ -174,7 +174,8 @@ |
||
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | - $unnotified = array_filter($this->members['watching'], function ($member) { |
|
177 | + $unnotified = array_filter($this->members['watching'], function ($member) |
|
178 | + { |
|
178 | 179 | return empty($member['sent']); |
179 | 180 | }); |
180 | 181 |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | } |
189 | 189 | |
190 | - $unnotified = array_filter($this->members['watching'], function ($member) { |
|
190 | + $unnotified = array_filter($this->members['watching'], function($member) { |
|
191 | 191 | return empty($member['sent']); |
192 | 192 | }); |
193 | 193 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if ($type == 'edit' || !empty($this->_details['respawns'])) |
197 | 197 | { |
198 | 198 | // Notifications about modified posts only go to members who were mentioned or quoted |
199 | - $this->members['watching'] = $type == 'edit' ? array(): $unnotified; |
|
199 | + $this->members['watching'] = $type == 'edit' ? array() : $unnotified; |
|
200 | 200 | |
201 | 201 | // If this post has no quotes or mentions, just delete any obsolete alerts and bail out. |
202 | 202 | if (empty($this->members['quoted']) && empty($this->members['mentioned'])) |
@@ -512,8 +512,7 @@ discard block |
||
512 | 512 | if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($this->prefs[$member_id])) |
513 | 513 | { |
514 | 514 | $pref = !empty($this->prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ? |
515 | - $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : |
|
516 | - (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
515 | + $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
517 | 516 | |
518 | 517 | $message_type = 'notification_' . $type; |
519 | 518 | |
@@ -532,8 +531,7 @@ discard block |
||
532 | 531 | elseif ($type == 'topic') |
533 | 532 | { |
534 | 533 | $pref = !empty($this->prefs[$member_id]['board_notify_' . $topicOptions['board']]) ? |
535 | - $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : |
|
536 | - (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
534 | + $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
537 | 535 | |
538 | 536 | $content_type = 'board'; |
539 | 537 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | require_once($sourcedir . '/Security.php'); |
79 | 79 | |
80 | 80 | // If $maintenance is set specifically to 2, then we're upgrading or something. |
81 | -if (!empty($maintenance) && 2 === $maintenance) |
|
81 | +if (!empty($maintenance) && 2 === $maintenance) |
|
82 | 82 | { |
83 | 83 | display_maintenance_message(); |
84 | 84 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @param string $class The fully-qualified class name. |
96 | 96 | */ |
97 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
97 | +spl_autoload_register(function($class) use ($sourcedir) |
|
98 | 98 | { |
99 | 99 | $classMap = array( |
100 | 100 | 'ReCaptcha\\' => 'ReCaptcha/', |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ); |
92 | 92 | foreach (array('action', 'sa', 'type', 'board', 'boards', 'c', 'u', 'limit', 'offset') as $var) |
93 | 93 | if (isset($_GET[$var])) |
94 | - $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';' ) . $var . '=' . $_GET[$var]; |
|
94 | + $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';') . $var . '=' . $_GET[$var]; |
|
95 | 95 | |
96 | 96 | // Handle the cases where a board, boards, or category is asked for. |
97 | 97 | $query_this_board = 1; |
@@ -303,17 +303,17 @@ discard block |
||
303 | 303 | * namespaces, which could cause it to mangle the XML horrifically |
304 | 304 | * during processing. |
305 | 305 | */ |
306 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/' . $subaction; |
|
306 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/' . $subaction; |
|
307 | 307 | |
308 | 308 | // Allow mods to add extra namespaces and tags to the feed/channel |
309 | 309 | $namespaces = array( |
310 | 310 | 'rss' => array(), |
311 | - 'rss2' => array('atom' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
312 | - 'atom' => array('' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
311 | + 'rss2' => array('atom' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
312 | + 'atom' => array('' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
313 | 313 | 'rdf' => array( |
314 | - '' => 'htt'.'p:/'.'/purl.o'.'rg/rss/1.0/', |
|
315 | - 'rdf' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/02/22-rdf-syntax-ns#', |
|
316 | - 'dc' => 'htt'.'p:/'.'/purl.o'.'rg/dc/elements/1.1/', |
|
314 | + '' => 'htt' . 'p:/' . '/purl.o' . 'rg/rss/1.0/', |
|
315 | + 'rdf' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/02/22-rdf-syntax-ns#', |
|
316 | + 'dc' => 'htt' . 'p:/' . '/purl.o' . 'rg/dc/elements/1.1/', |
|
317 | 317 | ), |
318 | 318 | 'smf' => array( |
319 | 319 | 'smf' => $smf_ns, |
@@ -2127,7 +2127,7 @@ discard block |
||
2127 | 2127 | m.id_msg, m.id_topic, m.id_board, m.id_member, m.poster_email, m.poster_ip, |
2128 | 2128 | m.poster_time, m.subject, m.modified_time, m.modified_name, m.modified_reason, m.body, |
2129 | 2129 | m.likes, m.approved, m.smileys_enabled |
2130 | - FROM {db_prefix}messages AS m' . ($modSettings['postmod_active'] && !$show_all ?' |
|
2130 | + FROM {db_prefix}messages AS m' . ($modSettings['postmod_active'] && !$show_all ? ' |
|
2131 | 2131 | INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic)' : '') . ' |
2132 | 2132 | WHERE m.id_member = {int:uid} |
2133 | 2133 | AND m.id_msg > {int:start_after} |
@@ -2202,7 +2202,7 @@ |
||
2202 | 2202 | function($a, $b) |
2203 | 2203 | { |
2204 | 2204 | if ($a['filesize'] == $b['filesize']) |
2205 | - return 0; |
|
2205 | + return 0; |
|
2206 | 2206 | |
2207 | 2207 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
2208 | 2208 | } |
@@ -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 | { |
@@ -1840,7 +1840,7 @@ |
||
1840 | 1840 | // Make sure this is an array of integers |
1841 | 1841 | $excluded_groups = array_filter( |
1842 | 1842 | (array) $excluded_groups, |
1843 | - function ($v) |
|
1843 | + function($v) |
|
1844 | 1844 | { |
1845 | 1845 | return is_int($v) || is_string($v) && (string) intval($v) === $v; |
1846 | 1846 | } |