From:             efbiaiinzinz at hotmail dot com
Operating system: Windows XP/Linux
PHP version:      5.2.4
PHP Bug Type:     Scripting Engine problem
Bug description:  PHP messes up image submit button data

Description:
------------
PHP messes up coordinates for <input type="image" .. fields when fieldname
is not simple one level name but multilevel name.
For example name="smth[field]" is easy way to test it

Reproduce code:
---------------
<form action="" method="GET"><input type="image" name="smth[imgsubmit]"
src="t.jpg" width="200" height="200"></form>
<?php
print_r($_POST);
?>


Expected result:
----------------
Since single level image submits end up in post and get arrays as
fieldname_x and fieldname_y I would expect above code to produce GET array
as such:
Array ( [smth] => Array ( [imgsubmit_y] => 80, [imgsubmit_x] => 80 ) )

or even better would be actually
Array ( [smth] => Array ( [imgsubmit] => Array([x] => 80, [y] => 80) ) )

but it woul be a breaking change when changed to that and would be
inconsistent with single level fields, but also it would be much clearer
and would not prohibit me from having <input type="image" name="someimage"
src="..."> and <input type="hidden" name="someimage_x"
value="previousvalue"> fields on same form at the same time

Actual result:
--------------
Array ( [smth] => Array ( [imgsubmit] => 80 ) )

-- 
Edit bug report at http://bugs.php.net/?id=42960&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42960&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42960&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42960&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42960&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42960&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42960&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42960&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42960&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42960&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42960&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42960&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42960&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42960&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42960&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42960&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42960&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42960&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42960&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42960&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42960&r=mysqlcfg

Reply via email to