php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7128 Decoding of form variables
Submitted: 2000-10-11 01:50 UTC Modified: 2000-10-11 02:39 UTC
From: users at freesurf dot ch Assigned:
Status: Closed Package: PWS related
PHP Version: 4.0.2 OS: WIN98
Private report: No CVE-ID: None
 [2000-10-11 01:50 UTC] users at freesurf dot ch
When receving values from a form text field such as

 <INPUT name="hugo" type="text">

any entered ['] is preceedet with an [\] in the variable $hugo. Thus:

 [it's a shame] becomes "it\'s a shame".

1. I don't see any reason for it.

2. I tried to solve the problem using preg_replace:

 preg_replace('~\/\'~','\'',$hugo);

...without any effect.

 preg_replace('~\134\'~','/',$hugo);

indeed works fine! An error?!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-11 02:00 UTC] brad@php.net
This isn't a bug. Use stripslashes() to remove the slashes from the output
 [2000-10-11 02:39 UTC] rasmus@php.net
1. If you did any database work the reason should be obvious.

2. Either use stripslashes() or turn off gpc_magicquotes in your php.ini file.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu May 06 21:01:24 2021 UTC