-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2482 from ec-europa/release-2.5.136.4
Release 2.5.136.4
- Loading branch information
Showing
2 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
resources/patches/target-modified-implementing-redirection.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/redirect.module b/redirect.module | ||
index 5d92399..311e7a7 100644 | ||
--- a/redirect.module | ||
+++ b/redirect.module | ||
@@ -1430,6 +1430,8 @@ function redirect_variables() { | ||
|
||
function redirect_parse_url($url) { | ||
$original_url = $url; | ||
+ $is_external = url_is_external($url); | ||
+ | ||
$url = trim($url, " \t\n\r\0\x0B\/"); | ||
$parsed = parse_url($url); | ||
|
||
@@ -1456,7 +1458,12 @@ function redirect_parse_url($url) { | ||
} | ||
} | ||
|
||
- $url = trim($url, '/'); | ||
+ // At this point, a URL with a query or fragment may still have a trailing | ||
+ // slash. Trim the trailing slash from "internal" Drupal paths (and other | ||
+ // local paths). | ||
+ if (!$is_external) { | ||
+ $url = trim($url, '/'); | ||
+ } | ||
|
||
// Convert to frontpage paths. | ||
if ($url == '<front>') { |