Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
FIX, #20.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Feb 17, 2017
1 parent ff36d3b commit d23c367
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [misdirection](https://packagist.org/packages/nglasl/silverstripe-misdirection)

_The current release is **2.2.16**_
_The current release is **2.2.17**_

> A module for SilverStripe which will allow both simple and regular expression link redirections based on customisable mappings, either hooking into a page not found or replacing the default automated URL handling.
Expand Down
12 changes: 9 additions & 3 deletions code/services/MisdirectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ public static function is_external_URL($URL) {

public function getMappingByRequest($request, $testing = false) {

// Make sure an external URL comes through correctly.

$link = str_replace(':/', '://', $request->getURL(true));
// Make sure a URL comes through correctly.

$link = str_replace(array(
':/',
' '
), array(
'://',
'%20'
), $request->getURL(true));
$host = $request->getHeader('Host');

// Retrieve the appropriate link mapping.
Expand Down

0 comments on commit d23c367

Please sign in to comment.