Skip to content

Commit 926c0d2

Browse files
committed
Allow more chars in metadata keys
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 8593654 commit 926c0d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/private/FilesMetadata/Model/FilesMetadata.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,11 @@ public function removeStartsWith(string $keyPrefix): IFilesMetadata {
490490
* @throws FilesMetadataKeyFormatException
491491
*/
492492
private function confirmKeyFormat(string $key): void {
493-
if (ctype_alnum(str_replace('-', '', $key))) {
493+
if (ctype_alnum(str_replace(['-', '_'], '', $key))) {
494494
return;
495495
}
496496

497-
throw new FilesMetadataKeyFormatException('key can only contains alphanumerical characters, and dash (-)');
497+
throw new FilesMetadataKeyFormatException('key can only contains alphanumerical characters, and dash (-, _)');
498498
}
499499

500500
/**

0 commit comments

Comments
 (0)