Skip to content

Commit c4a7de6

Browse files
committed
Replace spaces with hyphens in asset edit URLs
Fixes #15236
1 parent 5de3c6b commit c4a7de6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Improved the styling of inactive users’ status indicators. ([#15195](https://github.com/craftcms/cms/issues/15195))
66
- Fixed a bug where other author indicators weren’t shown for Craft Team.
77
- Fixed a bug where the Recent Entries widget wasn’t showing authors’ usernames for Craft Team.
8+
- Fixed a bug where asset edit page URLs contained spaces if the asset filename contained spaces. ([#15236](https://github.com/craftcms/cms/issues/15236))
89

910
## 5.2.3 - 2024-06-20
1011

src/elements/Asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ protected function cpEditUrl(): ?string
14521452
return null;
14531453
}
14541454

1455-
$filename = $this->getFilename(false);
1455+
$filename = preg_replace('/\s+/', '-', $this->getFilename(false));
14561456
$path = "assets/edit/$this->id-$filename";
14571457

14581458
return UrlHelper::cpUrl($path);

0 commit comments

Comments
 (0)