@@ -149,16 +149,16 @@ discard block |
||
149 | 149 | { |
150 | 150 | global $context, $txt; |
151 | 151 | |
152 | - if (!in_array($txt[self::CLASS_KEY .'_settings'], $config_vars)) |
|
152 | + if (!in_array($txt[self::CLASS_KEY . '_settings'], $config_vars)) |
|
153 | 153 | { |
154 | - $config_vars[] = $txt[self::CLASS_KEY .'_settings']; |
|
154 | + $config_vars[] = $txt[self::CLASS_KEY . '_settings']; |
|
155 | 155 | $config_vars[] = array( |
156 | 156 | self::CLASS_KEY, |
157 | - $txt[self::CLASS_KEY .'_servers'], |
|
157 | + $txt[self::CLASS_KEY . '_servers'], |
|
158 | 158 | 'file', |
159 | 159 | 'text', |
160 | 160 | 0, |
161 | - 'subtext' => $txt[self::CLASS_KEY .'_servers_subtext']); |
|
161 | + 'subtext' => $txt[self::CLASS_KEY . '_servers_subtext']); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | if (!isset($context['settings_post_javascript'])) |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $context['settings_post_javascript'] .= ' |
168 | 168 | $("#cache_accelerator").change(function (e) { |
169 | 169 | var cache_type = e.currentTarget.value; |
170 | - $("#'. self::CLASS_KEY .'").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
170 | + $("#'. self::CLASS_KEY . '").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
171 | 171 | });'; |
172 | 172 | } |
173 | 173 |
@@ -149,16 +149,16 @@ discard block |
||
149 | 149 | { |
150 | 150 | global $context, $txt; |
151 | 151 | |
152 | - if (!in_array($txt[self::CLASS_KEY .'_settings'], $config_vars)) |
|
152 | + if (!in_array($txt[self::CLASS_KEY . '_settings'], $config_vars)) |
|
153 | 153 | { |
154 | - $config_vars[] = $txt[self::CLASS_KEY .'_settings']; |
|
154 | + $config_vars[] = $txt[self::CLASS_KEY . '_settings']; |
|
155 | 155 | $config_vars[] = array( |
156 | 156 | self::CLASS_KEY, |
157 | - $txt[self::CLASS_KEY .'_servers'], |
|
157 | + $txt[self::CLASS_KEY . '_servers'], |
|
158 | 158 | 'file', |
159 | 159 | 'text', |
160 | 160 | 0, |
161 | - 'subtext' => $txt[self::CLASS_KEY .'_servers_subtext']); |
|
161 | + 'subtext' => $txt[self::CLASS_KEY . '_servers_subtext']); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | if (!isset($context['settings_post_javascript'])) |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $context['settings_post_javascript'] .= ' |
168 | 168 | $("#cache_accelerator").change(function (e) { |
169 | 169 | var cache_type = e.currentTarget.value; |
170 | - $("#'. self::CLASS_KEY .'").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
170 | + $("#'. self::CLASS_KEY . '").prop("disabled", cache_type != "MemcacheImplementation" && cache_type != "MemcachedImplementation"); |
|
171 | 171 | });'; |
172 | 172 | } |
173 | 173 |
@@ -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>'; |
@@ -251,7 +251,7 @@ |
||
251 | 251 | return array(); |
252 | 252 | |
253 | 253 | // preparse code does a few things which might mess with our parsing |
254 | - $body = htmlspecialchars_decode(preg_replace('~<br\s*/?'.'>~', "\n", str_replace(' ', ' ', $body)), ENT_QUOTES); |
|
254 | + $body = htmlspecialchars_decode(preg_replace('~<br\s*/?' . '>~', "\n", str_replace(' ', ' ', $body)), ENT_QUOTES); |
|
255 | 255 | |
256 | 256 | // Remove quotes, we don't want to get double mentions. |
257 | 257 | $body = preg_replace('~\[quote[^\]]*\](?' . '>(?' . '>[^\[]|\[(?!/?quote[^\]]*\]))|(?0))*\[/quote\]~', '', $body); |
@@ -174,7 +174,7 @@ discard block |
||
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 | return empty($member['sent']); |
179 | 179 | }); |
180 | 180 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->members['mentioned'] = array_intersect_key($this->members['mentioned'], $unnotified); |
188 | 188 | |
189 | 189 | // Notifications about modified posts only go to members who were mentioned or quoted |
190 | - $this->members['watching'] = $type == 'edit' ? array(): $unnotified; |
|
190 | + $this->members['watching'] = $type == 'edit' ? array() : $unnotified; |
|
191 | 191 | |
192 | 192 | // If this post has no quotes or mentions, just delete any obsolete alerts and bail out. |
193 | 193 | if (empty($this->members['quoted']) && empty($this->members['mentioned'])) |
@@ -497,8 +497,7 @@ discard block |
||
497 | 497 | if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($this->prefs[$member_id])) |
498 | 498 | { |
499 | 499 | $pref = !empty($this->prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ? |
500 | - $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : |
|
501 | - (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
500 | + $this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0); |
|
502 | 501 | |
503 | 502 | $message_type = 'notification_' . $type; |
504 | 503 | |
@@ -517,8 +516,7 @@ discard block |
||
517 | 516 | elseif ($type == 'topic') |
518 | 517 | { |
519 | 518 | $pref = !empty($this->prefs[$member_id]['board_notify_' . $topicOptions['board']]) ? |
520 | - $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : |
|
521 | - (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
519 | + $this->prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0); |
|
522 | 520 | |
523 | 521 | $content_type = 'board'; |
524 | 522 |
@@ -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/', |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | 'if (!is_dir(realpath($cachedir)) && is_dir($boarddir . \'/cache\'))', |
860 | 860 | ' $cachedir = $boarddir . \'/cache\';', |
861 | 861 | )), |
862 | - 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
862 | + 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
863 | 863 | ), |
864 | 864 | 'db_character_set' => array( |
865 | 865 | 'text' => implode("\n", array( |
@@ -958,8 +958,8 @@ discard block |
||
958 | 958 | 'boolean' => '(?i:TRUE|FALSE|(["\']?)[01]\b\\1)', |
959 | 959 | 'NULL' => '(?i:NULL)', |
960 | 960 | // These use a PCRE subroutine to match nested arrays. |
961 | - 'array' => 'array\s*(\((?'.'>[^()]|(?1))*\))', |
|
962 | - 'object' => '\w+::__set_state\(array\s*(\((?'.'>[^()]|(?1))*\))\)', |
|
961 | + 'array' => 'array\s*(\((?' . '>[^()]|(?1))*\))', |
|
962 | + 'object' => '\w+::__set_state\(array\s*(\((?' . '>[^()]|(?1))*\))\)', |
|
963 | 963 | ); |
964 | 964 | |
965 | 965 | /* |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | ), |
993 | 993 | // Remove the code that redirects to the installer. |
994 | 994 | $neg_index-- => array( |
995 | - 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?'.'>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
995 | + 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?' . '>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
996 | 996 | 'placeholder' => '', |
997 | 997 | ), |
998 | 998 | ); |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | // Prevents warnings about constants that are already defined. |
1756 | 1756 | $settingsText = preg_replace_callback( |
1757 | 1757 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
1758 | - function ($matches) |
|
1758 | + function($matches) |
|
1759 | 1759 | { |
1760 | 1760 | return 'define(\'' . md5(mt_rand()) . '\''; |
1761 | 1761 | }, |
@@ -1765,7 +1765,7 @@ discard block |
||
1765 | 1765 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
1766 | 1766 | try |
1767 | 1767 | { |
1768 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
1768 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
1769 | 1769 | throw new ErrorException('eval error'); |
1770 | 1770 | |
1771 | 1771 | unset($mtime, $settingsFile, $settingsText); |
@@ -340,7 +340,7 @@ |
||
340 | 340 | WHERE t.id_board = {int:current_board} ' |
341 | 341 | . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' |
342 | 342 | AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . (!empty($message_index_topic_wheres) ? ' |
343 | - AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : ''). ' |
|
343 | + AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : '') . ' |
|
344 | 344 | ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' |
345 | 345 | LIMIT {int:maxindex} |
346 | 346 | OFFSET {int:start} '; |
@@ -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} |