Annotation of embedaddon/php/tests/basic/bug46313.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #46313 (Magic quotes broke $_FILES)
                      3: --SKIPIF--
                      4: <?php if(substr(PHP_OS, 0, 3) == "WIN") die("skip non-Windows test"); ?>
                      5: --INI--
                      6: magic_quotes_gpc=1
                      7: file_uploads=1
                      8: register_globals=1
                      9: display_errors=0
                     10: --POST_RAW--
                     11: Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
                     12: -----------------------------20896060251896012921717172737
                     13: Content-Disposition: form-data; name="o1'file"; filename="o1'file.png"
                     14: Content-Type: text/plain-file1
                     15: 
                     16: 1
                     17: -----------------------------20896060251896012921717172737
                     18: Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt"
                     19: Content-Type: text/plain-file2
                     20: 
                     21: 2
                     22: -----------------------------20896060251896012921717172737--
                     23: --FILE--
                     24: <?php
                     25: var_dump($_FILES);
                     26: var_dump($GLOBALS["o1\'file_name"]);
                     27: var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]);
                     28: var_dump($GLOBALS["o1\'file"]);
                     29: var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]);
                     30: ?>
                     31: --EXPECTF--
                     32: array(2) {
                     33:   ["o1\'file"]=>
                     34:   array(5) {
                     35:     ["name"]=>
                     36:     string(12) "o1\'file.png"
                     37:     ["type"]=>
                     38:     string(16) "text/plain-file1"
                     39:     ["tmp_name"]=>
                     40:     string(%d) "%s"
                     41:     ["error"]=>
                     42:     int(0)
                     43:     ["size"]=>
                     44:     int(1)
                     45:   }
                     46:   ["o2\'file"]=>
                     47:   array(5) {
                     48:     ["name"]=>
                     49:     string(13) "o2\'file2.txt"
                     50:     ["type"]=>
                     51:     string(16) "text/plain-file2"
                     52:     ["tmp_name"]=>
                     53:     string(%d) "%s"
                     54:     ["error"]=>
                     55:     int(0)
                     56:     ["size"]=>
                     57:     int(1)
                     58:   }
                     59: }
                     60: string(12) "o1\'file.png"
                     61: bool(true)
                     62: string(%d) "%s"
                     63: bool(true)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>