@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ); |
| 93 | 93 | foreach (array('action', 'sa', 'type', 'board', 'boards', 'c', 'u', 'limit', 'offset') as $var) |
| 94 | 94 | if (isset($_GET[$var])) |
| 95 | - $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';' ) . $var . '=' . $_GET[$var]; |
|
| 95 | + $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';') . $var . '=' . $_GET[$var]; |
|
| 96 | 96 | |
| 97 | 97 | // Handle the cases where a board, boards, or category is asked for. |
| 98 | 98 | $query_this_board = 1; |
@@ -299,17 +299,17 @@ discard block |
||
| 299 | 299 | * namespaces, which could cause it to mangle the XML horrifically |
| 300 | 300 | * during processing. |
| 301 | 301 | */ |
| 302 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/' . $subaction; |
|
| 302 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/' . $subaction; |
|
| 303 | 303 | |
| 304 | 304 | // Allow mods to add extra namespaces and tags to the feed/channel |
| 305 | 305 | $namespaces = array( |
| 306 | 306 | 'rss' => array(), |
| 307 | - 'rss2' => array('atom' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 308 | - 'atom' => array('' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 307 | + 'rss2' => array('atom' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 308 | + 'atom' => array('' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 309 | 309 | 'rdf' => array( |
| 310 | - '' => 'htt'.'p:/'.'/purl.o'.'rg/rss/1.0/', |
|
| 311 | - 'rdf' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/02/22-rdf-syntax-ns#', |
|
| 312 | - 'dc' => 'htt'.'p:/'.'/purl.o'.'rg/dc/elements/1.1/', |
|
| 310 | + '' => 'htt' . 'p:/' . '/purl.o' . 'rg/rss/1.0/', |
|
| 311 | + 'rdf' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/02/22-rdf-syntax-ns#', |
|
| 312 | + 'dc' => 'htt' . 'p:/' . '/purl.o' . 'rg/dc/elements/1.1/', |
|
| 313 | 313 | ), |
| 314 | 314 | 'smf' => array( |
| 315 | 315 | 'smf' => $smf_ns, |
@@ -467,20 +467,20 @@ |
||
| 467 | 467 | $context['posts'][$key]['quickbuttons'] = array( |
| 468 | 468 | 'reply' => array( |
| 469 | 469 | 'label' => $txt['reply'], |
| 470 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
| 470 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
| 471 | 471 | 'icon' => 'reply_button', |
| 472 | 472 | 'show' => $post['can_reply'] |
| 473 | 473 | ), |
| 474 | 474 | 'quote' => array( |
| 475 | 475 | 'label' => $txt['quote_action'], |
| 476 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
| 476 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
| 477 | 477 | 'icon' => 'quote', |
| 478 | 478 | 'show' => $post['can_quote'] |
| 479 | 479 | ), |
| 480 | 480 | 'delete' => array( |
| 481 | 481 | 'label' => $txt['remove'], |
| 482 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';recent;'.$context['session_var'].'='.$context['session_id'], |
|
| 483 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'"', |
|
| 482 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';recent;' . $context['session_var'] . '=' . $context['session_id'], |
|
| 483 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '"', |
|
| 484 | 484 | 'class' => 'you_sure', |
| 485 | 485 | 'icon' => 'remove_button', |
| 486 | 486 | 'show' => $post['can_delete'] |
@@ -644,13 +644,13 @@ discard block |
||
| 644 | 644 | 'quickbuttons' => array( |
| 645 | 645 | 'edit' => array( |
| 646 | 646 | 'label' => $txt['draft_edit'], |
| 647 | - 'href' => $scripturl.'?action=post;'.(empty($row['id_topic']) ? 'board='.$row['id_board'] : 'topic='.$row['id_topic']).'.0;id_draft='.$row['id_draft'], |
|
| 647 | + 'href' => $scripturl . '?action=post;' . (empty($row['id_topic']) ? 'board=' . $row['id_board'] : 'topic=' . $row['id_topic']) . '.0;id_draft=' . $row['id_draft'], |
|
| 648 | 648 | 'icon' => 'modify_button' |
| 649 | 649 | ), |
| 650 | 650 | 'delete' => array( |
| 651 | 651 | 'label' => $txt['draft_delete'], |
| 652 | - 'href' => $scripturl.'?action=profile;u='.$context['member']['id'].';area=showdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 653 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'"', |
|
| 652 | + 'href' => $scripturl . '?action=profile;u=' . $context['member']['id'] . ';area=showdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 653 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '"', |
|
| 654 | 654 | 'class' => 'you_sure', |
| 655 | 655 | 'icon' => 'remove_button' |
| 656 | 656 | ), |
@@ -837,13 +837,13 @@ discard block |
||
| 837 | 837 | 'quickbuttons' => array( |
| 838 | 838 | 'edit' => array( |
| 839 | 839 | 'label' => $txt['draft_edit'], |
| 840 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;id_draft='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 840 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;id_draft=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 841 | 841 | 'icon' => 'modify_button' |
| 842 | 842 | ), |
| 843 | 843 | 'delete' => array( |
| 844 | 844 | 'label' => $txt['draft_delete'], |
| 845 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 846 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'?"', |
|
| 845 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 846 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '?"', |
|
| 847 | 847 | 'class' => 'you_sure', |
| 848 | 848 | 'icon' => 'remove_button' |
| 849 | 849 | ), |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $class_name = $this->getImplementationClassKeyName(); |
| 185 | 185 | $class_name_txt_key = strtolower($class_name); |
| 186 | 186 | |
| 187 | - $config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings']; |
|
| 187 | + $config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings']; |
|
| 188 | 188 | $config_vars[] = array('cachedir', $txt['cachedir'], 'file', 'text', 36, 'cache_cachedir'); |
| 189 | 189 | |
| 190 | 190 | if (!isset($context['settings_post_javascript'])) |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $context['settings_post_javascript'] .= ' |
| 194 | 194 | $("#cache_accelerator").change(function (e) { |
| 195 | 195 | var cache_type = e.currentTarget.value; |
| 196 | - $("#cachedir").prop("disabled", cache_type != "'. $class_name .'"); |
|
| 196 | + $("#cachedir").prop("disabled", cache_type != "'. $class_name . '"); |
|
| 197 | 197 | });'; |
| 198 | 198 | } |
| 199 | 199 | |
@@ -131,14 +131,14 @@ discard block |
||
| 131 | 131 | $class_name = $this->getImplementationClassKeyName(); |
| 132 | 132 | $class_name_txt_key = strtolower($class_name); |
| 133 | 133 | |
| 134 | - $config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings']; |
|
| 134 | + $config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings']; |
|
| 135 | 135 | $config_vars[] = array( |
| 136 | - 'cachedir_'. $class_name_txt_key, |
|
| 137 | - $txt['cachedir_'. $class_name_txt_key], |
|
| 136 | + 'cachedir_' . $class_name_txt_key, |
|
| 137 | + $txt['cachedir_' . $class_name_txt_key], |
|
| 138 | 138 | 'file', |
| 139 | 139 | 'text', |
| 140 | 140 | 36, |
| 141 | - 'cache_'. $class_name_txt_key .'_cachedir'); |
|
| 141 | + 'cache_' . $class_name_txt_key . '_cachedir'); |
|
| 142 | 142 | |
| 143 | 143 | if (!isset($context['settings_post_javascript'])) |
| 144 | 144 | $context['settings_post_javascript'] = ''; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $context['settings_post_javascript'] .= ' |
| 147 | 147 | $("#cache_accelerator").change(function (e) { |
| 148 | 148 | var cache_type = e.currentTarget.value; |
| 149 | - $("#cachedir_'. $class_name_txt_key .'").prop("disabled", cache_type != "'. $class_name .'"); |
|
| 149 | + $("#cachedir_'. $class_name_txt_key . '").prop("disabled", cache_type != "' . $class_name . '"); |
|
| 150 | 150 | });'; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | 'if (!is_dir(realpath($cachedir)) && is_dir($boarddir . \'/cache\'))', |
| 847 | 847 | ' $cachedir = $boarddir . \'/cache\';', |
| 848 | 848 | )), |
| 849 | - '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', |
|
| 849 | + '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', |
|
| 850 | 850 | ), |
| 851 | 851 | 'db_character_set' => array( |
| 852 | 852 | 'text' => implode("\n", array( |
@@ -945,8 +945,8 @@ discard block |
||
| 945 | 945 | 'boolean' => '(?i:TRUE|FALSE|(["\']?)[01]\b\\1)', |
| 946 | 946 | 'NULL' => '(?i:NULL)', |
| 947 | 947 | // These use a PCRE subroutine to match nested arrays. |
| 948 | - 'array' => 'array\s*(\((?'.'>[^()]|(?1))*\))', |
|
| 949 | - 'object' => '\w+::__set_state\(array\s*(\((?'.'>[^()]|(?1))*\))\)', |
|
| 948 | + 'array' => 'array\s*(\((?' . '>[^()]|(?1))*\))', |
|
| 949 | + 'object' => '\w+::__set_state\(array\s*(\((?' . '>[^()]|(?1))*\))\)', |
|
| 950 | 950 | ); |
| 951 | 951 | |
| 952 | 952 | /* |
@@ -979,7 +979,7 @@ discard block |
||
| 979 | 979 | ), |
| 980 | 980 | // Remove the code that redirects to the installer. |
| 981 | 981 | $neg_index-- => array( |
| 982 | - 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?'.'>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
| 982 | + 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?' . '>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
| 983 | 983 | 'placeholder' => '', |
| 984 | 984 | ), |
| 985 | 985 | ); |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | // Prevents warnings about constants that are already defined. |
| 1743 | 1743 | $settingsText = preg_replace_callback( |
| 1744 | 1744 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
| 1745 | - function ($matches) |
|
| 1745 | + function($matches) |
|
| 1746 | 1746 | { |
| 1747 | 1747 | return 'define(\'' . md5(mt_rand()) . '\''; |
| 1748 | 1748 | }, |
@@ -1752,7 +1752,7 @@ discard block |
||
| 1752 | 1752 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
| 1753 | 1753 | try |
| 1754 | 1754 | { |
| 1755 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
| 1755 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
| 1756 | 1756 | throw new ErrorException('eval error'); |
| 1757 | 1757 | |
| 1758 | 1758 | unset($mtime, $settingsFile, $settingsText); |
@@ -1955,7 +1955,7 @@ discard block |
||
| 1955 | 1955 | } |
| 1956 | 1956 | |
| 1957 | 1957 | // Everything is simpler if we convert heredocs to normal strings first. |
| 1958 | - if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1958 | + if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1959 | 1959 | { |
| 1960 | 1960 | foreach ($matches[0] as $mkey => $heredoc) |
| 1961 | 1961 | { |
@@ -1969,7 +1969,7 @@ discard block |
||
| 1969 | 1969 | } |
| 1970 | 1970 | |
| 1971 | 1971 | // Split before everything that could possibly delimit a comment or a string. |
| 1972 | - $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1972 | + $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1973 | 1973 | |
| 1974 | 1974 | $in_string = 0; |
| 1975 | 1975 | $in_comment = 0; |
@@ -1638,7 +1638,7 @@ |
||
| 1638 | 1638 | $cacheAPIdir = $sourcedir . '/Cache'; |
| 1639 | 1639 | |
| 1640 | 1640 | $loadedApis = array(); |
| 1641 | - $apis_dir = $cacheAPIdir .'/'. CacheApi::APIS_FOLDER; |
|
| 1641 | + $apis_dir = $cacheAPIdir . '/' . CacheApi::APIS_FOLDER; |
|
| 1642 | 1642 | |
| 1643 | 1643 | $api_classes = new GlobIterator($apis_dir . '/*.php', FilesystemIterator::NEW_CURRENT_AND_KEY); |
| 1644 | 1644 | |
@@ -195,8 +195,7 @@ |
||
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | 197 | $categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ? |
| 198 | - '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : |
|
| 199 | - $row_board['cat_name']); |
|
| 198 | + '<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']); |
|
| 200 | 199 | |
| 201 | 200 | } |
| 202 | 201 | |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | clean_cache('data'); |
| 853 | 853 | |
| 854 | - cache_put_data('parsed_boards_descriptions_'. $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
| 854 | + cache_put_data('parsed_boards_descriptions_' . $parsed_boards_cat_id, $already_parsed_boards, 864000); |
|
| 855 | 855 | |
| 856 | 856 | if (empty($boardOptions['dont_log'])) |
| 857 | 857 | logAction('edit_board', array('board' => $board_id), 'admin'); |
@@ -1579,7 +1579,7 @@ discard block |
||
| 1579 | 1579 | $context['description_allowed_tags'] |
| 1580 | 1580 | ); |
| 1581 | 1581 | |
| 1582 | - cache_put_data('parsed_boards_descriptions_'. $category_id, $already_parsed_boards, 864000); |
|
| 1582 | + cache_put_data('parsed_boards_descriptions_' . $category_id, $already_parsed_boards, 864000); |
|
| 1583 | 1583 | |
| 1584 | 1584 | return $already_parsed_boards; |
| 1585 | 1585 | } |