php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10540 ini_set doesn't work
Submitted: 2001-04-28 16:43 UTC Modified: 2001-04-28 19:23 UTC
From: jonas at understroem dot dk Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 4.0 Latest CVS (28/04/2001) OS: SuSE Linux 7.1
Private report: No CVE-ID: None
 [2001-04-28 16:43 UTC] jonas at understroem dot dk
ini_set does not seem to work with register_globals and 
magic_quotes. Example: You call a file and include the 
query string "test=hmm". Here is the code for the file:

<?php
ini_set("register_globals", "0");
echo "register_globals setting: 
".ini_get("register_globals")."<br/>";

echo "\$test value: $test";
?>

This will generate the following output:

register_globals setting: 0
$test value: hmm

Notice that the value "hmm" is still there even though 
register_globals is off according to the ini_get line.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-28 19:23 UTC] zeev@php.net
ini_set() cannot affect the behavior of PHP that takes place before the script execution begins.
Variable registration occurs before the execution of the script begins (the variables are available and accessible right from the 1st line in the script).  So by the time you call ini_set(), variable registration is already done.  Affecting it in any way (global registration, automated quotes) is not possible.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Dec 03 23:01:24 2020 UTC