ID:               42962
 Updated by:       [EMAIL PROTECTED]
 Reported By:      efbiaiinzinz at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows + Linux
 PHP Version:      5.2.4
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2007-10-14 15:03:32] efbiaiinzinz at hotmail dot com

Description:
------------
reposting http://bugs.php.net/?id=42960 since it was marked falsely as
bogus and referring to another bug which is also marked as bogus, where
actually PHP form variable importing is incorrect and data gets
lost(more accurately, submitting image x coordinate gets lost)
it could be parsed by hand from HTTP_RAW_POST_DATA, bt it does not get
populated in case of file uploads, so not much help

quick fix for all those problems listed in previously mentioned
bugreport

image[field].x=1
image[field].y=2
insert into POST/GET array "image" => array() if not exists, insert
into it "field_x" => 1 and "field_y" => 2

image[field][].x=1
image[field][].y=2
image[field][].x=3
image[field][].y=4

find first input from raw post data
insert into POST/GET array "image" => array() if not exists, into it
insert "field" => array() if not exists
now the tricky part
find the [] part
see that it has .x
create new entry into "field" => array()
"0_x" => 1
find [] in next line, see that it's .y, use same index as before and
create "0_y" => 2
find [] in next line, see that it has .x, increment index and insert
"1_x" => 3
and after that with same index 1 "1_y" => 4

so in the end array would be
"image" => array(
  "field" => array(
    "0_x" => 1,
    "0_y" => 2,
    "1_x" => 3,
    "1_y" => 4
  )
)


It would help to actually think about the problem that seems to be
quite severe (variables get lost which could actually be retrieved quite
normally with some better logic) before setting status to bogus and
referring to manual and some other similar bug report which is resolved
with hack instead of actual fix

easist fix of all would be to make code accept
image[field].x=1
image[field].y=2
and convert to
"image" => array(
  "field_x" => 1,
  "field_y" => 2,
)

Quoting: 'PHP has no idea what to do with "image[key].x" so the ".x" is
stripped away and the "image" array created with the index "key".'

Are you or are you not the ones responsible for fixing bugs and odd
behavuiours in PHP instead of just saying that it currently acts buggy
and that you have no intention about fixing it ????

Sorry for the big comment, but when I tried shorter before, the bug got
reported as bogus without any further investigation.

Reproduce code:
---------------
same as in http://bugs.php.net/?id=42960

Expected result:
----------------
same as in http://bugs.php.net/?id=42960

Actual result:
--------------
same as in http://bugs.php.net/?id=42960


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42962&edit=1

Reply via email to