Skip to content

Commit

Permalink
Fixed #2995
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Jun 14, 2018
1 parent de25c1b commit c030adb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions src/helpers/ElementHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit c030adb

Please # to comment.