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

Commit

Permalink
[FIX] The validation now checks for empty vanity mappings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Feb 11, 2019
1 parent 7548913 commit b45b483
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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.3.0**_
_The current release is **2.3.1**_

> 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
3 changes: 3 additions & 0 deletions code/extensions/SiteTreeMisdirectionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function validate(ValidationResult $result) {
// Retrieve the vanity mapping URL, where this is only possible using the POST variable.

$vanityURL = (!Controller::has_curr() || is_null($controller = Controller::curr()) || is_null($URL = $controller->getRequest()->postVar('VanityURL'))) ? $this->owner->VanityMapping()->MappedLink : $URL;
if(!$vanityURL) {
return $result;
}

// Determine whether another vanity mapping already exists.

Expand Down

0 comments on commit b45b483

Please sign in to comment.