Skip to content

Commit

Permalink
Use md5() instead of converting the tab name to ASCII
Browse files Browse the repository at this point in the history
Fixes #12602
Resolves #12606
  • Loading branch information
brandonkelly committed Feb 3, 2023
1 parent f59da95 commit 2253f1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- Fixed a MySQL error that occurred when creating a database backup using the default backup command, when running MySQL 5.7.41+ or 8.0.32+. ([#12557](https://github.com/craftcms/cms/issues/12557), [#12560](https://github.com/craftcms/cms/pull/12560))
- Fixed a bug where database backups weren’t respecting SSL database connection settings if they were specified when using MySQL. ([#10351](https://github.com/craftcms/cms/issues/10351), [#11753](https://github.com/craftcms/cms/issues/11753), [#12596](https://github.com/craftcms/cms/pull/12596))
- Fixed a bug where element indexes could stop showing their loading spinner prematurely if the element listing needed to be reloaded multiple times in rapid succession. ([#12595](https://github.com/craftcms/cms/issues/12595))
- Fixed a bug where element editors wouldn’t show tabs that didn’t contain any characters that could be converted to ASCII. ([#12602](https://github.com/craftcms/cms/issues/12602))
- Added `craft\helpers\Db::escapeForLike()`.
- `craft\services\Assets::getAllDescendantFolders()` now has a `$withParent` argument, which can be passed `false` to omit the parent folder from the results. ([#12536](https://github.com/craftcms/cms/issues/12536))
- Deprecated `craft\helpers\DateTimeHelper::timeZoneAbbreviation()`.
Expand Down
5 changes: 3 additions & 2 deletions src/models/FieldLayoutTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ public function setElements(array $elements): void
*/
public function getHtmlId(): string
{
// Use two dashes here in case a tab name starts with “Tab”
return 'tab--' . StringHelper::toKebabCase(StringHelper::toAscii($this->name, 'en'));
// Use md5() here to ensure the result is in ASCII,
// even if it is solely made up of characters that can’t be converted to ASCII
return sprintf('tab-%s', md5($this->name));
}

/**
Expand Down

0 comments on commit 2253f1e

Please sign in to comment.