From b4507454653d69442fe0a6c7a9ce236d2e2166d5 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 4 May 2019 12:02:58 +0200 Subject: [PATCH] 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. --- repository/url/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repository/url/locallib.php b/repository/url/locallib.php index d455b7c460e..c8bbab397a6 100644 --- a/repository/url/locallib.php +++ b/repository/url/locallib.php @@ -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 . ')';