diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/.htaccess | 7 | ||||
-rw-r--r-- | phpBB/docs/nginx.sample.conf | 4 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 5 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 15 | ||||
-rw-r--r-- | phpBB/phpbb/db/tools.php | 21 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/factory.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/link_helper.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/parser.php | 20 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/quote_helper.php | 22 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/bbcode.html | 4 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/ucp_agreement.html | 3 |
11 files changed, 64 insertions, 41 deletions
diff --git a/phpBB/.htaccess b/phpBB/.htaccess index 53bce762ea..0be28ab670 100644 --- a/phpBB/.htaccess +++ b/phpBB/.htaccess @@ -36,6 +36,13 @@ RewriteRule ^(.*)$ app.php [QSA,L] #Options +FollowSymLinks </IfModule> +# Apache content negotation tries to interpret non-existent paths as files if +# MultiViews is enabled. This will however cause issues with paths containg +# dots, e.g. for the cron tasks +<IfModule mod_negotiation.c> + Options -MultiViews +</IfModule> + # With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from # module mod_authz_host to a new module called mod_access_compat (which may be # disabled) and a new "Require" syntax has been introduced to mod_authz_host. diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf index 55c01a1fc9..848998cfeb 100644 --- a/phpBB/docs/nginx.sample.conf +++ b/phpBB/docs/nginx.sample.conf @@ -93,7 +93,7 @@ http { # Correctly pass scripts for installer location /install/ { # phpBB uses index.htm - try_files $uri $uri/ @rewrite_installapp; + try_files $uri $uri/ @rewrite_installapp =404; # Pass the php scripts to fastcgi server specified in upstream declaration. location ~ \.php(/|$) { @@ -104,7 +104,7 @@ http { fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; - try_files $uri $uri/ /install/app.php$is_args$args; + try_files $uri $uri/ /install/app.php$is_args$args =404; fastcgi_pass php; } } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 06baa279a5..87a8c91fd2 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -999,7 +999,10 @@ function compose_pm($id, $mode, $action, $user_folders = array()) { $quote_attributes['post_id'] = $post['msg_id']; } - + if ($action === 'quote') + { + $quote_attributes['msg_id'] = $post['msg_id']; + } /** @var \phpbb\language\language $language */ $language = $phpbb_container->get('language'); /** @var \phpbb\textformatter\utils_interface $text_formatter_utils */ diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 694aaf1351..00fa8034f9 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -39,7 +39,8 @@ class ucp_register trigger_error('UCP_REGISTER_DISABLE'); } - $coppa = $request->is_set('coppa') ? (int) $request->variable('coppa', false) : false; + $coppa = $request->is_set('coppa_yes') ? 1 : ($request->is_set('coppa_no') ? 0 : false); + $coppa = $request->is_set('coppa') ? $request->variable('coppa', 0) : $coppa; $agreed = $request->variable('agreed', false); $submit = $request->is_set_post('submit'); $change_lang = $request->variable('change_lang', ''); @@ -50,6 +51,11 @@ class ucp_register $agreed = false; } + if ($coppa !== false && !check_form_key('ucp_register')) + { + $coppa = false; + } + /** * Add UCP register data before they are assigned to the template or submitted * @@ -166,11 +172,8 @@ class ucp_register $template_vars = array( 'S_LANG_OPTIONS' => (count($lang_row) > 1) ? language_select($user_lang) : '', - 'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday), - 'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday), - - 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0'), - 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1'), + 'L_COPPA_NO' => $user->lang('UCP_COPPA_BEFORE', $coppa_birthday), + 'L_COPPA_YES' => $user->lang('UCP_COPPA_ON_AFTER', $coppa_birthday), 'S_SHOW_COPPA' => true, 'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields), diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php deleted file mode 100644 index 4d1b91f7b4..0000000000 --- a/phpBB/phpbb/db/tools.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** -* -* This file is part of the phpBB Forum Software package. -* -* @copyright (c) phpBB Limited <https://www.phpbb.com> -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\db; - -/** - * @deprecated 3.2.0-dev (To be removed 3.3.0) use \phpbb\db\tools\tools instead - */ -class tools extends \phpbb\db\tools\tools -{ -} diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index dca1c78d40..f82c7b0771 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -89,6 +89,8 @@ class factory implements \phpbb\textformatter\cache_interface author={TEXT1;optional} post_id={UINT;optional} post_url={URL;optional;postFilter=#false} + msg_id={UINT;optional} + msg_url={URL;optional;postFilter=#false} profile_url={URL;optional;postFilter=#false} time={UINT;optional} url={URL;optional} diff --git a/phpBB/phpbb/textformatter/s9e/link_helper.php b/phpBB/phpbb/textformatter/s9e/link_helper.php index 483794a83e..1cd5dd2fa7 100644 --- a/phpBB/phpbb/textformatter/s9e/link_helper.php +++ b/phpBB/phpbb/textformatter/s9e/link_helper.php @@ -61,7 +61,7 @@ class link_helper $text = substr($parser->getText(), $start, $length); // Create a tag that consumes the link's text and make it depends on this tag - $link_text_tag = $parser->addSelfClosingTag('LINK_TEXT', $start, $length); + $link_text_tag = $parser->addSelfClosingTag('LINK_TEXT', $start, $length, 10); $link_text_tag->setAttribute('text', $text); $tag->cascadeInvalidationTo($link_text_tag); } diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index a36fc63141..f7e4668980 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -15,6 +15,7 @@ namespace phpbb\textformatter\s9e; use s9e\TextFormatter\Parser\AttributeFilters\UrlFilter; use s9e\TextFormatter\Parser\Logger; +use s9e\TextFormatter\Parser\Tag; /** * s9e\TextFormatter\Parser adapter @@ -219,7 +220,7 @@ class parser implements \phpbb\textformatter\parser_interface { $errors[] = array($msg, $context['max_' . strtolower($m[1])]); } - else if ($msg === 'Tag is disabled') + else if ($msg === 'Tag is disabled' && $this->is_a_bbcode($context['tag'])) { $name = strtolower($context['tag']->getName()); $errors[] = array('UNAUTHORISED_BBCODE', '[' . $name . ']'); @@ -396,4 +397,21 @@ class parser implements \phpbb\textformatter\parser_interface return $url; } + + /** + * Test whether given tag consumes text that looks like BBCode-styled markup + * + * @param Tag $tag Original tag + * @return bool + */ + protected function is_a_bbcode(Tag $tag) + { + if ($tag->getLen() < 3) + { + return false; + } + $markup = substr($this->parser->getText(), $tag->getPos(), $tag->getLen()); + + return (bool) preg_match('(^\\[\\w++.*?\\]$)s', $markup); + } } diff --git a/phpBB/phpbb/textformatter/s9e/quote_helper.php b/phpBB/phpbb/textformatter/s9e/quote_helper.php index 86c33c7591..3011ec88dc 100644 --- a/phpBB/phpbb/textformatter/s9e/quote_helper.php +++ b/phpBB/phpbb/textformatter/s9e/quote_helper.php @@ -21,6 +21,11 @@ class quote_helper protected $post_url; /** + * @var string Base URL for a private message link, uses {MSG_ID} as placeholder + */ + protected $msg_url; + + /** * @var string Base URL for a profile link, uses {USER_ID} as placeholder */ protected $profile_url; @@ -40,6 +45,7 @@ class quote_helper public function __construct(\phpbb\user $user, $root_path, $php_ext) { $this->post_url = append_sid($root_path . 'viewtopic.' . $php_ext, 'p={POST_ID}#p{POST_ID}', false); + $this->msg_url = append_sid($root_path . 'ucp.' . $php_ext, 'i=pm&mode=view&p={MSG_ID}', false); $this->profile_url = append_sid($root_path . 'memberlist.' . $php_ext, 'mode=viewprofile&u={USER_ID}', false); $this->user = $user; } @@ -52,26 +58,26 @@ class quote_helper */ public function inject_metadata($xml) { - $post_url = $this->post_url; - $profile_url = $this->profile_url; - $user = $this->user; - return \s9e\TextFormatter\Utils::replaceAttributes( $xml, 'QUOTE', - function ($attributes) use ($post_url, $profile_url, $user) + function ($attributes) { if (isset($attributes['post_id'])) { - $attributes['post_url'] = str_replace('{POST_ID}', $attributes['post_id'], $post_url); + $attributes['post_url'] = str_replace('{POST_ID}', $attributes['post_id'], $this->post_url); + } + if (isset($attributes['msg_id'])) + { + $attributes['msg_url'] = str_replace('{MSG_ID}', $attributes['msg_id'], $this->msg_url); } if (isset($attributes['time'])) { - $attributes['date'] = $user->format_date($attributes['time']); + $attributes['date'] = $this->user->format_date($attributes['time']); } if (isset($attributes['user_id'])) { - $attributes['profile_url'] = str_replace('{USER_ID}', $attributes['user_id'], $profile_url); + $attributes['profile_url'] = str_replace('{USER_ID}', $attributes['user_id'], $this->profile_url); } return $attributes; diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html index 940c0ace29..b37ba238d2 100644 --- a/phpBB/styles/prosilver/template/bbcode.html +++ b/phpBB/styles/prosilver/template/bbcode.html @@ -37,6 +37,10 @@ <xsl:text> </xsl:text> <a href="{@post_url}" data-post-id="{@post_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">↑</a> </xsl:if> + <xsl:if test="@msg_url"> + <xsl:text> </xsl:text> + <a href="{@msg_url}" data-msg-id="{@msg_id}">↑</a> + </xsl:if> <xsl:if test="@date"> <div class="responsive-hide"><xsl:value-of select="@date"/></div> </xsl:if> diff --git a/phpBB/styles/prosilver/template/ucp_agreement.html b/phpBB/styles/prosilver/template/ucp_agreement.html index d4fef9f0a5..7959925d30 100644 --- a/phpBB/styles/prosilver/template/ucp_agreement.html +++ b/phpBB/styles/prosilver/template/ucp_agreement.html @@ -43,7 +43,8 @@ <div class="inner"> <fieldset class="submit-buttons"> <!-- IF S_SHOW_COPPA --> - <strong><a href="{U_COPPA_NO}" class="button1">{L_COPPA_NO}</a></strong> <a href="{U_COPPA_YES}" class="button2">{L_COPPA_YES}</a> + <input type="submit" name="coppa_no" id="coppa_no" value="{{ L_COPPA_NO }}" class="button1" /> + <input type="submit" name="coppa_yes" id="coppa_yes" value="{{ L_COPPA_YES }}" class="button2" /> <!-- ELSE --> <input type="submit" name="agreed" id="agreed" value="{L_AGREE}" class="button1" /> <input type="submit" name="not_agreed" value="{L_NOT_AGREE}" class="button2" /> |