summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/bootstrap.inc5
-rw-r--r--includes/language.inc2
-rw-r--r--includes/path.inc2
3 files changed, 7 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5dd22249d..a5b2d1afd 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -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;
}
diff --git a/includes/language.inc b/includes/language.inc
index 608ed112e..43a4961a0 100644
--- a/includes/language.inc
+++ b/includes/language.inc
@@ -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.
diff --git a/includes/path.inc b/includes/path.inc
index 240f375f0..9e38d1171 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -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'));