- 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.
4.2.x
Dries Buytaert 2003-05-13 18:36:38 +00:00
parent 13ffd89568
commit c2d2fb7309
53 changed files with 257 additions and 181 deletions

View File

@ -20,7 +20,6 @@ ErrorDocument 500 /error.php
# Overload PHP variables: # Overload PHP variables:
<IfModule mod_php4.c> <IfModule mod_php4.c>
php_value register_globals 1
php_value track_vars 1 php_value track_vars 1
php_value short_open_tag 1 php_value short_open_tag 1
php_value magic_quotes_gpc 0 php_value magic_quotes_gpc 0

View File

@ -1,4 +1,4 @@
Drupal x.x.x, xxxx-xx-xx (to be released) Drupal 4.2.0, xxxx-xx-xx (to be released)
------------------------ ------------------------
- added support for clean URLs. - added support for clean URLs.
@ -23,6 +23,8 @@ Drupal x.x.x, xxxx-xx-xx (to be released)
* added default node settings to control the behaviour for promotion, moderation and other options. * added default node settings to control the behaviour for promotion, moderation and other options.
- themes: - themes:
* replaced theme "Goofy" by "Xtemplate", a template driven theme. * replaced theme "Goofy" by "Xtemplate", a template driven theme.
- removed the 'register_globals = on' requirement.
- added better installation instructions.
Drupal 4.1.0, 2003-02-01 Drupal 4.1.0, 2003-02-01
------------------------ ------------------------

View File

@ -15,7 +15,6 @@ SERVER CONFIGURATION
Your PHP must have the following settings: Your PHP must have the following settings:
register_globals 1
magic_quotes_gpc 0 magic_quotes_gpc 0
session.save_handler user session.save_handler user

View File

@ -456,7 +456,7 @@ INSERT INTO system VALUES ('modules/story.module','story','module','',1);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1); INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1);
INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1); INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);
INSERT INTO variable(name,value) VALUES('update_start', '2002-05-15'); INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2002-05-15";');
INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";'); INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";');
INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1'); INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1');

View File

@ -563,7 +563,7 @@ INSERT INTO system VALUES ('modules/story.module','story','module','',1);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1); INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1);
INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1); INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);
INSERT INTO variable(name,value) VALUES('update_start', '2003-04-19'); INSERT INTO variable(name,value) VALUES('update_start', 'S:10:"2003-04-19";');
INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";'); INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";');
INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1'); INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1');

View File

@ -3,9 +3,9 @@
include_once "includes/common.inc"; include_once "includes/common.inc";
$errors = array(500 => "500 error: internal server error", 404 => "404 error: `$REDIRECT_URL' not found", 403 => "403 error: access denied - forbidden", 401 => "401 error: authorization required", 400 => "400 error: bad request"); $errors = array(500 => "500 error: internal server error", 404 => "404 error: '".`$_SERVER["REDIRECT_URL"] ."' not found", 403 => "403 error: access denied - forbidden", 401 => "401 error: authorization required", 400 => "400 error: bad request");
watchdog("httpd", $errors[$REDIRECT_STATUS]); watchdog("httpd", $errors[$_SERVER["REDIRECT_STATUS"]);
drupal_goto($base_url); drupal_goto($base_url);

View File

@ -2,7 +2,6 @@
// $Id$ // $Id$
function conf_init() { function conf_init() {
global $HTTP_HOST, $PHP_SELF;
/* /*
** Try finding a matching configuration file by stripping the website's ** Try finding a matching configuration file by stripping the website's
@ -10,9 +9,9 @@ function conf_init() {
** default value 'conf'. ** 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) { while (strlen($file) > 4) {
if (file_exists("includes/$file.php")) { if (file_exists("includes/$file.php")) {
@ -61,11 +60,10 @@ function check_php_setting($name, $value) {
function arg($index) { function arg($index) {
global $q;
static $arguments; static $arguments;
if (empty($arguments)) { if (empty($arguments)) {
$arguments = explode("/", $q); $arguments = explode("/", $_GET["q"]);
} }
return $arguments[$index]; return $arguments[$index];
@ -102,13 +100,11 @@ function object2array($node) {
function request_uri() { function request_uri() {
// since request_uri() is only available on apache, we generate equivalent using other environment vars. // since request_uri() is only available on apache, we generate equivalent using other environment vars.
global $REQUEST_URI, $PATH_INFO, $QUERY_STRING; if (isset($_SERVER["REQUEST_URI"])) {
return $_SERVER["REQUEST_URI"];
if (isset($REQUEST_URI)) {
return $REQUEST_URI;
} }
else { 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: * Collect the search results:
*/ */
function search_data() { function search_data() {
global $keys, $edit; global $keys;
$edit = $_POST["edit"];
if (isset($keys)) { if (isset($keys)) {
foreach (module_list() as $name) { foreach (module_list() as $name) {
@ -386,7 +384,8 @@ function search_data() {
* ("Restrict search to", help text, etc). * ("Restrict search to", help text, etc).
*/ */
function search_type($type = 0, $action = 0, $query = 0, $options = 0) { function search_type($type = 0, $action = 0, $query = 0, $options = 0) {
global $edit;
$edit = $_POST["edit"];
if (isset($type)) { if (isset($type)) {
$edit["type"][$type] = "on"; $edit["type"][$type] = "on";
@ -437,10 +436,10 @@ function drupal_goto($url) {
*/ */
function referer_save() { function referer_save() {
global $referer, $HTTP_REFERER; global $referer;
if (!strstr($HTTP_REFERER, request_uri())) { if (!strstr($_SERVER["HTTP_REFERER"], request_uri())) {
$referer = $HTTP_REFERER; $referer = $_SERVER["HTTP_REFERER"];
session_register("referer"); session_register("referer");
} }
} }
@ -664,9 +663,9 @@ function cache_clear_all($cid = NULL) {
} }
function page_set_cache() { 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()) { if ($data = ob_get_contents()) {
cache_set(request_uri(), $data, (time() + variable_get("cache_clear", 120))); cache_set(request_uri(), $data, (time() + variable_get("cache_clear", 120)));
} }
@ -674,11 +673,11 @@ function page_set_cache() {
} }
function page_get_cache() { function page_get_cache() {
global $user, $REQUEST_METHOD; global $user;
$cache = NULL; $cache = NULL;
if (!$user->uid && $REQUEST_METHOD == "GET") { if (!$user->uid && $_SERVER["REQUEST_METHOD"] == "GET") {
$cache = cache_get(request_uri()); $cache = cache_get(request_uri());
if (empty($cache)) { if (empty($cache)) {

View File

@ -47,12 +47,12 @@ function menu_item($in_path) {
} }
function menu_trail() { function menu_trail() {
global $_gmenu, $q; global $_gmenu;
static $trail; // cache static $trail; // cache
if (empty($trail)) { if (empty($trail)) {
$trail = array(); $trail = array();
$path = $q; $path = $_GET["q"];
while ($path) { while ($path) {
if ($_gmenu[$path]) { if ($_gmenu[$path]) {
@ -142,12 +142,12 @@ function menu_map($parent = "") {
} }
function menu_execute_action() { function menu_execute_action() {
global $_gmenu, $q; global $_gmenu;
$trail = menu_trail(); $trail = menu_trail();
$selected_menu = array_pop($trail); $selected_menu = array_pop($trail);
if ($_gmenu[$selected_menu]["callback"]) { if ($_gmenu[$selected_menu]["callback"]) {
$arg = substr($q, strlen($selected_menu) + 1); $arg = substr($_GET["q"], strlen($selected_menu) + 1);
if (empty($arg)) { if (empty($arg)) {
return call_user_func($_gmenu[$selected_menu]["callback"]); return call_user_func($_gmenu[$selected_menu]["callback"]);
} }

View File

@ -301,7 +301,7 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = "") {
} }
function pager_link($from_new, $attributes = array()) { function pager_link($from_new, $attributes = array()) {
global $q; $q = $_GET["q"];
foreach($attributes as $key => $value) { foreach($attributes as $key => $value) {
$query[] = "$key=$value"; $query[] = "$key=$value";

View File

@ -179,7 +179,7 @@ function theme_init() {
* @param string $region main|left|right * @param string $region main|left|right
*/ */
function theme_blocks($region) { 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); $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);

View File

@ -148,7 +148,6 @@ class xmlrpc_server {
var $dmap=array(); var $dmap=array();
function xmlrpc_server($dispMap, $serviceNow=1) { function xmlrpc_server($dispMap, $serviceNow=1) {
global $HTTP_RAW_POST_DATA;
// dispMap is a despatch array of methods // dispMap is a despatch array of methods
// mapped to function names and signatures // mapped to function names and signatures
// if a method // if a method
@ -208,14 +207,14 @@ class xmlrpc_server {
} }
function parseRequest($data="") { function parseRequest($data="") {
global $_xh,$HTTP_RAW_POST_DATA; global $_xh;
global $xmlrpcerr, $xmlrpcstr, $xmlrpcerrxml, $xmlrpc_defencoding, global $xmlrpcerr, $xmlrpcstr, $xmlrpcerrxml, $xmlrpc_defencoding,
$_xmlrpcs_dmap; $_xmlrpcs_dmap;
if ($data=="") { if ($data=="") {
$data=$HTTP_RAW_POST_DATA; $data=$_SERVER["HTTP_RAW_POST_DATA"];
} }
$parser = xml_parser_create($xmlrpc_defencoding); $parser = xml_parser_create($xmlrpc_defencoding);
@ -291,13 +290,12 @@ class xmlrpc_server {
} }
function echoInput() { function echoInput() {
global $HTTP_RAW_POST_DATA;
// a debugging routine: just echos back the input // a debugging routine: just echos back the input
// packet as a string value // packet as a string value
$r=new xmlrpcresp; $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(); print $r->serialize();
} }
} }

View File

@ -3,7 +3,7 @@
include_once "includes/common.inc"; include_once "includes/common.inc";
if (isset($q)) { if (isset($_GET["q"])) {
$mod = arg(0); $mod = arg(0);
} }
@ -20,7 +20,6 @@ else {
page_header(); page_header();
check_php_setting("magic_quotes_gpc", 0); check_php_setting("magic_quotes_gpc", 0);
check_php_setting("register_globals", 1);
if (module_hook(variable_get("site_frontpage", "node"), "page")) { if (module_hook(variable_get("site_frontpage", "node"), "page")) {
module_invoke(variable_get("site_frontpage", "node"), "page"); module_invoke(variable_get("site_frontpage", "node"), "page");

View File

@ -25,7 +25,7 @@ function admin_admin() {
} }
function admin_page() { function admin_page() {
global $user, $base_url; global $base_url;
if (user_access("access administration pages")) { if (user_access("access administration pages")) {
page_header(); page_header();

View File

@ -488,7 +488,8 @@ function import_tag() {
} }
function import_admin() { function import_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer news feeds")) { if (user_access("administer news feeds")) {

View File

@ -488,7 +488,8 @@ function import_tag() {
} }
function import_admin() { function import_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer news feeds")) { if (user_access("administer news feeds")) {

View File

@ -140,7 +140,10 @@ function archive_link($type) {
} }
function archive_page() { function archive_page() {
global $date, $edit, $op, $month, $year, $meta; global $date, $month, $year, $meta;
$op = $_POST["op"];
$edit = $_POST["edit"];
theme("header"); theme("header");

View File

@ -140,7 +140,10 @@ function archive_link($type) {
} }
function archive_page() { function archive_page() {
global $date, $edit, $op, $month, $year, $meta; global $date, $month, $year, $meta;
$op = $_POST["op"];
$edit = $_POST["edit"];
theme("header"); theme("header");

View File

@ -260,7 +260,8 @@ function block_box_delete($bid) {
} }
function block_admin() { function block_admin() {
global $edit, $op; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer blocks")) { if (user_access("administer blocks")) {

View File

@ -260,7 +260,8 @@ function block_box_delete($bid) {
} }
function block_admin() { function block_admin() {
global $edit, $op; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer blocks")) { if (user_access("administer blocks")) {

View File

@ -160,8 +160,9 @@ function book_validate(&$node) {
} }
function book_form(&$node, &$help, &$error) { function book_form(&$node, &$help, &$error) {
global $user, $op; global $user;
$op = $_POST["op"];
$output = form_select(t("Parent"), "parent", $node->parent, book_toc(), t("The parent subject or category the page belongs in.")); $output = form_select(t("Parent"), "parent", $node->parent, book_toc(), t("The parent subject or category the page belongs in."));
if (function_exists("taxonomy_node_form")) { if (function_exists("taxonomy_node_form")) {
@ -197,7 +198,10 @@ function book_form(&$node, &$help, &$error) {
} }
function book_node_link($node = 0) { function book_node_link($node = 0) {
global $user, $op, $edit; global $user;
$op = $_POST["op"];
$edit = $_POST["edit"];
if ($node->type != "book") { if ($node->type != "book") {
@ -337,7 +341,7 @@ function book_next($node) {
} }
function book_body($node) { function book_body($node) {
global $op; $op = $_POST["op"];
if ($node->format == 1) { if ($node->format == 1) {
// Make sure only authorized users can preview PHP pages. // Make sure only authorized users can preview PHP pages.
@ -705,7 +709,8 @@ function book_admin_links() {
} }
function book_admin() { function book_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer nodes")) { if (user_access("administer nodes")) {
if (empty($op)) { if (empty($op)) {

View File

@ -160,8 +160,9 @@ function book_validate(&$node) {
} }
function book_form(&$node, &$help, &$error) { function book_form(&$node, &$help, &$error) {
global $user, $op; global $user;
$op = $_POST["op"];
$output = form_select(t("Parent"), "parent", $node->parent, book_toc(), t("The parent subject or category the page belongs in.")); $output = form_select(t("Parent"), "parent", $node->parent, book_toc(), t("The parent subject or category the page belongs in."));
if (function_exists("taxonomy_node_form")) { if (function_exists("taxonomy_node_form")) {
@ -197,7 +198,10 @@ function book_form(&$node, &$help, &$error) {
} }
function book_node_link($node = 0) { function book_node_link($node = 0) {
global $user, $op, $edit; global $user;
$op = $_POST["op"];
$edit = $_POST["edit"];
if ($node->type != "book") { if ($node->type != "book") {
@ -337,7 +341,7 @@ function book_next($node) {
} }
function book_body($node) { function book_body($node) {
global $op; $op = $_POST["op"];
if ($node->format == 1) { if ($node->format == 1) {
// Make sure only authorized users can preview PHP pages. // Make sure only authorized users can preview PHP pages.
@ -705,7 +709,8 @@ function book_admin_links() {
} }
function book_admin() { function book_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer nodes")) { if (user_access("administer nodes")) {
if (empty($op)) { if (empty($op)) {

View File

@ -185,7 +185,8 @@ function cloud_block($op = "list", $delta = 0) {
} }
function cloud_admin() { function cloud_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (empty($op)) { if (empty($op)) {
$op = arg(3); $op = arg(3);

View File

@ -676,7 +676,8 @@ function comment_link($type, $node = 0, $main = 0) {
} }
function comment_page() { function comment_page() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (empty($op)) { if (empty($op)) {
$op = arg(1); $op = arg(1);
@ -880,7 +881,7 @@ function comment_mod_roles($edit) {
} }
function comment_mod_votes($edit) { function comment_mod_votes($edit) {
global $op; $op = $_POST["op"];
$mid = arg(3); $mid = arg(3);
@ -928,7 +929,7 @@ function comment_mod_votes($edit) {
} }
function comment_mod_filters($edit) { function comment_mod_filters($edit) {
global $op; $op = $_POST["op"];
$fid = arg(3); $fid = arg(3);
@ -978,7 +979,10 @@ function comment_mod_filters($edit) {
function comment_admin() { function comment_admin() {
global $op, $id, $edit, $mod, $keys, $order, $status, $comment_page, $comment_settings; global $id, $mod, $keys, $order, $status, $comment_page, $comment_settings;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (empty($op)) { if (empty($op)) {
$op = arg(2); $op = arg(2);
@ -1122,9 +1126,11 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $nid, $page = 0
} }
function comment_moderation_form($comment) { function comment_moderation_form($comment) {
global $comment_votes, $op, $user, $node; global $comment_votes, $user, $node;
static $votes; static $votes;
$op = $_POST["op"];
if ($op == "reply") { if ($op == "reply") {
// preview comment: // preview comment:
$output .= "&nbsp;"; $output .= "&nbsp;";
@ -1393,7 +1399,6 @@ function comment_already_moderated($uid, $users) {
} }
function comment_search($keys) { function comment_search($keys) {
global $PHP_SELF;
/* /*
** Return the results of performing a search using the indexed search ** Return the results of performing a search using the indexed search

View File

@ -676,7 +676,8 @@ function comment_link($type, $node = 0, $main = 0) {
} }
function comment_page() { function comment_page() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (empty($op)) { if (empty($op)) {
$op = arg(1); $op = arg(1);
@ -880,7 +881,7 @@ function comment_mod_roles($edit) {
} }
function comment_mod_votes($edit) { function comment_mod_votes($edit) {
global $op; $op = $_POST["op"];
$mid = arg(3); $mid = arg(3);
@ -928,7 +929,7 @@ function comment_mod_votes($edit) {
} }
function comment_mod_filters($edit) { function comment_mod_filters($edit) {
global $op; $op = $_POST["op"];
$fid = arg(3); $fid = arg(3);
@ -978,7 +979,10 @@ function comment_mod_filters($edit) {
function comment_admin() { function comment_admin() {
global $op, $id, $edit, $mod, $keys, $order, $status, $comment_page, $comment_settings; global $id, $mod, $keys, $order, $status, $comment_page, $comment_settings;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (empty($op)) { if (empty($op)) {
$op = arg(2); $op = arg(2);
@ -1122,9 +1126,11 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $nid, $page = 0
} }
function comment_moderation_form($comment) { function comment_moderation_form($comment) {
global $comment_votes, $op, $user, $node; global $comment_votes, $user, $node;
static $votes; static $votes;
$op = $_POST["op"];
if ($op == "reply") { if ($op == "reply") {
// preview comment: // preview comment:
$output .= "&nbsp;"; $output .= "&nbsp;";
@ -1393,7 +1399,6 @@ function comment_already_moderated($uid, $users) {
} }
function comment_search($keys) { function comment_search($keys) {
global $PHP_SELF;
/* /*
** Return the results of performing a search using the indexed search ** Return the results of performing a search using the indexed search

View File

@ -175,7 +175,6 @@ function drupal_auth_help() {
} }
function drupal_user($type, $edit, $user) { function drupal_user($type, $edit, $user) {
global $HTTP_HOST;
$module = "drupal"; $module = "drupal";
$name = module_invoke($module, "info", "name"); $name = module_invoke($module, "info", "name");
@ -187,7 +186,7 @@ function drupal_user($type, $edit, $user) {
} }
else { else {
// TODO: use a variation of $base_url instead of $HTTP_HOST below // TODO: use a variation of $base_url instead of $HTTP_HOST below
$output .= form_item(t("$name ID"), "$user->name@$HTTP_HOST"); $output .= form_item(t("$name ID"), "$user->name@". $_SERVER["HTTP_HOST"]);
} }
return $output; return $output;
} }

View File

@ -175,7 +175,6 @@ function drupal_auth_help() {
} }
function drupal_user($type, $edit, $user) { function drupal_user($type, $edit, $user) {
global $HTTP_HOST;
$module = "drupal"; $module = "drupal";
$name = module_invoke($module, "info", "name"); $name = module_invoke($module, "info", "name");
@ -187,7 +186,7 @@ function drupal_user($type, $edit, $user) {
} }
else { else {
// TODO: use a variation of $base_url instead of $HTTP_HOST below // TODO: use a variation of $base_url instead of $HTTP_HOST below
$output .= form_item(t("$name ID"), "$user->name@$HTTP_HOST"); $output .= form_item(t("$name ID"), "$user->name@". $_SERVER["HTTP_HOST"]);
} }
return $output; return $output;
} }

View File

@ -449,7 +449,8 @@ function _forum_message_taxonomy() {
} }
function forum_page() { function forum_page() {
global $sortby, $forum_per_page, $from, $op, $user; global $sortby, $forum_per_page, $from, $user;
$op = $_POST["op"];
if (user_access("access content")) { if (user_access("access content")) {
if (module_exist("taxonomy")) { if (module_exist("taxonomy")) {

View File

@ -449,7 +449,8 @@ function _forum_message_taxonomy() {
} }
function forum_page() { function forum_page() {
global $sortby, $forum_per_page, $from, $op, $user; global $sortby, $forum_per_page, $from, $user;
$op = $_POST["op"];
if (user_access("access content")) { if (user_access("access content")) {
if (module_exist("taxonomy")) { if (module_exist("taxonomy")) {

View File

@ -488,7 +488,8 @@ function import_tag() {
} }
function import_admin() { function import_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer news feeds")) { if (user_access("administer news feeds")) {

View File

@ -72,7 +72,7 @@ function locale_delete($lid) {
} }
function locale_save($lid) { function locale_save($lid) {
global $edit; $edit = $_POST["edit"];
foreach ($edit as $key=>$value) { foreach ($edit as $key=>$value) {
db_query("UPDATE locales SET $key = '%s' WHERE lid = %d", $value, $lid); db_query("UPDATE locales SET $key = '%s' WHERE lid = %d", $value, $lid);
} }
@ -124,7 +124,9 @@ function locale_languages($translation) {
} }
function locale_seek() { function locale_seek() {
global $id, $edit, $languages, $op, $locale_settings; global $id, $languages, $locale_settings;
$op = $_POST["op"];
$edit = $_POST["edit"];
if ($op != 'overview' && !$edit && session_is_registered("locale_settings")) { if ($op != 'overview' && !$edit && session_is_registered("locale_settings")) {
$edit = $locale_settings; $edit = $locale_settings;
@ -197,7 +199,8 @@ function locale_seek() {
} }
function locale_admin() { function locale_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer locales")) { if (user_access("administer locales")) {
locale_admin_initialize(); locale_admin_initialize();

View File

@ -72,7 +72,7 @@ function locale_delete($lid) {
} }
function locale_save($lid) { function locale_save($lid) {
global $edit; $edit = $_POST["edit"];
foreach ($edit as $key=>$value) { foreach ($edit as $key=>$value) {
db_query("UPDATE locales SET $key = '%s' WHERE lid = %d", $value, $lid); db_query("UPDATE locales SET $key = '%s' WHERE lid = %d", $value, $lid);
} }
@ -124,7 +124,9 @@ function locale_languages($translation) {
} }
function locale_seek() { function locale_seek() {
global $id, $edit, $languages, $op, $locale_settings; global $id, $languages, $locale_settings;
$op = $_POST["op"];
$edit = $_POST["edit"];
if ($op != 'overview' && !$edit && session_is_registered("locale_settings")) { if ($op != 'overview' && !$edit && session_is_registered("locale_settings")) {
$edit = $locale_settings; $edit = $locale_settings;
@ -197,7 +199,8 @@ function locale_seek() {
} }
function locale_admin() { function locale_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer locales")) { if (user_access("administer locales")) {
locale_admin_initialize(); locale_admin_initialize();

View File

@ -422,7 +422,6 @@ function node_perm() {
} }
function node_search($keys) { function node_search($keys) {
global $PHP_SELF;
// Return the results of performing a search using the indexed search // Return the results of performing a search using the indexed search
// for this particular type of node. // for this particular type of node.
@ -597,7 +596,7 @@ function node_admin_nodes() {
*/ */
function node_admin_settings($edit) { function node_admin_settings($edit) {
global $op; $op = $_POST["op"];
if ($op == t("Save configuration")) { if ($op == t("Save configuration")) {
/* /*
@ -762,7 +761,8 @@ function node_revision_list($node) {
} }
function node_admin() { function node_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer nodes")) { if (user_access("administer nodes")) {
@ -1094,7 +1094,9 @@ function node_form($edit, $error = NULL) {
} }
function node_add($type) { function node_add($type) {
global $user, $edit; global $user;
$edit = $_POST["edit"];
/* /*
** If a node type has been specified, validate it existence. If no ** If a node type has been specified, validate it existence. If no
@ -1353,7 +1355,10 @@ function node_delete($edit) {
} }
function node_page() { function node_page() {
global $op, $id, $user, $edit, $or, $and; global $id, $user, $or, $and;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("access content")) { if (user_access("access content")) {
if (empty($op)) { if (empty($op)) {

View File

@ -422,7 +422,6 @@ function node_perm() {
} }
function node_search($keys) { function node_search($keys) {
global $PHP_SELF;
// Return the results of performing a search using the indexed search // Return the results of performing a search using the indexed search
// for this particular type of node. // for this particular type of node.
@ -597,7 +596,7 @@ function node_admin_nodes() {
*/ */
function node_admin_settings($edit) { function node_admin_settings($edit) {
global $op; $op = $_POST["op"];
if ($op == t("Save configuration")) { if ($op == t("Save configuration")) {
/* /*
@ -762,7 +761,8 @@ function node_revision_list($node) {
} }
function node_admin() { function node_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer nodes")) { if (user_access("administer nodes")) {
@ -1094,7 +1094,9 @@ function node_form($edit, $error = NULL) {
} }
function node_add($type) { function node_add($type) {
global $user, $edit; global $user;
$edit = $_POST["edit"];
/* /*
** If a node type has been specified, validate it existence. If no ** If a node type has been specified, validate it existence. If no
@ -1353,7 +1355,10 @@ function node_delete($edit) {
} }
function node_page() { function node_page() {
global $op, $id, $user, $edit, $or, $and; global $id, $user, $or, $and;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("access content")) { if (user_access("access content")) {
if (empty($op)) { if (empty($op)) {

View File

@ -89,7 +89,8 @@ function page_link($type) {
} }
function page_body($node) { function page_body($node) {
global $op; $op = $_POST["op"];
if ($node->format == 0) { if ($node->format == 0) {
// HTML type // HTML type
$output = check_output($node->body); $output = check_output($node->body);

View File

@ -89,7 +89,8 @@ function page_link($type) {
} }
function page_body($node) { function page_body($node) {
global $op; $op = $_POST["op"];
if ($node->format == 0) { if ($node->format == 0) {
// HTML type // HTML type
$output = check_output($node->body); $output = check_output($node->body);

View File

@ -7,7 +7,7 @@ function poll_allowvotes(&$node) {
** We only need to determine this once for a poll, but we don't do this in ** We only need to determine this once for a poll, but we don't do this in
** poll_load() (i.e. for every poll that is loaded) for speed reasons. ** poll_load() (i.e. for every poll that is loaded) for speed reasons.
*/ */
global $REMOTE_ADDR, $user; global $user;
if ($node->allowvotes != -1) { if ($node->allowvotes != -1) {
return $node; return $node;
@ -20,7 +20,7 @@ function poll_allowvotes(&$node) {
$id = "_". $user->uid ."_"; $id = "_". $user->uid ."_";
} }
else { else {
$id = $REMOTE_ADDR; $id = $_SERVER["REMOTE_ADDR"];
} }
if (!strstr($node->voters, $id)) { if (!strstr($node->voters, $id)) {
$node->allowvotes = $node->active; $node->allowvotes = $node->active;

View File

@ -7,7 +7,7 @@ function poll_allowvotes(&$node) {
** We only need to determine this once for a poll, but we don't do this in ** We only need to determine this once for a poll, but we don't do this in
** poll_load() (i.e. for every poll that is loaded) for speed reasons. ** poll_load() (i.e. for every poll that is loaded) for speed reasons.
*/ */
global $REMOTE_ADDR, $user; global $user;
if ($node->allowvotes != -1) { if ($node->allowvotes != -1) {
return $node; return $node;
@ -20,7 +20,7 @@ function poll_allowvotes(&$node) {
$id = "_". $user->uid ."_"; $id = "_". $user->uid ."_";
} }
else { else {
$id = $REMOTE_ADDR; $id = $_SERVER["REMOTE_ADDR"];
} }
if (!strstr($node->voters, $id)) { if (!strstr($node->voters, $id)) {
$node->allowvotes = $node->active; $node->allowvotes = $node->active;

View File

@ -136,7 +136,7 @@ function _profile_form($edit, $mode) {
function _profile_validate($edit, $mode) { function _profile_validate($edit, $mode) {
global $profile_fields, $user, $HTTP_POST_VARS; global $profile_fields, $user;
$enabled_fields = _profile_active_fields($mode); $enabled_fields = _profile_active_fields($mode);
@ -206,19 +206,19 @@ function _profile_user_view(&$user, $mode) {
} }
function _profile_validate_avatar(&$edit) { function _profile_validate_avatar(&$edit) {
global $HTTP_POST_FILES, $user; global $user;
// check that uploaded file is an image, with a max file size and max height/width // check that uploaded file is an image, with a max file size and max height/width
unset($edit["profile_avatar"]); unset($edit["profile_avatar"]);
if ($HTTP_POST_FILES["edit"]["name"]["profile_avatar"] == "") { if ($_FILES["edit"]["name"]["profile_avatar"] == "") {
$edit["profile_avatar"] = $user->profile_avatar; $edit["profile_avatar"] = $user->profile_avatar;
return ""; return "";
} }
$image_file = $HTTP_POST_FILES["edit"]["tmp_name"]["profile_avatar"]; $image_file = $_FILES["edit"]["tmp_name"]["profile_avatar"];
if (is_uploaded_file($image_file)) { if (is_uploaded_file($image_file)) {
$extension = strtolower(strrchr($HTTP_POST_FILES["edit"]["name"]["profile_avatar"], ".")); $extension = strtolower(strrchr($_FILES["edit"]["name"]["profile_avatar"], "."));
$size = getimagesize($image_file); $size = getimagesize($image_file);
list($maxwidth, $maxheight) = explode("x", variable_get("profile_avatar_dimensions", "85x85")); list($maxwidth, $maxheight) = explode("x", variable_get("profile_avatar_dimensions", "85x85"));
if ((!in_array($size[2], array(1,2,3))) || (!in_array($extension, array(".gif", ".jpg", ".png", ".jpeg")))) { if ((!in_array($size[2], array(1,2,3))) || (!in_array($extension, array(".gif", ".jpg", ".png", ".jpeg")))) {

View File

@ -136,7 +136,7 @@ function _profile_form($edit, $mode) {
function _profile_validate($edit, $mode) { function _profile_validate($edit, $mode) {
global $profile_fields, $user, $HTTP_POST_VARS; global $profile_fields, $user;
$enabled_fields = _profile_active_fields($mode); $enabled_fields = _profile_active_fields($mode);
@ -206,19 +206,19 @@ function _profile_user_view(&$user, $mode) {
} }
function _profile_validate_avatar(&$edit) { function _profile_validate_avatar(&$edit) {
global $HTTP_POST_FILES, $user; global $user;
// check that uploaded file is an image, with a max file size and max height/width // check that uploaded file is an image, with a max file size and max height/width
unset($edit["profile_avatar"]); unset($edit["profile_avatar"]);
if ($HTTP_POST_FILES["edit"]["name"]["profile_avatar"] == "") { if ($_FILES["edit"]["name"]["profile_avatar"] == "") {
$edit["profile_avatar"] = $user->profile_avatar; $edit["profile_avatar"] = $user->profile_avatar;
return ""; return "";
} }
$image_file = $HTTP_POST_FILES["edit"]["tmp_name"]["profile_avatar"]; $image_file = $_FILES["edit"]["tmp_name"]["profile_avatar"];
if (is_uploaded_file($image_file)) { if (is_uploaded_file($image_file)) {
$extension = strtolower(strrchr($HTTP_POST_FILES["edit"]["name"]["profile_avatar"], ".")); $extension = strtolower(strrchr($_FILES["edit"]["name"]["profile_avatar"], "."));
$size = getimagesize($image_file); $size = getimagesize($image_file);
list($maxwidth, $maxheight) = explode("x", variable_get("profile_avatar_dimensions", "85x85")); list($maxwidth, $maxheight) = explode("x", variable_get("profile_avatar_dimensions", "85x85"));
if ((!in_array($size[2], array(1,2,3))) || (!in_array($extension, array(".gif", ".jpg", ".png", ".jpeg")))) { if ((!in_array($size[2], array(1,2,3))) || (!in_array($extension, array(".gif", ".jpg", ".png", ".jpeg")))) {

View File

@ -111,7 +111,10 @@ function queue_overview() {
} }
function queue_view($nid) { function queue_view($nid) {
global $op, $edit, $user; global $user;
$op = $_POST["op"];
$edit = $_POST["edit"];
/* /*
** An associative array with the possible voting options: ** An associative array with the possible voting options:

View File

@ -51,7 +51,7 @@ function search_settings() {
* *
*/ */
function search_admin() { function search_admin() {
global $op; $op = $_POST["op"];
// Only allow people with sufficient access. // Only allow people with sufficient access.
if (user_access("administer search")) { if (user_access("administer search")) {
@ -92,7 +92,6 @@ function search_cron() {
* explanation of array items * explanation of array items
*/ */
function do_search($search_array) { function do_search($search_array) {
global $PHP_SELF;
$keys = strtolower($search_array["keys"]); $keys = strtolower($search_array["keys"]);
$type = $search_array["type"]; $type = $search_array["type"];
@ -167,10 +166,10 @@ function do_search($search_array) {
$count = $value["count"]; $count = $value["count"];
switch ($type) { switch ($type) {
case "node": case "node":
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($PHP_SELF, "admin") ? url("admin/node/edit/$lno") : url("node/view/$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words)); $find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($_SERVER["PHP_SELF"], "admin") ? url("admin/node/edit/$lno") : url("node/view/$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break; break;
case "comment": case "comment":
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($PHP_SELF, "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid#$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words)); $find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($_SERVER["PHP_SELF"], "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid#$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break; break;
} }
} }
@ -306,7 +305,9 @@ function search_save($edit) {
} }
function search_view($keys = NULL) { function search_view($keys = NULL) {
global $edit, $type; global $type;
$edit = $_POST["edit"];
if (user_access("search content")) { if (user_access("search content")) {
// Construct the search form: // Construct the search form:

View File

@ -51,7 +51,7 @@ function search_settings() {
* *
*/ */
function search_admin() { function search_admin() {
global $op; $op = $_POST["op"];
// Only allow people with sufficient access. // Only allow people with sufficient access.
if (user_access("administer search")) { if (user_access("administer search")) {
@ -92,7 +92,6 @@ function search_cron() {
* explanation of array items * explanation of array items
*/ */
function do_search($search_array) { function do_search($search_array) {
global $PHP_SELF;
$keys = strtolower($search_array["keys"]); $keys = strtolower($search_array["keys"]);
$type = $search_array["type"]; $type = $search_array["type"];
@ -167,10 +166,10 @@ function do_search($search_array) {
$count = $value["count"]; $count = $value["count"];
switch ($type) { switch ($type) {
case "node": case "node":
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($PHP_SELF, "admin") ? url("admin/node/edit/$lno") : url("node/view/$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words)); $find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($_SERVER["PHP_SELF"], "admin") ? url("admin/node/edit/$lno") : url("node/view/$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break; break;
case "comment": case "comment":
$find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($PHP_SELF, "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid#$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words)); $find[$i++] = array("count" => $count, "title" => $title, "link" => (strstr($_SERVER["PHP_SELF"], "admin") ? url("admin/comment/edit/$lno") : url("node/view/$nid#$lno")), "user" => $name, "date" => $created, "keywords" => implode("|", $words));
break; break;
} }
} }
@ -306,7 +305,9 @@ function search_save($edit) {
} }
function search_view($keys = NULL) { function search_view($keys = NULL) {
global $edit, $type; global $type;
$edit = $_POST["edit"];
if (user_access("search content")) { if (user_access("search content")) {
// Construct the search form: // Construct the search form:

View File

@ -259,7 +259,8 @@ function statistics_help() {
/* Administration hook, defines module's administrative page */ /* Administration hook, defines module's administrative page */
function statistics_admin() { function statistics_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
/* Only allow people with sufficient access. */ /* Only allow people with sufficient access. */
if ((user_access("administer statistics module")) || (user_access("administer statistics"))) { if ((user_access("administer statistics module")) || (user_access("administer statistics"))) {
@ -393,7 +394,7 @@ function statistics_admin_accesslog_table($type, $id) {
function statistics_recent_refer($nid = 0) { function statistics_recent_refer($nid = 0) {
global $HTTP_HOST, $view; global $view;
if (empty($view)) { if (empty($view)) {
$view = arg(3); $view = arg(3);
@ -406,12 +407,12 @@ function statistics_recent_refer($nid = 0) {
$query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url <> '' ORDER BY timestamp DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url LIKE '%". check_input($HTTP_HOST) ."%' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' ORDER BY timestamp DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
/* default to external referrers */ /* default to external referrers */
$query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' ORDER BY timestamp DESC";
$describe = "external "; $describe = "external ";
} }
@ -423,11 +424,11 @@ function statistics_recent_refer($nid = 0) {
$query = "SELECT url,timestamp FROM accesslog WHERE url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE url <> '' ORDER BY timestamp DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url,timestamp FROM accesslog WHERE url LIKE '%". check_input($HTTP_HOST) ."%' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' ORDER BY timestamp DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
$query = "SELECT url,timestamp FROM accesslog WHERE url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' ORDER BY timestamp DESC";
$describe = "external "; $describe = "external ";
} }
@ -447,7 +448,7 @@ function statistics_recent_refer($nid = 0) {
function statistics_top_refer($nid = 0) { function statistics_top_refer($nid = 0) {
global $HTTP_HOST, $view; global $view;
$node = node_load(array("nid" => $nid)); $node = node_load(array("nid" => $nid));
@ -456,12 +457,12 @@ function statistics_top_refer($nid = 0) {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url <> '' GROUP BY url ORDER BY count DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url LIKE '%". check_input($HTTP_HOST) ."%' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' GROUP BY url ORDER BY count DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
/* default to external */ /* default to external */
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' GROUP BY url ORDER BY count DESC";
$describe = "external "; $describe = "external ";
} }
@ -472,12 +473,12 @@ function statistics_top_refer($nid = 0) {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url <> '' GROUP BY url ORDER BY count DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url LIKE '%". check_input($HTTP_HOST) ."%' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' GROUP BY url ORDER BY count DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
/* default to external */ /* default to external */
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' GROUP BY url ORDER BY count DESC";
$describe = "external "; $describe = "external ";
} }

View File

@ -259,7 +259,8 @@ function statistics_help() {
/* Administration hook, defines module's administrative page */ /* Administration hook, defines module's administrative page */
function statistics_admin() { function statistics_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
/* Only allow people with sufficient access. */ /* Only allow people with sufficient access. */
if ((user_access("administer statistics module")) || (user_access("administer statistics"))) { if ((user_access("administer statistics module")) || (user_access("administer statistics"))) {
@ -393,7 +394,7 @@ function statistics_admin_accesslog_table($type, $id) {
function statistics_recent_refer($nid = 0) { function statistics_recent_refer($nid = 0) {
global $HTTP_HOST, $view; global $view;
if (empty($view)) { if (empty($view)) {
$view = arg(3); $view = arg(3);
@ -406,12 +407,12 @@ function statistics_recent_refer($nid = 0) {
$query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url <> '' ORDER BY timestamp DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url LIKE '%". check_input($HTTP_HOST) ."%' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' ORDER BY timestamp DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
/* default to external referrers */ /* default to external referrers */
$query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE nid='$nid' AND url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' ORDER BY timestamp DESC";
$describe = "external "; $describe = "external ";
} }
@ -423,11 +424,11 @@ function statistics_recent_refer($nid = 0) {
$query = "SELECT url,timestamp FROM accesslog WHERE url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE url <> '' ORDER BY timestamp DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url,timestamp FROM accesslog WHERE url LIKE '%". check_input($HTTP_HOST) ."%' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' ORDER BY timestamp DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
$query = "SELECT url,timestamp FROM accesslog WHERE url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' ORDER BY timestamp DESC"; $query = "SELECT url,timestamp FROM accesslog WHERE url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' ORDER BY timestamp DESC";
$describe = "external "; $describe = "external ";
} }
@ -447,7 +448,7 @@ function statistics_recent_refer($nid = 0) {
function statistics_top_refer($nid = 0) { function statistics_top_refer($nid = 0) {
global $HTTP_HOST, $view; global $view;
$node = node_load(array("nid" => $nid)); $node = node_load(array("nid" => $nid));
@ -456,12 +457,12 @@ function statistics_top_refer($nid = 0) {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url <> '' GROUP BY url ORDER BY count DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url LIKE '%". check_input($HTTP_HOST) ."%' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' GROUP BY url ORDER BY count DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
/* default to external */ /* default to external */
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE nid = '$nid' AND url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' GROUP BY url ORDER BY count DESC";
$describe = "external "; $describe = "external ";
} }
@ -472,12 +473,12 @@ function statistics_top_refer($nid = 0) {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url <> '' GROUP BY url ORDER BY count DESC";
} }
elseif ($view == "internal") { elseif ($view == "internal") {
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url LIKE '%". check_input($HTTP_HOST) ."%' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' GROUP BY url ORDER BY count DESC";
$describe = "internal "; $describe = "internal ";
} }
else { else {
/* default to external */ /* default to external */
$query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url NOT LIKE '%". check_input($HTTP_HOST) ."%' AND url <> '' GROUP BY url ORDER BY count DESC"; $query = "SELECT url, COUNT(url) AS count FROM accesslog WHERE url NOT LIKE '%". check_input($_SERVER["HTTP_HOST"]) ."%' AND url <> '' GROUP BY url ORDER BY count DESC";
$describe = "external "; $describe = "external ";
} }

View File

@ -310,7 +310,9 @@ function system_listing($type, $directory, $required = array()) {
} }
function system_admin() { function system_admin() {
global $op, $edit;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer site configuration")) { if (user_access("administer site configuration")) {
if ($op == t("Reset to defaults")) { if ($op == t("Reset to defaults")) {

View File

@ -310,7 +310,9 @@ function system_listing($type, $directory, $required = array()) {
} }
function system_admin() { function system_admin() {
global $op, $edit;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer site configuration")) { if (user_access("administer site configuration")) {
if ($op == t("Reset to defaults")) { if ($op == t("Reset to defaults")) {

View File

@ -730,7 +730,8 @@ function taxonomy_page() {
*/ */
function taxonomy_admin() { function taxonomy_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer taxonomy")) { if (user_access("administer taxonomy")) {
if (empty($op)) { if (empty($op)) {

View File

@ -730,7 +730,8 @@ function taxonomy_page() {
*/ */
function taxonomy_admin() { function taxonomy_admin() {
global $op, $edit; $op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer taxonomy")) { if (user_access("administer taxonomy")) {
if (empty($op)) { if (empty($op)) {

View File

@ -27,17 +27,15 @@ function sess_read($key) {
} }
function sess_write($key, $value) { function sess_write($key, $value) {
global $HTTP_SERVER_VARS;
db_query("UPDATE users SET hostname = '%s', session = '%s', timestamp = %d WHERE sid = '$key'", $HTTP_SERVER_VARS["REMOTE_ADDR"], $value, time()); db_query("UPDATE users SET hostname = '%s', session = '%s', timestamp = %d WHERE sid = '$key'", $_SERVER["REMOTE_ADDR"], $value, time());
return ''; return '';
} }
function sess_destroy($key) { function sess_destroy($key) {
global $HTTP_SERVER_VARS;
db_query("UPDATE users SET hostname = '%s', timestamp = %d, sid = '' WHERE sid = '$key'", $HTTP_SERVER_VARS["REMOTE_ADDR"], time()); db_query("UPDATE users SET hostname = '%s', timestamp = %d, sid = '' WHERE sid = '$key'", $_SERVER["REMOTE_ADDR"], time());
} }
function sess_gc($lifetime) { function sess_gc($lifetime) {
@ -288,16 +286,18 @@ function user_perm() {
} }
function user_search($keys) { function user_search($keys) {
global $PHP_SELF;
$result = db_query_range("SELECT * FROM users WHERE name LIKE '%$keys%'", 0, 20); $result = db_query_range("SELECT * FROM users WHERE name LIKE '%$keys%'", 0, 20);
while ($account = db_fetch_object($result)) { while ($account = db_fetch_object($result)) {
$find[$i++] = array("title" => $account->name, "link" => (strstr($PHP_SELF, "admin") ? url("admin/user/edit/$account->uid") : url("user/view/$account->uid")), "user" => $account->name); $find[$i++] = array("title" => $account->name, "link" => (strstr($_SERVER["PHP_SELF"], "admin") ? url("admin/user/edit/$account->uid") : url("user/view/$account->uid")), "user" => $account->name);
} }
return $find; return $find;
} }
function user_block($op = "list", $delta = 0) { function user_block($op = "list", $delta = 0) {
global $user, $edit; global $user;
$edit = $_POST["edit"];
if ($op == "list") { if ($op == "list") {
$blocks[0]["info"] = t("Log in"); $blocks[0]["info"] = t("Log in");
@ -505,7 +505,7 @@ function user_auth_help_links() {
/*** User features *********************************************************/ /*** User features *********************************************************/
function user_login($edit = array(), $msg = "") { function user_login($edit = array(), $msg = "") {
global $user, $referer; global $user;
/* /*
** If we are already logged on, go to the user page instead. ** If we are already logged on, go to the user page instead.
@ -746,6 +746,7 @@ function user_pass($edit = array()) {
function user_register($edit = array()) { function user_register($edit = array()) {
global $user, $base_url; global $user, $base_url;
$edit = $_POST["edit"];
/* /*
** If we are already logged on, go to the user page instead. ** If we are already logged on, go to the user page instead.
*/ */
@ -871,7 +872,9 @@ function user_register($edit = array()) {
function user_delete() { function user_delete() {
global $edit, $user; global $user;
$edit = $_SERVER["edit"];
if ($edit["confirm"]) { if ($edit["confirm"]) {
watchdog("user","$user->name deactivated her own account."); watchdog("user","$user->name deactivated her own account.");
@ -1060,7 +1063,9 @@ function user_view($uid = 0) {
} }
function user_page() { function user_page() {
global $edit, $op;
$edit = $_POST["edit"];
$op = $_POST["op"];
if (empty($op)) { if (empty($op)) {
$op = arg(1); $op = arg(1);
@ -1185,8 +1190,8 @@ function user_admin_create($edit = array()) {
} }
function user_admin_access($edit = array()) { function user_admin_access($edit = array()) {
global $op, $id, $type;
$op = $_POST["op"];
$type = arg(3); $type = arg(3);
$id = arg(4); $id = arg(4);
@ -1329,8 +1334,8 @@ function user_admin_perm($edit = array()) {
} }
function user_admin_role($edit = array()) { function user_admin_role($edit = array()) {
global $op;
$op = $_POST["op"];
$id = arg(3); $id = arg(3);
if ($op == t("Save role")) { if ($op == t("Save role")) {
@ -1378,8 +1383,8 @@ function user_admin_role($edit = array()) {
} }
function user_admin_edit($edit = array()) { function user_admin_edit($edit = array()) {
global $op;
$op = $_SERVER["op"];
$id = arg(3); $id = arg(3);
if ($account = user_load(array("uid" => $id))) { if ($account = user_load(array("uid" => $id))) {
@ -1520,7 +1525,9 @@ function user_role_init() {
} }
function user_admin() { function user_admin() {
global $op, $edit;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer users")) { if (user_access("administer users")) {
/* /*

View File

@ -27,17 +27,15 @@ function sess_read($key) {
} }
function sess_write($key, $value) { function sess_write($key, $value) {
global $HTTP_SERVER_VARS;
db_query("UPDATE users SET hostname = '%s', session = '%s', timestamp = %d WHERE sid = '$key'", $HTTP_SERVER_VARS["REMOTE_ADDR"], $value, time()); db_query("UPDATE users SET hostname = '%s', session = '%s', timestamp = %d WHERE sid = '$key'", $_SERVER["REMOTE_ADDR"], $value, time());
return ''; return '';
} }
function sess_destroy($key) { function sess_destroy($key) {
global $HTTP_SERVER_VARS;
db_query("UPDATE users SET hostname = '%s', timestamp = %d, sid = '' WHERE sid = '$key'", $HTTP_SERVER_VARS["REMOTE_ADDR"], time()); db_query("UPDATE users SET hostname = '%s', timestamp = %d, sid = '' WHERE sid = '$key'", $_SERVER["REMOTE_ADDR"], time());
} }
function sess_gc($lifetime) { function sess_gc($lifetime) {
@ -288,16 +286,18 @@ function user_perm() {
} }
function user_search($keys) { function user_search($keys) {
global $PHP_SELF;
$result = db_query_range("SELECT * FROM users WHERE name LIKE '%$keys%'", 0, 20); $result = db_query_range("SELECT * FROM users WHERE name LIKE '%$keys%'", 0, 20);
while ($account = db_fetch_object($result)) { while ($account = db_fetch_object($result)) {
$find[$i++] = array("title" => $account->name, "link" => (strstr($PHP_SELF, "admin") ? url("admin/user/edit/$account->uid") : url("user/view/$account->uid")), "user" => $account->name); $find[$i++] = array("title" => $account->name, "link" => (strstr($_SERVER["PHP_SELF"], "admin") ? url("admin/user/edit/$account->uid") : url("user/view/$account->uid")), "user" => $account->name);
} }
return $find; return $find;
} }
function user_block($op = "list", $delta = 0) { function user_block($op = "list", $delta = 0) {
global $user, $edit; global $user;
$edit = $_POST["edit"];
if ($op == "list") { if ($op == "list") {
$blocks[0]["info"] = t("Log in"); $blocks[0]["info"] = t("Log in");
@ -505,7 +505,7 @@ function user_auth_help_links() {
/*** User features *********************************************************/ /*** User features *********************************************************/
function user_login($edit = array(), $msg = "") { function user_login($edit = array(), $msg = "") {
global $user, $referer; global $user;
/* /*
** If we are already logged on, go to the user page instead. ** If we are already logged on, go to the user page instead.
@ -746,6 +746,7 @@ function user_pass($edit = array()) {
function user_register($edit = array()) { function user_register($edit = array()) {
global $user, $base_url; global $user, $base_url;
$edit = $_POST["edit"];
/* /*
** If we are already logged on, go to the user page instead. ** If we are already logged on, go to the user page instead.
*/ */
@ -871,7 +872,9 @@ function user_register($edit = array()) {
function user_delete() { function user_delete() {
global $edit, $user; global $user;
$edit = $_SERVER["edit"];
if ($edit["confirm"]) { if ($edit["confirm"]) {
watchdog("user","$user->name deactivated her own account."); watchdog("user","$user->name deactivated her own account.");
@ -1060,7 +1063,9 @@ function user_view($uid = 0) {
} }
function user_page() { function user_page() {
global $edit, $op;
$edit = $_POST["edit"];
$op = $_POST["op"];
if (empty($op)) { if (empty($op)) {
$op = arg(1); $op = arg(1);
@ -1185,8 +1190,8 @@ function user_admin_create($edit = array()) {
} }
function user_admin_access($edit = array()) { function user_admin_access($edit = array()) {
global $op, $id, $type;
$op = $_POST["op"];
$type = arg(3); $type = arg(3);
$id = arg(4); $id = arg(4);
@ -1329,8 +1334,8 @@ function user_admin_perm($edit = array()) {
} }
function user_admin_role($edit = array()) { function user_admin_role($edit = array()) {
global $op;
$op = $_POST["op"];
$id = arg(3); $id = arg(3);
if ($op == t("Save role")) { if ($op == t("Save role")) {
@ -1378,8 +1383,8 @@ function user_admin_role($edit = array()) {
} }
function user_admin_edit($edit = array()) { function user_admin_edit($edit = array()) {
global $op;
$op = $_SERVER["op"];
$id = arg(3); $id = arg(3);
if ($account = user_load(array("uid" => $id))) { if ($account = user_load(array("uid" => $id))) {
@ -1520,7 +1525,9 @@ function user_role_init() {
} }
function user_admin() { function user_admin() {
global $op, $edit;
$op = $_POST["op"];
$edit = $_POST["edit"];
if (user_access("administer users")) { if (user_access("administer users")) {
/* /*

View File

@ -4,5 +4,5 @@ find . -name ".#*" -type f | xargs rm -f
find . -name "*.rej" -type f | xargs rm -f find . -name "*.rej" -type f | xargs rm -f
find . -name "*.orig" -type f | xargs rm -f find . -name "*.orig" -type f | xargs rm -f
find . -name "DEADJOE" -type f | xargs rm -f find . -name "DEADJOE" -type f | xargs rm -f
find . -name "*" -type f | grep -v ".psp" | grep -v ".gif" | grep -v ".jpg" | grep -v ".png" | grep -v ".tgz" | xargs perl -wi -pe 's/\s+$/\n/' find . -type f | grep -v ".psp" | grep -v ".gif" | grep -v ".jpg" | grep -v ".png" | grep -v ".tgz" | xargs perl -wi -pe 's/\s+$/\n/'
find . -name "*" -type f | grep -v ".psp" | grep -v ".gif" | grep -v ".jpg" | grep -v ".png" | grep -v ".tgz" | xargs perl -wi -pe 's/\t/ /g' find . -type f | grep -v ".psp" | grep -v ".gif" | grep -v ".jpg" | grep -v ".png" | grep -v ".tgz" | xargs perl -wi -pe 's/\t/ /g'

View File

@ -27,7 +27,7 @@
} }
function header($title = "") { function header($title = "") {
global $HTTP_USER_AGENT, $base_url; global $base_url;
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html>
@ -48,7 +48,7 @@
<style type="text/css"> <style type="text/css">
<!-- <!--
<?php <?php
if (eregi("Windows", $HTTP_USER_AGENT)) { if (eregi("Windows", $_SERVER["HTTP_USER_AGENT"])) {
// Windows / MSIE specific settings: // Windows / MSIE specific settings:
print "BODY { margin: 10px; font-size: 10pt; font-family: Verdana, Helvetica; }"; print "BODY { margin: 10px; font-size: 10pt; font-family: Verdana, Helvetica; }";
print "SMALL { font-size: 9pt; }"; print "SMALL { font-size: 9pt; }";

View File

@ -739,7 +739,7 @@ function update_upgrade3() {
*/ */
function update_sql($sql) { function update_sql($sql) {
global $edit; $edit = $_POST["edit"];
print nl2br(htmlentities($sql)) ." "; print nl2br(htmlentities($sql)) ." ";
$result = db_query($sql); $result = db_query($sql);
if ($result) { if ($result) {
@ -767,7 +767,10 @@ function update_data($start) {
} }
function update_page() { function update_page() {
global $op, $edit, $user, $mysql_updates; global $user, $mysql_updates;
$op = $_POST["op"];
$edit = $_POST["edit"];
switch ($op) { switch ($op) {
case "Update": case "Update":