Sort custom namespaces from longest to shortest before compiling regexp

This commit is contained in:
Kijin Sung 2023-08-12 01:17:14 +09:00
parent 48e0f55d6b
commit cd0779862e

View file

@ -1485,6 +1485,7 @@ class ModuleController extends Module
}
if (count($regexp))
{
usort($regexp, function($a, $b) { return strlen($b) - strlen($a); });
$namespaces['regexp'] = '!^(' . implode('|', $regexp) . ')/(\\w+/)*(\\w+)$!';
}