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

Commit b45b483

Browse files
author
Nathan Glasl
committed
[FIX] The validation now checks for empty vanity mappings.
1 parent 7548913 commit b45b483

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [misdirection](https://packagist.org/packages/nglasl/silverstripe-misdirection)
22

3-
_The current release is **2.3.0**_
3+
_The current release is **2.3.1**_
44

55
> 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.
66

code/extensions/SiteTreeMisdirectionExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public function validate(ValidationResult $result) {
4343
// Retrieve the vanity mapping URL, where this is only possible using the POST variable.
4444

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

4750
// Determine whether another vanity mapping already exists.
4851

0 commit comments

Comments
 (0)