php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42686 magic_quotes_gpc() does not respect data type
Submitted: 2007-09-17 11:00 UTC Modified: 2007-09-18 17:23 UTC
From: buganini at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2.4 OS: Windows 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: buganini at gmail dot com
New email:
PHP Version: OS:

 

 [2007-09-17 11:00 UTC] buganini at gmail dot com
Description:
------------
Under Windows 2003 IIS 6,
I had a list of
<input type="text" name="blah[]" />

and I had
var_dump($_POST['blah']);
in the action page

I got:
string(5) "Array"

!@#$%^&*
================

After I turned magic_quotes_gpc to off,
I got what I want:
array(2) {
  [0]=>
  string(4) "blah"
  [1]=>
  string(4) "bluh"
}


I thought it is because magic_quotes_gpc forget to consider data type while adding slashes.

//This problem dosen't exist under FreeBSD

Reproduce code:
---------------
<input type="text" name="blah[]" />
<input type="text" name="blah[]" />

var_dump($_POST['blah']);

Expected result:
----------------
array(2) {
  [0]=>
  string(4) "blah"
  [1]=>
  string(4) "bluh"
}

Actual result:
--------------
string(5) "Array"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-18 09:34 UTC] jani@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2007-09-18 17:23 UTC] buganini at gmail dot com
Sorry,
I made mistake....:(

I included some auto-stripslashes code,
but it is those code doesnt respect data type,
not php's fault.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 01:00:03 2025 UTC