php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55371 get_magic_quotes_gpc() throws deprecation warning
Submitted: 2011-08-05 15:06 UTC Modified: 2011-11-15 13:27 UTC
Votes:7
Avg. Score:3.6 ± 1.4
Reproduced:5 of 6 (83.3%)
Same Version:2 (40.0%)
Same OS:2 (40.0%)
From: thbley at gmail dot com Assigned: dsp (profile)
Status: Closed Package: Safe Mode/open_basedir
PHP Version: 5.4.0alpha3 OS: Win7 6.1.7600
Private report: No CVE-ID: None
 [2011-08-05 15:06 UTC] thbley at gmail dot com
Description:
------------
Calling get_magic_quotes_gpc() gives:
<b>Deprecated</b>:  Function get_magic_quotes_gpc() is deprecated in
<b>...</b> on line <b>...</b><br />

Please add a note to http://www.php.net/releases/NEWS_5_4_0_alpha1.txt

Test script:
---------------
get_magic_quotes_gpc();


Patches

bug55371.patch (last revision 2011-11-12 11:21 UTC by david dot zuelke at bitextender dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-11 22:04 UTC] kalle@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2011-08-11 22:04 UTC] kalle@php.net
Pierre, I don't remember what was decided on this, but could you clarify this report whether its intended to use PHP_DEP_FE or not on these
 [2011-08-11 22:06 UTC] pajoye@php.net
-Assigned To: pajoye +Assigned To:
 [2011-08-11 22:06 UTC] pajoye@php.net
The code is in place, better to have the usual doc people to work on that, I won't 
have the time to do it any time soon.
 [2011-08-11 23:29 UTC] salathe@php.net
Why don't the NEWS/UPGRADING files mention the deprecation of these 
get_magic_quotes_* functions?
 [2011-10-27 11:27 UTC] a at b dot c dot de
NEWS_5_4_0_beta1.txt mentions that get_magic_quotes_{gpc|runtime}() always return false, but not that they're deprecated.
 [2011-11-07 02:54 UTC] 44318209 at qq dot com
I have the same problem
 [2011-11-12 12:12 UTC] david dot zuelke at bitextender dot com
According to several mailing list threads I've searched, it should not give a 
deprecation warning. So it's not a documentation problem but a bug. The attached 
patch fixes the problem (uses PHP_FE instead of PHP_DEP_FE for 
get_magic_quotes_gpc() and get_magic_quotes_runtime()) and adds and updates tests 
accordingly.
 [2011-11-12 21:57 UTC] tyrael@php.net
Just my 2 cents: 
I think that raising an E_DEPRECATED now is better, if we want to remove the get 
methods with the major/minor version after 5.4.
 [2011-11-14 11:14 UTC] bjori@php.net
-Package: Documentation problem +Package: Safe Mode/open_basedir
 [2011-11-14 11:14 UTC] bjori@php.net
Throwing any kind of warnings for the getters is a cruel punishment targetting 
the people who were actually dealing with the problem we gave them in the first 
place.
 [2011-11-14 11:14 UTC] bjori@php.net
-Type: Documentation Problem +Type: Bug
 [2011-11-15 12:53 UTC] dsp@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2011-11-15 12:58 UTC] pajoye@php.net
-Assigned To: pajoye +Assigned To: dsp
 [2011-11-15 12:58 UTC] pajoye@php.net
Hi David,

please do it, I do not have the time to do it before RC2.

Cheers,
 [2011-11-15 13:01 UTC] david dot zuelke at bitextender dot com
A warning definitely is a bad idea, it makes it impossible to write portable code 
to detect magic quotes without version check stunts. It's fine if the two 
functions simply return false forever, there's not even a need to remove them as 
they don't do any harm whatsoever.
 [2011-11-15 13:09 UTC] pajoye@php.net
Let me clarify this pointer. Getter should not raise any warning. Setters do.
 [2011-11-15 13:16 UTC] dsp@php.net
-Summary: Function get_magic_quotes_gpc() is deprecated +Summary: get_magic_quotes_gpc() throws deprecation warning
 [2011-11-15 13:22 UTC] dsp@php.net
Automatic comment from SVN on behalf of dsp
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=319249
Log: Fixed bug #55371 (get_magic_quotes_gpc() throws deprecation warning.)

Patch by David Zuelke &lt;david dot zuelke at bitextender dot com&gt;
 [2011-11-15 13:27 UTC] dsp@php.net
-Status: Assigned +Status: Closed
 [2011-11-15 13:27 UTC] dsp@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Thanks david, patch applied.
 [2011-11-22 13:11 UTC] pierrick@php.net
Automatic comment from SVN on behalf of pierrick
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=319679
Log: Those functions are not deprecated (r319249 #55371)
 [2011-12-08 11:33 UTC] mah11ahm at hotmail dot com
My opinion that transcends that disable line 7 as follows, where I have is version 5.4  (put comment symble) and save then press (live view ) if using dreamwaver or run it on internet explorer
 /* if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }*/
 [2012-04-18 09:47 UTC] laruence@php.net
Automatic comment on behalf of dsp
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fd2e3d6d8e9390ce072f2967f877076ac97bda17
Log: Fixed bug #55371 (get_magic_quotes_gpc() throws deprecation warning.)
 [2012-07-24 23:38 UTC] rasmus@php.net
Automatic comment on behalf of dsp
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fd2e3d6d8e9390ce072f2967f877076ac97bda17
Log: Fixed bug #55371 (get_magic_quotes_gpc() throws deprecation warning.)
 [2013-11-17 09:35 UTC] laruence@php.net
Automatic comment on behalf of dsp
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fd2e3d6d8e9390ce072f2967f877076ac97bda17
Log: Fixed bug #55371 (get_magic_quotes_gpc() throws deprecation warning.)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 10:01:31 2024 UTC