Skip to content

Commit

Permalink
Skip target validation when MODX tags detected in the content field
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/pr/14137' into 2.x

* origin/pr/14137:
  Skip target validation when MODX tags detected in the content field
  • Loading branch information
opengeek committed Nov 14, 2018
2 parents 03c2359 + 07e4a9e commit b1286d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions core/model/modx/processors/resource/create.class.php
Expand Up @@ -648,7 +648,10 @@ public function checkIfSiteStart() {
public function checkSymLinkTarget() {
$target = $this->getProperty('content', null);

if ($target === null || $target === '') {
$matches = array();
$countFoundTags = $this->modx->getParser()->collectElementTags($target, $matches);

if ($target === null || $target === '' || $countFoundTags) {
return true;
}

Expand All @@ -673,7 +676,10 @@ public function checkSymLinkTarget() {
public function checkWebLinkTarget() {
$target = $this->getProperty('content', null);

if ($target === null || $target === '') {
$matches = array();
$countFoundTags = $this->modx->getParser()->collectElementTags($target, $matches);

if ($target === null || $target === '' || $countFoundTags) {
return true;
}

Expand Down
10 changes: 8 additions & 2 deletions core/model/modx/processors/resource/update.class.php
Expand Up @@ -498,7 +498,10 @@ public function checkDeletedStatus() {
public function checkSymLinkTarget() {
$target = $this->getProperty('content', null);

if ($target === null || $target === '') {
$matches = array();
$countFoundTags = $this->modx->getParser()->collectElementTags($target, $matches);

if ($target === null || $target === '' || $countFoundTags) {
return true;
}

Expand All @@ -523,7 +526,10 @@ public function checkSymLinkTarget() {
public function checkWebLinkTarget() {
$target = $this->getProperty('content', null);

if ($target === null || $target === '') {
$matches = array();
$countFoundTags = $this->modx->getParser()->collectElementTags($target, $matches);

if ($target === null || $target === '' || $countFoundTags) {
return true;
}

Expand Down

0 comments on commit b1286d9

Please sign in to comment.