#23595 [NEW]: File upload problems with arrays in HTML INPUT tags and register variables

From: Date: Mon, 12 May 2003 17:38:30 +0000
Subject: #23595 [NEW]: File upload problems with arrays in HTML INPUT tags and register variables
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39495@lists.php.net to get a copy of this message
From:             shb at widearea dot co dot uk
Operating system: Linux and Solaris
PHP version:      4.3.1
PHP Bug Type:     Variables related
Bug description:  File upload problems with arrays in HTML INPUT tags and register variables

Assuming you have register variables enabled.

With 4.3.1, when you post from this HTML

<HTML>
<BODY><H1>filename and extra</H1>
<FORM METHOD="POST" ACTION="test.php"
ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="fields[filename]">
<INPUT TYPE="HIDDEN" NAME="fields[extra]" VALUE="fred">
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>

to this:

<?php
var_dump($fields) ;
?>

you get this:

array(1) { ["extra"]=>  string(4) "fred" }

If you use this HTML:

<HTML>
<BODY><H1>filename </H1>
<FORM METHOD="POST" ACTION="test.php"
ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="fields[filename]">
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>

you get this:

array(1) { ["filename"]=>  string(14) "/tmp/phpSsMqed" } 

If you use the first file on PHP 4.2.3 you get the response which we
believe is correct which is:

array(2) { ["filename"]=>  string(18) "/var/tmp/php7xaWYL"
["extra"]=> 
string(4) "fred" }

The bug occurs on both our Linux RH 8.0 and Solaris 7/8 systems.  We have
not tried 4.3.2 pre-releases -- it has taken us long enough to find the
problem!

There are similar bug reports on old versions but we think that the
transition from 4.2.3 to 4.3.1 has changed something.

Regards,
Simon.
-- 
Edit bug report at http://bugs.php.net/?id=23595&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23595&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23595&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23595&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23595&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23595&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23595&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23595&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23595&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23595&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23595&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23595&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23595&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23595&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23595&r=gnused



Thread (8 messages)

« previous php.bugs (#39495) next »