Commit 632ae14d authored by webchick's avatar webchick

#587706 follow-up by plach: trim GET['q'] centrally in request_path() so...

#587706 follow-up by plach: trim GET['q'] centrally in request_path() so subsequent places don't have to do it.
parent b00ab9d1
......@@ -2188,6 +2188,11 @@ function request_path() {
$path = '';
}
// Under certain conditions Apache's RewriteRule directive prepends the value
// assigned to $_GET['q'] with a slash. Moreover we can always have a trailing
// slash in place, hence we need to normalize $_GET['q'].
$path = trim($path, '/');
return $path;
}
......
......@@ -359,7 +359,7 @@ function language_from_default() {
* - The path without the prefix on success, the given path otherwise.
*/
function language_url_split_prefix($path, $languages) {
$args = empty($path) ? array() : explode('/', trim($path, '/'));
$args = empty($path) ? array() : explode('/', $path);
$prefix = array_shift($args);
// Search prefix within enabled languages.
......
......@@ -15,7 +15,7 @@
*/
function drupal_path_initialize() {
if (!empty($_GET['q'])) {
$_GET['q'] = drupal_get_normal_path(trim($_GET['q'], '/'));
$_GET['q'] = drupal_get_normal_path($_GET['q']);
}
else {
$_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment