Skip to content

Commit

Permalink
47254 load script for unit detail (#800)
Browse files Browse the repository at this point in the history
+ Fix Honeypot Bug as mentioned in #857
  • Loading branch information
dai-eastgate authored Jul 26, 2024
1 parent 862162f commit ffd1253
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ private function getShortcodeByPostMeta(): array
*/
private function isEstateListPage(string $content): bool
{
return $this->matchesShortcode($content, self::ESTATE_TAG, 'view', '[^"]*') &&
!$this->matchesShortcode($content, self::ESTATE_TAG, 'view', 'detail') ||
$this->matchesShortcode($content, self::ESTATE_TAG, 'units', '[^"]*');
return ($this->matchesShortcode($content, self::ESTATE_TAG, 'view', '[^"]*') &&
!$this->matchesShortcode($content, self::ESTATE_TAG, 'view', 'detail')) ||
($this->matchesShortcode($content, self::ESTATE_TAG, 'units', '[^"]*') &&
!$this->matchesShortcode($content, self::ESTATE_TAG, 'view', 'detail'));
}

/**
Expand Down Expand Up @@ -184,7 +185,7 @@ private function isFormPage(string $content): bool
*/
private function matchesShortcode(string $content, string $tag, string $attribute, string $valuePattern): bool
{
$pattern = '/\[' . $tag . '\s+' . $attribute . '="' . $valuePattern . '"\]/';
$pattern = '/\[' . $tag . '\s+.*?' . $attribute . '="' . $valuePattern . '".*?\]/';
return (bool) preg_match($pattern, $content);
}

Expand Down

0 comments on commit ffd1253

Please sign in to comment.