Bug #51632 [NEW]: filter_var fails to validate correct URL
From:
Operating system: FreeBSD
PHP version: 5.3.2
Package: Unknown/Other Function
Bug Type: Bug
Bug description:filter_var fails to validate correct URL
Description:
------------
Function filter_var seems to change it behavior when PHP upgraded from
5.2.4 to 5.3.2.
The next example work fine in 5.24 but fail in 5.3.2.
This problem was described in Bug #51305 (filter_var fails if domain name
contain "-") and reported to be fixed in 5.2.13, but it is bubble again in
5.3.2 :
Test script:
---------------
<?php
$P = 'http://m-zharkikh.livejournal.com/26556.html';
echo filter_var($P, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED);
Expected result:
----------------
http://m-zharkikh.livejournal.com/26556.html,
so URL is valid
Actual result:
--------------
false, so URL provided evaluated as invalid
--
Edit bug report at http://bugs.php.net/bug.php?id=51632&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51632&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51632&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51632&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51632&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51632&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51632&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51632&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51632&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51632&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51632&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51632&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51632&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51632&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51632&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51632&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51632&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51632&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51632&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51632&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51632&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51632&r=mysqlcfg
Thread (4 messages)
- zharkikh at i dot com dot ua