MDL-63967 libs: some filter_var() filters are deprecated with php73

The explicit usage of the constants FILTER_FLAG_SCHEME_REQUIRED and
FILTER_FLAG_HOST_REQUIRED is now deprecated; both are implied for
FILTER_VALIDATE_URL anyway.
This commit is contained in:
Eloy Lafuente (stronk7)
2019-02-01 11:56:24 +01:00
parent 2188da9eed
commit 74647f9ca3
4 changed files with 17 additions and 3 deletions
+8 -1
View File
@@ -21,4 +21,11 @@ UPGRADING.md
composer.json
get_oauth_token.php
phpdoc.dist.xml
travis.phpunit.xml.dist
travis.phpunit.xml.dist
Local changes (to verify/apply with new imports):
- MDL-63967: PHP 7.3 compatibility.
lib/phpmailer/src/PHPMailer.php: FILTER_FLAG_HOST_REQUIRED is deprecated and
implied with FILTER_VALIDATE_URL. This was fixed upstream by
https://github.com/PHPMailer/PHPMailer/pull/1551
+1 -1
View File
@@ -3578,7 +3578,7 @@ class PHPMailer
//Is it a valid IPv4 address?
return (bool) filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
}
if (filter_var('http://' . $host, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED)) {
if (filter_var('http://' . $host, FILTER_VALIDATE_URL)) {
//Is it a syntactically valid hostname?
return true;
}
+1 -1
View File
@@ -1527,7 +1527,7 @@ final class t3lib_div {
require_once(PATH_typo3 . 'contrib/idna/idna_convert.class.php');
$IDN = new idna_convert(array('idn_version' => 2008));
return (filter_var($IDN->encode($url), FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== FALSE);
return (filter_var($IDN->encode($url), FILTER_VALIDATE_URL) !== FALSE);
}
+7
View File
@@ -8,4 +8,11 @@ Procedure:
2/ copy csconvtbl/*, unidata/* and all other necessary files we use
3/ run our phpunit tests with and without mbstring PHP extension
Local changes (to verify/apply with new imports):
- MDL-63967: PHP 7.3 compatibility.
lib/typo3/class.t3lib_div.php: FILTER_FLAG_SCHEME_REQUIRED is deprecated and
implied with FILTER_VALIDATE_URL. This is fixed upstream since Typo 6, with
the file class now under \TYPO3\CMS\Core\Utility\GeneralUtility.
skodak, stronk7, moodler