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 853fdb5 commit c61a64f
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 **3.1.0**_
_The current release is **3.1.1**_

> This module allows 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 src/extensions/SiteTreeMisdirectionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,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 c61a64f

Please sign in to comment.