Wpis z mikrobloga

Witam, zainstalowałem skrypt ale mam błąd:

"Message: 'preg_match(): Compilation failed: invalid range in character class at offset 19'".

Prawdopodobnie gdzieś tutaj:

public function add(string $route, array $params = [])
{
/* Convert the route to a regular expression: escape forward slashes */
$route = preg_replace('/\//', '\/', $route);

/* Convert variables e.g. {controller} {action} */
$route = preg_replace('/\{([a-z]+)\}/', '(?P<\1>[a-z-]+)', $route);

/* Convert variables with custom regular expressions e.g. {id:\d+} */
$route = preg_replace('/\{([a-z]+):([^\}]+)\}/', '(?P<\1>\2)', $route);

/* Add start and end delimiters, and case insensitive flag */
$route = '/^' . $route . '$/i';

$this->routes[$route] = $params;
}

Czy jest w stanie ktoś pomóc?

#php #programowanie
  • 3
@BujakaPL:
No ale bez wiedzy co jest w $route to niewiele można z tego wywnioskować.

Ale prawdopodobnie masz starszy skrypt, i niewłaściwie wyescapowany regexp tam trafia bo od php 7.3 były zmiany drobne afair.