Edit report at https://bugs.php.net/bug.php?id=60054&edit=1

 ID:                 60054
 Updated by:         il...@php.net
 Reported by:        greenrover33 at gmail dot com
 Summary:            get_headers() Redirect ../../ error
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            HTTP related
 Operating System:   Ubuntu
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

With newer version of PHP I get the following, expected output:


Array
(
    [0] => HTTP/1.1 302 Found
    [Date] => Array
        (
            [0] => Tue, 29 Nov 2011 13:32:43 GMT
            [1] => Tue, 29 Nov 2011 13:32:43 GMT
        )

    [Server] => Array
        (
            [0] => Apache
            [1] => Apache
        )

    [X-Powered-By] => PHP/5.2.9
    [Set-Cookie] => Array
        (
            [0] => PHPSESSID=40ca678b4b35ce5370d0d3ae68739e9e; path=/
            [1] => aktiviert=1322573563; expires=Sat, 16-Jun-2012 13:32:43 GMT; 
path=/
        )

    [Expires] => Thu, 19 Nov 1981 08:52:00 GMT
    [Cache-Control] => no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
    [Pragma] => no-cache
    [location] => 
http://www.zebis.ch/Unterricht/schublade/ME4gDDrhrBwBKVWwrrubqqAFR9r4Hv/docs/sym
metrien.doc
    [Connection] => Array
        (
            [0] => close
            [1] => close
        )

    [Content-Type] => Array
        (
            [0] => text/html; charset=ISO-8859-1
            [1] => application/msword
        )

    [Content-Language] => Array
        (
            [0] => de
            [1] => de
        )

    [1] => HTTP/1.1 200 OK
    [Last-Modified] => Thu, 12 Nov 2009 09:48:20 GMT
    [ETag] => "6101f5-53600-47829717f4100"
    [Accept-Ranges] => bytes
    [Content-Length] => 341504
)


Previous Comments:
------------------------------------------------------------------------
[2011-10-13 15:18:35] greenrover33 at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=60054&edit=1

Reply via email to