mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-22 11:54:41 +02:00
Allow locales like de_DE in removeLocaleFromPath function
Related to issue #563
This commit is contained in:
parent
eb02404d49
commit
445229976f
2 changed files with 5 additions and 3 deletions
|
@ -127,7 +127,7 @@ final class UserExtension extends AbstractExtension
|
|||
public function removeLocaleFromPath(string $path): string
|
||||
{
|
||||
//Ensure the path has the correct format
|
||||
if (!preg_match('/^\/\w{2}\//', $path)) {
|
||||
if (!preg_match('/^\/\w{2}(?:_\w{2})?\//', $path)) {
|
||||
throw new \InvalidArgumentException('The given path is not a localized path!');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue