diff options
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/captcha/plugins/gd.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/captcha/plugins/gd_wave.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/captcha/plugins/nogd.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/captcha/plugins/qa.php | 7 | ||||
-rw-r--r-- | phpBB/phpbb/captcha/plugins/recaptcha.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/files/upload.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/report_pm.php | 13 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/factory.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/link_helper.php | 25 | ||||
-rw-r--r-- | phpBB/phpbb/user.php | 2 |
10 files changed, 39 insertions, 32 deletions
diff --git a/phpBB/phpbb/captcha/plugins/gd.php b/phpBB/phpbb/captcha/plugins/gd.php index 831e5bcfdf..6d3c9bb3d2 100644 --- a/phpBB/phpbb/captcha/plugins/gd.php +++ b/phpBB/phpbb/captcha/plugins/gd.php @@ -51,7 +51,7 @@ class gd extends captcha_abstract return 'CAPTCHA_GD'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user, $template, $phpbb_log, $request; global $config; diff --git a/phpBB/phpbb/captcha/plugins/gd_wave.php b/phpBB/phpbb/captcha/plugins/gd_wave.php index bde46f8815..4ac26ed2b7 100644 --- a/phpBB/phpbb/captcha/plugins/gd_wave.php +++ b/phpBB/phpbb/captcha/plugins/gd_wave.php @@ -33,7 +33,7 @@ class gd_wave extends captcha_abstract return '\\phpbb\\captcha\\gd_wave'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user; diff --git a/phpBB/phpbb/captcha/plugins/nogd.php b/phpBB/phpbb/captcha/plugins/nogd.php index 6845e5935c..da67cd2bf4 100644 --- a/phpBB/phpbb/captcha/plugins/nogd.php +++ b/phpBB/phpbb/captcha/plugins/nogd.php @@ -33,7 +33,7 @@ class nogd extends captcha_abstract return '\\phpbb\\captcha\\non_gd'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user; diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php index 7797212ac9..70b3f72cc3 100644 --- a/phpBB/phpbb/captcha/plugins/qa.php +++ b/phpBB/phpbb/captcha/plugins/qa.php @@ -107,8 +107,7 @@ class qa $sql = 'SELECT q.question_id, q.lang_iso FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a - WHERE q.question_id = a.question_id - GROUP BY lang_iso'; + WHERE q.question_id = a.question_id'; $result = $db->sql_query($sql, 7200); while ($row = $db->sql_fetchrow($result)) @@ -638,7 +637,7 @@ class qa /** * API function - The ACP backend, this marks the end of the easy methods */ - function acp_page($id, &$module) + function acp_page($id, $module) { global $config, $request, $phpbb_log, $template, $user; @@ -776,7 +775,7 @@ class qa /** * This handles the list overview */ - function acp_question_list(&$module) + function acp_question_list($module) { global $db, $template; diff --git a/phpBB/phpbb/captcha/plugins/recaptcha.php b/phpBB/phpbb/captcha/plugins/recaptcha.php index 152709a9ea..b7c0b5f5e2 100644 --- a/phpBB/phpbb/captcha/plugins/recaptcha.php +++ b/phpBB/phpbb/captcha/plugins/recaptcha.php @@ -66,7 +66,7 @@ class recaptcha extends captcha_abstract throw new \Exception('No generator class given.'); } - function acp_page($id, &$module) + function acp_page($id, $module) { global $config, $template, $user, $phpbb_log, $request; diff --git a/phpBB/phpbb/files/upload.php b/phpBB/phpbb/files/upload.php index a9bf74094d..50e15c9844 100644 --- a/phpBB/phpbb/files/upload.php +++ b/phpBB/phpbb/files/upload.php @@ -261,7 +261,7 @@ class upload * * @param filespec $file Instance of filespec class */ - public function common_checks(&$file) + public function common_checks($file) { // Filesize is too big or it's 0 if it was larger than the maxsize in the upload form if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0)) @@ -297,7 +297,7 @@ class upload * * @return bool True if extension is allowed, false if not */ - public function valid_extension(&$file) + public function valid_extension($file) { return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false; } @@ -310,7 +310,7 @@ class upload * @return bool True if dimensions are valid or no constraints set, false * if not */ - public function valid_dimensions(&$file) + public function valid_dimensions($file) { if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height) { @@ -350,7 +350,7 @@ class upload * * @return bool True if content is valid, false if not */ - public function valid_content(&$file) + public function valid_content($file) { return ($file->check_content($this->disallowed_content)); } diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 7e53ffb3ca..444f98270d 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -142,13 +142,16 @@ class report_pm extends \phpbb\notification\type\pm */ public function get_email_template_variables() { - $user_data = $this->user_loader->get_user($this->get_data('reporter_id')); + $user_data = $this->user_loader->get_user($this->get_data('from_user_id')); return array( 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), - 'U_VIEW_REPORT' => generate_board_url() . "mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details", + /** @deprecated 3.2.6-RC1 (to be removed in 4.0.0) use {SUBJECT} instead in report_pm.txt */ + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), + + 'U_VIEW_REPORT' => generate_board_url() . "/mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details", ); } @@ -236,8 +239,10 @@ class report_pm extends \phpbb\notification\type\pm */ public function users_to_query() { - return array($this->get_data('reporter_id')); - } + return array( + $this->get_data('from_user_id'), + $this->get_data('reporter_id'), + ); } /** * {@inheritdoc} diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index c0bbc7b0e8..6191b9a315 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -354,6 +354,14 @@ class factory implements \phpbb\textformatter\cache_interface // Load the Emoji plugin and modify its tag's template to obey viewsmilies $tag = $configurator->Emoji->getTag(); + $tag->template = '<xsl:choose> + <xsl:when test="@tseq"> + <img alt="{.}" class="emoji" draggable="false" src="//twemoji.maxcdn.com/2/svg/{@tseq}.svg"/> + </xsl:when> + <xsl:otherwise> + <img alt="{.}" class="emoji" draggable="false" src="https://cdn.jsdelivr.net/gh/s9e/emoji-assets-twemoji@11.2/dist/svgz/{@seq}.svgz"/> + </xsl:otherwise> + </xsl:choose>'; $tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>'; /** diff --git a/phpBB/phpbb/textformatter/s9e/link_helper.php b/phpBB/phpbb/textformatter/s9e/link_helper.php index 0f44603dec..1e113b6449 100644 --- a/phpBB/phpbb/textformatter/s9e/link_helper.php +++ b/phpBB/phpbb/textformatter/s9e/link_helper.php @@ -23,14 +23,16 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param \s9e\TextFormatter\Parser $parser Parser - * @return bool Whether the tag is valid + * @return void */ public function cleanup_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) { // Invalidate if the content of the tag matches the text attribute $text = substr($parser->getText(), $tag->getPos(), $tag->getLen()); - - return ($text !== $tag->getAttribute('text')); + if ($text === $tag->getAttribute('text')) + { + $tag->invalidate(); + } } /** @@ -40,7 +42,7 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag URL tag (start tag) * @param \s9e\TextFormatter\Parser $parser Parser - * @return bool Always true to indicate that the tag is valid + * @return void */ public function generate_link_text_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) { @@ -49,7 +51,7 @@ class link_helper // the [url] BBCode when its content is used for the URL if (!$tag->getEndTag() || !$this->should_shorten($tag, $parser->getText())) { - return true; + return; } // Capture the text between the start tag and its end tag @@ -60,8 +62,6 @@ class link_helper // Create a tag that consumes the link's text $parser->addSelfClosingTag('LINK_TEXT', $start, $length)->setAttribute('text', $text); - - return true; } /** @@ -84,7 +84,7 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param string $board_url Forum's root URL (with trailing slash) - * @return bool Always true to indicate that the tag is valid + * @return void */ public function truncate_local_url(\s9e\TextFormatter\Parser\Tag $tag, $board_url) { @@ -93,15 +93,13 @@ class link_helper { $tag->setAttribute('text', substr($text, strlen($board_url))); } - - return true; } /** * Truncate the replacement text set in a LINK_TEXT tag * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag - * @return bool Always true to indicate that the tag is valid + * @return void */ public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag) { @@ -109,10 +107,7 @@ class link_helper if (utf8_strlen($text) > 55) { $text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10); + $tag->setAttribute('text', $text); } - - $tag->setAttribute('text', $text); - - return true; } } diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index ca0e5872e4..7363290e11 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -343,7 +343,7 @@ class user extends \phpbb\session } // Is board disabled and user not an admin or moderator? - if ($config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + if ($config['board_disable'] && !defined('IN_INSTALL') && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { if ($this->data['is_bot']) { |