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

Commit

Permalink
Cleaning up a minor class definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Feb 25, 2016
1 parent c1f948b commit 3f1e53b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/dataobjects/LinkMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
}

Expand Down

0 comments on commit 3f1e53b

Please sign in to comment.