diff --git a/plugin/ScriptLoader/ScriptLoaderGenericConfigurationDefault.php b/plugin/ScriptLoader/ScriptLoaderGenericConfigurationDefault.php index 731a82afa..98a9b3cdc 100644 --- a/plugin/ScriptLoader/ScriptLoaderGenericConfigurationDefault.php +++ b/plugin/ScriptLoader/ScriptLoaderGenericConfigurationDefault.php @@ -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')); } /** @@ -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); }