MDL-65479 repository_url: make regexp PCRE2 compatible

PHP 7.3 comes with the newer PCRE2 engine that is slightly stricter,
more specifically about using unescaped "-" within classes. They
now hat to be at the end of the class or escaped.

This is the only case we have found in core to make it compatible.

Also note that the file changes is, apparently an imported library,
but we have not it registered and already have performed changes to
it, so I've ignored that point. In fact, it has tabs and so on, I've
not modified that either.
This commit is contained in:
Eloy Lafuente (stronk7) 2019-05-04 12:02:58 +02:00
parent 2018f4ebc1
commit b450745465

View File

@ -279,7 +279,7 @@ function split_url( $url, $decode=FALSE)
// Host name from RFC1035. Technically, must start with a letter.
// Relax that restriction to better parse URL structure, then
// leave host name validation to application.
$xhost_name = '([a-zA-Z\d-.%]+)';
$xhost_name = '([a-zA-Z\d\-.%]+)';
// Authority from RFC3986. Skip IP future.
$xhost = '(' . $xhost_name . '|' . $xipv4 . '|' . $xipv6 . ')';