php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43732 Implement dummy get / set_magic_quotes_runtime for compatibility
Submitted: 2008-01-02 22:55 UTC Modified: 2008-01-02 23:23 UTC
From: samuel at slbdata dot se Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 6CVS-2008-01-02 (snap) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: samuel at slbdata dot se
New email:
PHP Version: OS:

 

 [2008-01-02 22:55 UTC] samuel at slbdata dot se
Description:
------------
In PHP 6 magic_quotes has been removed completely, but many scripts use  get/set_magic_quotes_runtime to DISABLE it. These scripts break with PHP 6, even though they do not use magic_quotes.



Reproduce code:
---------------
<?php

$old = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
// Do something here
set_magic_quotes_runtime($old);


Expected result:
----------------
Because the script tried to disable magic_quotes, it should work. I suggest that the behavior in PHP 6 is changed to:

get_magic_quotes_runtime()   // always returns 0
set_magic_quotes_runtime(0)  // does nothing
set_magic_quotes_runtime(1)  // fatal error

(0 and 1 could of course be replaced with anything that is equal to FALSE or TRUE, respectively)

Actual result:
--------------
With php6.0-200801022130 I get:
PHP Fatal error:  Call to undefined function get_magic_quotes_runtime() in - on line 3


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-02 23:23 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

That's intentional that way, this way we can make sure people see this change and update their application. For compatibility you can use something like

if (!function_exists('get_magic_quotes')) {
    function get_magic_quotes() {
        return false;
    }
}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC