diff --git a/README.md b/README.md index ccf9369..23d21c8 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/code/extensions/SiteTreeMisdirectionExtension.php b/code/extensions/SiteTreeMisdirectionExtension.php index f3945ba..8c7d90a 100644 --- a/code/extensions/SiteTreeMisdirectionExtension.php +++ b/code/extensions/SiteTreeMisdirectionExtension.php @@ -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.