View of /mambo/branches/4.5.3h/globals.php
Parent Directory
|
Revision Log
Revision 1414 -
(download)
(annotate)
Thu Nov 22 21:20:48 2007 UTC (5 years, 6 months ago) by elpie
File size: 1817 byte(s)
Thu Nov 22 21:20:48 2007 UTC (5 years, 6 months ago) by elpie
File size: 1817 byte(s)
#fixing header blocks to remove old Miro copyright notices and replace with ours. Change README to README.php for security.
<?php
/**
* @package Mambo
* @author Mambo Foundation Inc see README.php
* @copyright Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license GNU/GPL Version 2, see LICENSE.php
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*/
/** Set flag that this is a parent file */
if (!defined('_VALID_MOS')) define( '_VALID_MOS', 1 );
// reads configuration.php for mosConfig_register_globals
function config_register_globals() {
static $register_globals;
if (is_null($register_globals)) {
$config = implode(",", file(dirname(__FILE__).DIRECTORY_SEPARATOR.'configuration.php'));
preg_match('/\$mosConfig_register_globals\s*=\s*\'([0-1]?)\'/', $config, $matches);
$register_globals = isset($matches[1]) ? (int) $matches[1] : 1;
}
return $register_globals;
}
// get mosConfig_register_globals
$config_register_globals = config_register_globals();
// superglobals array
$superglobals = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) array_unshift ($superglobals , $_SESSION);
// Emulate register_globals on
if (!ini_get('register_globals') && $config_register_globals) {
while(list($key,$value)=each($_GET)) {
if (!isset($GLOBALS[$key])) $GLOBALS[$key]=$value;
}
while(list($key,$value)=each($_POST)) {
if (!isset($GLOBALS[$key])) $GLOBALS[$key]=$value;
}
}
// Emulate register_globals off
elseif (ini_get('register_globals') && !$config_register_globals) {
foreach ($superglobals as $superglobal) {
foreach ($superglobal as $key => $value) {
unset($GLOBALS[$key]);
unset( $GLOBALS[$key]);
}
}
}
?>
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

