File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / basic / bug46313-win.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_3_10, HEAD
php

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

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