[TYPO3-core] RFC #13258: Bugfix: TYPO3 4.2 should work on PHP 5.1 again

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Feb 16 12:59:27 CET 2010


Marcus Krause schrieb am 16.02.2010 12:33:
> Am 16.02.2010 12:18, schrieb Ernesto Baschny [cron IT]:
>> Hi,
>>
>> true! Attached patch fixes the comment.
> 
> I'm sorry, I *cannot* give a +1.
> 
> This is no quivalent. The check you're aiming to commit is a
> "isValidURI" and not "isValidUrl".
> 
> The PHP sourcecode in question is here:
> http://svn.php.net/viewvc/php/php-src/trunk/ext/filter/logical_filters.c?view=markup
> 
> If I'd submit a parameter "mailto:user at example.org" or
> "file:///etc/passwd" the function would return TRUE, too.
> 
> I think at least an additional scheme comparison (http,https) is
> required, too. See PHP sourcecode.

Check the sourcecode in more detail and you will note that there is no
check against which scheme is present. filter_var with
FILTER_FLAG_SCHEME_REQUIRED will be valid on ANY scheme.

The only mentioning mailto, news and file because those do not require a
"host".

Test for yourself:

$url = 'bogus://asdfasdf/';
if (filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
  echo "valid\n";
}

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list