php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40713 set_magic_quotes_runtime(0) causes Fatal Error
Submitted: 2007-03-03 20:56 UTC Modified: 2007-10-15 18:35 UTC
From: spam02 at pornel dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 6CVS-2007-03-03 (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: spam02 at pornel dot net
New email:
PHP Version: OS:

 

 [2007-03-03 20:56 UTC] spam02 at pornel dot net
Description:
------------
It's great that PHP6 dropped support for magic_quotes, but I don't see a reason to trigger fatal error when set_magic_quotes_runtime(0) is executed (note the argument value).

I think it's completly harmless if application attempts to *disable* magic_quotes in PHP6 and error should be thrown only on attempts to enable magic_quotes.

In practicular this affects PHPBB, which won't run under PHP6 because of this.


Reproduce code:
---------------
<?php set_magic_quotes_runtime(0);

Expected result:
----------------
Notice or nothing.

Actual result:
--------------
Fatal error (not even Catchable Fatal).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-03 21:25 UTC] paul at phpbbservice dot nl
phpBB2 doesn't support php5 official, so php6 is a complete no ;)
phpBB3 support php6 perfect, there are special for php6 checks in common.php
 [2007-10-15 15:18 UTC] custume at custume dot no-ip dot org
i have the same problem but wit another portal 

i simply disable de code like this

 or remove <?php set_magic_quotes_runtime(0);

  or   disable just add // to the code like this 

//set_magic_quotes_runtime(0);

i use the PHP 6 at amost 1 year and is hard to config but is verry good

still have a lot of bugs but noting that cant be resolve

custume ( WebMaster )
 [2007-10-15 17:15 UTC] johannes@php.net
You can easily prevent the error:

<?php
if (!function_exists('set_magic_quotes_runtime')) {
    function set_magic_quotes_runtime($val) {
        if ($val) {
            // throw an error or do some work around 
        }
    }
}
?>

or by checking the PP version before calling the function. There's no real need to keep such a function inside PHP once the feature was removed.
 [2007-10-15 18:35 UTC] johannes@php.net
See previous comment.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 03:01:33 2024 UTC