diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index b0c57df5bdd..d4abefb5fe4 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -4,6 +4,7 @@ ### Fixed - Fixed a caching bug where the Fields service could still think a field existed after it had been deleted. ([#2985](https://github.com/craftcms/cms/issues/2985)) +- Fixed a PHP error that could occur when saving entries with a URI format that contained certain Twig filters. ([#2995](https://github.com/craftcms/cms/issues/2995)) ## 3.0.11 - 2018-06-12 diff --git a/src/helpers/ElementHelper.php b/src/helpers/ElementHelper.php index 93eb48520bd..99235808ff5 100644 --- a/src/helpers/ElementHelper.php +++ b/src/helpers/ElementHelper.php @@ -186,10 +186,7 @@ private static function _isUniqueUri(string $testUri, ElementInterface $element) */ public static function doesUriFormatHaveSlugTag(string $uriFormat): bool { - $element = (object)['slug' => StringHelper::randomString()]; - $uri = Craft::$app->getView()->renderObjectTemplate($uriFormat, $element); - - return StringHelper::contains($uri, $element->slug); + return (bool)preg_match('/\bslug\b/', $uriFormat); } /**