Bug #69670 [NEW]: bad url filtering with filer_flag_host_required
| From: | alexglue at gmail dot com | Date: | Wed, 20 May 2015 09:48:17 +0000 |
| Subject: | Bug #69670 [NEW]: bad url filtering with filer_flag_host_required | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-192779@lists.php.net to get a copy of this message | ||
From: alexglue at gmail dot com
Operating system: ubuntu 14.04
PHP version: 5.6Git-2015-05-20 (Git)
Package: *General Issues
Bug Type: Bug
Bug description:bad url filtering with filer_flag_host_required
Description:
------------
---
From manual page: http://www.php.net/function.filter-var
---
With test script usage we'll got this:
result:
http:///path/by/path?query=124
/path/by/path?query=124
instead of false value;
my php version is "PHP 5.5.9-1ubuntu4.7 (cli) (built: Mar 16 2015
20:47:39)"
Test script:
---------------
<?php
$uri = 'http:///path/by/path?query=124';
$uri = filter_var($uri, FILTER_SANITIZE_URL,
FILTER_FLAG_HOST_REQUIRED);
var_dump($uri);
$uri = '/path/by/path?query=124';
$uri = filter_var($uri, FILTER_SANITIZE_URL,
FILTER_FLAG_HOST_REQUIRED);
var_dump($uri);
?>
Expected result:
----------------
Expected false value when no hostname provided and
FILTER_FLAG_HOST_REQUIRED option set;
--
Edit bug report at https://bugs.php.net/bug.php?id=69670&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69670&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69670&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69670&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69670&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69670&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69670&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69670&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69670&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69670&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69670&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69670&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69670&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69670&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69670&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69670&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69670&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69670&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69670&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69670&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69670&r=mysqlcfg