diff options
-rw-r--r-- | phpBB/adm/style/acp_board.html | 2 | ||||
-rw-r--r-- | phpBB/assets/javascript/editor.js | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_update.php | 5 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 6 | ||||
-rw-r--r-- | phpBB/phpbb/path_helper.php | 13 | ||||
-rw-r--r-- | phpBB/phpbb/session.php | 15 | ||||
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/factory.php | 18 | ||||
-rw-r--r-- | tests/session/extract_page_test.php | 16 |
8 files changed, 67 insertions, 10 deletions
diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 04dee98276..fe3e250099 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -19,9 +19,9 @@ <!-- IF options.S_LEGEND --> <!-- IF not options.S_FIRST_ROW --> </fieldset> + <!-- ENDIF --> <fieldset> - <!-- ENDIF --> <legend>{options.LEGEND}</legend> <!-- ELSE --> diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js index 332ab42e37..23244f5a40 100644 --- a/phpBB/assets/javascript/editor.js +++ b/phpBB/assets/javascript/editor.js @@ -417,7 +417,7 @@ function getCaretPosition(txtarea) { $('textarea').on('keydown', function (e) { if (e.which === 13 && (e.metaKey || e.ctrlKey)) { - $(this).closest('form').submit(); + $(this).closest('form').find(':submit').click(); } }); }); diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index b52f315d7f..9124a59ef2 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -52,7 +52,10 @@ class acp_update $updates_available = array(); } - $template->assign_block_vars('updates_available', $updates_available); + if (!empty($updates_available)) + { + $template->assign_block_vars('updates_available', $updates_available); + } $update_link = $phpbb_root_path . 'install/app.' . $phpEx; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6c15c14300..6a36210dca 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1839,7 +1839,7 @@ function redirect($url, $return = false, $disable_cd_check = false) /** * Re-Apply session id after page reloads */ -function reapply_sid($url) +function reapply_sid($url, $is_route = false) { global $phpEx, $phpbb_root_path; @@ -1861,7 +1861,7 @@ function reapply_sid($url) $url = preg_replace("/$phpEx(&|&)+?/", "$phpEx?", $url); } - return append_sid($url); + return append_sid($url, false, true, false, $is_route); } /** @@ -2184,7 +2184,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo // re-add sid / transform & to & for user->page (user->page is always using &) $use_page = ($u_action) ? $u_action : str_replace('&', '&', $user->page['page']); - $u_action = reapply_sid($phpbb_path_helper->get_valid_page($use_page, $config['enable_mod_rewrite'])); + $u_action = reapply_sid($phpbb_path_helper->get_valid_page($use_page, $config['enable_mod_rewrite']), $phpbb_path_helper->is_router_used()); $u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key; $template->assign_vars(array( diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php index 154361ef64..5b6db35f23 100644 --- a/phpBB/phpbb/path_helper.php +++ b/phpBB/phpbb/path_helper.php @@ -496,4 +496,17 @@ class path_helper return $page; } + + /** + * Tells if the router is currently in use (if the current page is a route or not) + * + * @return bool + */ + public function is_router_used() + { + // Script name URI (e.g. phpBB/app.php) + $script_name = $this->symfony_request->getScriptName(); + + return basename($script_name) === 'app.' . $this->php_ext; + } } diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index c5b50c2b07..6b5b8f2625 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -91,9 +91,18 @@ class session $page_name .= str_replace('%2F', '/', urlencode($symfony_request_path)); } - // current directory within the phpBB root (for example: adm) - $root_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath($root_path))); - $page_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath('./'))); + if (substr($root_path, 0, 2) === './' && strpos($root_path, '..') === false) + { + $root_dirs = explode('/', str_replace('\\', '/', rtrim($root_path, '/'))); + $page_dirs = explode('/', str_replace('\\', '/', '.')); + } + else + { + // current directory within the phpBB root (for example: adm) + $root_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath($root_path))); + $page_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath('./'))); + } + $intersection = array_intersect_assoc($root_dirs, $page_dirs); $root_dirs = array_diff_assoc($root_dirs, $intersection); diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index b3616a3063..d5ad8283d9 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -273,6 +273,11 @@ class factory implements \phpbb\textformatter\cache_interface { $configurator->BBCodes->addCustom($bbcode['usage'], $bbcode['template']); } + if (isset($configurator->tags['QUOTE'])) + { + // Remove the nesting limit and let other services remove quotes at parsing time + $configurator->tags['QUOTE']->nestingLimit = PHP_INT_MAX; + } // Modify the template to disable images/flash depending on user's settings foreach (array('FLASH', 'IMG') as $name) @@ -385,7 +390,18 @@ class factory implements \phpbb\textformatter\cache_interface unset($configurator->tags['censor:tag']); } - $objects = $configurator->finalize(); + $objects = $configurator->finalize(); + + /** + * Access the objects returned by finalize() before they are saved to cache + * + * @event core.text_formatter_s9e_configure_finalize + * @var array objects Array containing a "parser" object, a "renderer" object and optionally a "js" string + * @since 3.2.2-RC1 + */ + $vars = array('objects'); + extract($this->dispatcher->trigger_event('core.text_formatter_s9e_configure_finalize', compact($vars))); + $parser = $objects['parser']; $renderer = $objects['renderer']; diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php index 88eb7b2c1a..f8aa3d27a5 100644 --- a/tests/session/extract_page_test.php +++ b/tests/session/extract_page_test.php @@ -136,6 +136,22 @@ class phpbb_session_extract_page_test extends phpbb_session_test_case 'forum' => 0, ), ), + array( + './community', + '/app.php', + '', + '/', + '/kb', + array( + 'page_name' => 'app.php/kb', + 'page_dir' => '..', + 'query_string' => '', + 'script_path' => '/', + 'root_script_path' => '/community/', + 'page' => '../app.php/kb', + 'forum' => 0, + ), + ), ); } |