Skip to content

Commit

Permalink
Slash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Rockett committed Aug 26, 2016
1 parent 7ac20ad commit 59b35e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ProcessJumplinks.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ protected function scanAndRedirect()
array('\?', '/?', '\&', '\:'),
$jumplink->source
));
// As a workaround for query strings attached to trailing slashes
// ensure that slashes are not made optional in the middle of the source.
// Refer: https://processwire.com/talk/topic/8697-jumplinks/?do=findComment&comment=126551
$source = preg_replace('~(.+)/\?(.+)~', '\\1/\?\\2', $source);

// Reverse ':' escaping for wildcards
$source = preg_replace("~\{([a-z]+)\\\:([a-z]+)\}~i", "{\\1:\\2}", $source);
Expand Down

0 comments on commit 59b35e2

Please sign in to comment.