From 3f1e53b181508b3d5bf1c0f377f17a5055eb6e42 Mon Sep 17 00:00:00 2001 From: Nathan Glasl Date: Thu, 25 Feb 2016 15:02:30 +1100 Subject: [PATCH] Cleaning up a minor class definition. --- code/dataobjects/LinkMapping.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/dataobjects/LinkMapping.php b/code/dataobjects/LinkMapping.php index 2928e91..815d87d 100644 --- a/code/dataobjects/LinkMapping.php +++ b/code/dataobjects/LinkMapping.php @@ -284,13 +284,13 @@ public function validate() { // Determine whether a regular expression mapping is possible to match against. - if(($this->LinkType === 'Regular Expression') && $result->valid() && (!$this->MappedLink || !is_numeric(@preg_match("%{$this->MappedLink}%", null)))) { + if($result->valid() && ($this->LinkType === 'Regular Expression') && (!$this->MappedLink || !is_numeric(@preg_match("%{$this->MappedLink}%", null)))) { $result->error('Invalid regular expression!'); } // Use third party validation to determine an external URL (https://gist.github.com/dperini/729294 and http://mathiasbynens.be/demo/url-regex). - if($this->ValidateExternal && $this->RedirectLink && $result->valid() && !MisdirectionService::is_external_URL($this->RedirectLink)) { + else if($result->valid() && $this->ValidateExternal && $this->RedirectLink && !MisdirectionService::is_external_URL($this->RedirectLink)) { $result->error('External URL validation failed!'); }