mirror of
https://github.com/getgrav/grav.git
synced 2026-02-07 15:20:21 +01:00
Return false if the string is less than 4 chars, it cannot contain the lang code. Prevents error in the method
This commit is contained in:
@@ -379,6 +379,10 @@ abstract class Utils
|
||||
*/
|
||||
public static function pathPrefixedByLangCode($string)
|
||||
{
|
||||
if (strlen($string) <= 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$languages_enabled = self::getGrav()['config']->get('system.languages.supported', []);
|
||||
|
||||
if ($string[0] == '/' && $string[3] == '/' && in_array(substr($string, 1, 2), $languages_enabled)) {
|
||||
|
||||
Reference in New Issue
Block a user