summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-05-13 18:36:38 +0000
committerDries Buytaert <dries@buytaert.net>2003-05-13 18:36:38 +0000
commitc2d2fb73095a32394dd95e72421aec49fa2cd6f6 (patch)
tree5d2d92a31480405b8c10c3b85927049238528242 /includes
parent13ffd8956826fec3cd9978edf73ef67d9eb8d46e (diff)
downloadbrdo-c2d2fb73095a32394dd95e72421aec49fa2cd6f6.tar.gz
brdo-c2d2fb73095a32394dd95e72421aec49fa2cd6f6.tar.bz2
- Fixed a typo in the PostgreSQL database scheme. Patch by Michael Frankowski.
- Fixed a typo in the MSSQL database scheme. Patch by Michael Frankowski. - Removed dependency on "register_globals = on"! Patches by Michael Frankowski. Notes: + Updated the patches to use $foo["bar"] instead of $foo['bar']. + Updated the INSTALL and CHANGELOG files as well. - Tiny improvement to the "./scripts/code-clean.sh" script.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc37
-rw-r--r--includes/menu.inc8
-rw-r--r--includes/pager.inc2
-rw-r--r--includes/theme.inc2
-rw-r--r--includes/xmlrpcs.inc8
5 files changed, 27 insertions, 30 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 85ebb076b..611135f37 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -2,7 +2,6 @@
// $Id$
function conf_init() {
- global $HTTP_HOST, $PHP_SELF;
/*
** Try finding a matching configuration file by stripping the website's
@@ -10,9 +9,9 @@ function conf_init() {
** default value 'conf'.
*/
- $uri = $PHP_SELF;
+ $uri = $_SERVER["PHP_SELF"];
- $file = strtolower(strtr($HTTP_HOST . substr($uri, 0, strrpos($uri, "/")), "/:", ".."));
+ $file = strtolower(strtr($_SERVER["HTTP_HOST"] . substr($uri, 0, strrpos($uri, "/")), "/:", ".."));
while (strlen($file) > 4) {
if (file_exists("includes/$file.php")) {
@@ -61,11 +60,10 @@ function check_php_setting($name, $value) {
function arg($index) {
- global $q;
static $arguments;
if (empty($arguments)) {
- $arguments = explode("/", $q);
+ $arguments = explode("/", $_GET["q"]);
}
return $arguments[$index];
@@ -102,13 +100,11 @@ function object2array($node) {
function request_uri() {
// since request_uri() is only available on apache, we generate equivalent using other environment vars.
- global $REQUEST_URI, $PATH_INFO, $QUERY_STRING;
-
- if (isset($REQUEST_URI)) {
- return $REQUEST_URI;
+ if (isset($_SERVER["REQUEST_URI"])) {
+ return $_SERVER["REQUEST_URI"];
}
else {
- return $PATH_INFO ."?". $QUERY_STRING;
+ return $_SERVER["PATH_INFO"] ."?". $_SERVER["QUERY_STRING"];
}
}
@@ -351,7 +347,9 @@ function search_form($action = 0, $query = 0, $options = 0) {
* Collect the search results:
*/
function search_data() {
- global $keys, $edit;
+ global $keys;
+
+ $edit = $_POST["edit"];
if (isset($keys)) {
foreach (module_list() as $name) {
@@ -386,7 +384,8 @@ function search_data() {
* ("Restrict search to", help text, etc).
*/
function search_type($type = 0, $action = 0, $query = 0, $options = 0) {
- global $edit;
+
+ $edit = $_POST["edit"];
if (isset($type)) {
$edit["type"][$type] = "on";
@@ -437,10 +436,10 @@ function drupal_goto($url) {
*/
function referer_save() {
- global $referer, $HTTP_REFERER;
+ global $referer;
- if (!strstr($HTTP_REFERER, request_uri())) {
- $referer = $HTTP_REFERER;
+ if (!strstr($_SERVER["HTTP_REFERER"], request_uri())) {
+ $referer = $_SERVER["HTTP_REFERER"];
session_register("referer");
}
}
@@ -664,9 +663,9 @@ function cache_clear_all($cid = NULL) {
}
function page_set_cache() {
- global $user, $REQUEST_METHOD;
+ global $user;
- if (!$user->uid && $REQUEST_METHOD == "GET") {
+ if (!$user->uid && $_SERVER["REQUEST_METHOD"] == "GET") {
if ($data = ob_get_contents()) {
cache_set(request_uri(), $data, (time() + variable_get("cache_clear", 120)));
}
@@ -674,11 +673,11 @@ function page_set_cache() {
}
function page_get_cache() {
- global $user, $REQUEST_METHOD;
+ global $user;
$cache = NULL;
- if (!$user->uid && $REQUEST_METHOD == "GET") {
+ if (!$user->uid && $_SERVER["REQUEST_METHOD"] == "GET") {
$cache = cache_get(request_uri());
if (empty($cache)) {
diff --git a/includes/menu.inc b/includes/menu.inc
index 1793bfdc4..e4698ce3a 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -47,12 +47,12 @@ function menu_item($in_path) {
}
function menu_trail() {
- global $_gmenu, $q;
+ global $_gmenu;
static $trail; // cache
if (empty($trail)) {
$trail = array();
- $path = $q;
+ $path = $_GET["q"];
while ($path) {
if ($_gmenu[$path]) {
@@ -142,12 +142,12 @@ function menu_map($parent = "") {
}
function menu_execute_action() {
- global $_gmenu, $q;
+ global $_gmenu;
$trail = menu_trail();
$selected_menu = array_pop($trail);
if ($_gmenu[$selected_menu]["callback"]) {
- $arg = substr($q, strlen($selected_menu) + 1);
+ $arg = substr($_GET["q"], strlen($selected_menu) + 1);
if (empty($arg)) {
return call_user_func($_gmenu[$selected_menu]["callback"]);
}
diff --git a/includes/pager.inc b/includes/pager.inc
index c31693ec4..109ce61a7 100644
--- a/includes/pager.inc
+++ b/includes/pager.inc
@@ -301,7 +301,7 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = "") {
}
function pager_link($from_new, $attributes = array()) {
- global $q;
+ $q = $_GET["q"];
foreach($attributes as $key => $value) {
$query[] = "$key=$value";
diff --git a/includes/theme.inc b/includes/theme.inc
index 1822da23a..31f7aabbc 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -179,7 +179,7 @@ function theme_init() {
* @param string $region main|left|right
*/
function theme_blocks($region) {
- global $user, $REQUEST_URI;
+ global $user;
$result = db_query("SELECT * FROM blocks WHERE (status = '1' OR custom = '1') ". ($region != "all" ? "AND region = %d " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1);
diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc
index 61ce1913c..7e61d8771 100644
--- a/includes/xmlrpcs.inc
+++ b/includes/xmlrpcs.inc
@@ -148,7 +148,6 @@ class xmlrpc_server {
var $dmap=array();
function xmlrpc_server($dispMap, $serviceNow=1) {
- global $HTTP_RAW_POST_DATA;
// dispMap is a despatch array of methods
// mapped to function names and signatures
// if a method
@@ -208,14 +207,14 @@ class xmlrpc_server {
}
function parseRequest($data="") {
- global $_xh,$HTTP_RAW_POST_DATA;
+ global $_xh;
global $xmlrpcerr, $xmlrpcstr, $xmlrpcerrxml, $xmlrpc_defencoding,
$_xmlrpcs_dmap;
if ($data=="") {
- $data=$HTTP_RAW_POST_DATA;
+ $data=$_SERVER["HTTP_RAW_POST_DATA"];
}
$parser = xml_parser_create($xmlrpc_defencoding);
@@ -291,13 +290,12 @@ class xmlrpc_server {
}
function echoInput() {
- global $HTTP_RAW_POST_DATA;
// a debugging routine: just echos back the input
// packet as a string value
$r=new xmlrpcresp;
- $r->xv=new xmlrpcval( "'Aha said I: '" . $HTTP_RAW_POST_DATA, "string");
+ $r->xv=new xmlrpcval( "'Aha said I: '" . $_SERVER["HTTP_RAW_POST_DATA"], "string");
print $r->serialize();
}
}