Bug #60054 [NEW]: get_headers() Redirect ../../ error
| From: | greenrover33 at gmail dot com | Date: | Thu, 13 Oct 2011 15:18:35 +0000 |
| Subject: | Bug #60054 [NEW]: get_headers() Redirect ../../ error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-164300@lists.php.net to get a copy of this message | ||
From:
Operating system: Ubuntu
PHP version: 5.3.8
Package: HTTP related
Bug Type: Bug
Bug description:get_headers() Redirect ../../ error
Description:
------------
When i open with: get_headers()
http://www.zebis.ch/Unterricht/Fach/Unterrichtsmaterialien/dateizeigen.php?id=4070&vz=ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv&file=symmetrien.doc
I got 302 Found
Location =>
../../schublade/ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv/docs/symmetrien.doc
PHP try open:
GET
/Unterricht/Fach/Unterrichtsmaterialien//../../schublade/ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv/docs/symmetrien.doc
But it should be:
GET
/Unterricht/schublade/ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv/docs/symmetrien.doc
Browsers can handle that (ie, ff, chrome)
this means:
get_headers() dont execute ../ like browser will do.
Test script:
---------------
<?PHP
$url =
'http://www.zebis.ch/Unterricht/Fach/Unterrichtsmaterialien/dateizeigen.php?id=4070&vz=ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv&file=symmetrien.doc';
$headers = get_headers($url, 1);
print_r($headers);
Expected result:
----------------
GET
/Unterricht/schublade/ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv/docs/symmetrien.doc
Actual result:
--------------
GET
/Unterricht/Fach/Unterrichtsmaterialien//../../schublade/ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv/docs/symmetrien.doc
--
Edit bug report at https://bugs.php.net/bug.php?id=60054&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60054&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60054&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60054&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60054&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60054&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60054&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60054&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60054&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60054&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60054&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60054&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60054&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60054&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60054&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60054&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60054&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60054&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60054&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60054&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60054&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60054&r=mysqlcfg