Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

47254 Files are not loaded on property detail page #800

Merged
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
Loading