diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-05-13 18:36:38 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-05-13 18:36:38 +0000 |
commit | c2d2fb73095a32394dd95e72421aec49fa2cd6f6 (patch) | |
tree | 5d2d92a31480405b8c10c3b85927049238528242 /modules | |
parent | 13ffd8956826fec3cd9978edf73ef67d9eb8d46e (diff) | |
download | brdo-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 'modules')
38 files changed, 209 insertions, 132 deletions
diff --git a/modules/admin.module b/modules/admin.module index 670c85122..abe7dfbfc 100644 --- a/modules/admin.module +++ b/modules/admin.module @@ -25,7 +25,7 @@ function admin_admin() { } function admin_page() { - global $user, $base_url; + global $base_url; if (user_access("access administration pages")) { page_header(); diff --git a/modules/aggregator.module b/modules/aggregator.module index 69abf97bf..b5ed8f92b 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -488,7 +488,8 @@ function import_tag() { } function import_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer news feeds")) { diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 69abf97bf..b5ed8f92b 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -488,7 +488,8 @@ function import_tag() { } function import_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer news feeds")) { diff --git a/modules/archive.module b/modules/archive.module index 71aec57f6..1dd7b1a26 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -140,7 +140,10 @@ function archive_link($type) { } function archive_page() { - global $date, $edit, $op, $month, $year, $meta; + global $date, $month, $year, $meta; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; theme("header"); diff --git a/modules/archive/archive.module b/modules/archive/archive.module index 71aec57f6..1dd7b1a26 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -140,7 +140,10 @@ function archive_link($type) { } function archive_page() { - global $date, $edit, $op, $month, $year, $meta; + global $date, $month, $year, $meta; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; theme("header"); diff --git a/modules/block.module b/modules/block.module index a6bac4fbb..c70f0f6c5 100644 --- a/modules/block.module +++ b/modules/block.module @@ -260,7 +260,8 @@ function block_box_delete($bid) { } function block_admin() { - global $edit, $op; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer blocks")) { diff --git a/modules/block/block.module b/modules/block/block.module index a6bac4fbb..c70f0f6c5 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -260,7 +260,8 @@ function block_box_delete($bid) { } function block_admin() { - global $edit, $op; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer blocks")) { diff --git a/modules/book.module b/modules/book.module index dd44b6b82..bc30b2546 100644 --- a/modules/book.module +++ b/modules/book.module @@ -160,8 +160,9 @@ function book_validate(&$node) { } 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.")); if (function_exists("taxonomy_node_form")) { @@ -197,7 +198,10 @@ function book_form(&$node, &$help, &$error) { } function book_node_link($node = 0) { - global $user, $op, $edit; + global $user; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; if ($node->type != "book") { @@ -337,7 +341,7 @@ function book_next($node) { } function book_body($node) { - global $op; + $op = $_POST["op"]; if ($node->format == 1) { // Make sure only authorized users can preview PHP pages. @@ -705,7 +709,8 @@ function book_admin_links() { } function book_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer nodes")) { if (empty($op)) { diff --git a/modules/book/book.module b/modules/book/book.module index dd44b6b82..bc30b2546 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -160,8 +160,9 @@ function book_validate(&$node) { } 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.")); if (function_exists("taxonomy_node_form")) { @@ -197,7 +198,10 @@ function book_form(&$node, &$help, &$error) { } function book_node_link($node = 0) { - global $user, $op, $edit; + global $user; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; if ($node->type != "book") { @@ -337,7 +341,7 @@ function book_next($node) { } function book_body($node) { - global $op; + $op = $_POST["op"]; if ($node->format == 1) { // Make sure only authorized users can preview PHP pages. @@ -705,7 +709,8 @@ function book_admin_links() { } function book_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer nodes")) { if (empty($op)) { diff --git a/modules/cloud.module b/modules/cloud.module index 71e49b7bb..613771943 100644 --- a/modules/cloud.module +++ b/modules/cloud.module @@ -185,7 +185,8 @@ function cloud_block($op = "list", $delta = 0) { } function cloud_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (empty($op)) { $op = arg(3); diff --git a/modules/comment.module b/modules/comment.module index d7b042b96..c52e37c94 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -676,7 +676,8 @@ function comment_link($type, $node = 0, $main = 0) { } function comment_page() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (empty($op)) { $op = arg(1); @@ -880,7 +881,7 @@ function comment_mod_roles($edit) { } function comment_mod_votes($edit) { - global $op; + $op = $_POST["op"]; $mid = arg(3); @@ -928,7 +929,7 @@ function comment_mod_votes($edit) { } function comment_mod_filters($edit) { - global $op; + $op = $_POST["op"]; $fid = arg(3); @@ -978,7 +979,10 @@ function comment_mod_filters($edit) { 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)) { $op = arg(2); @@ -1122,9 +1126,11 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $nid, $page = 0 } function comment_moderation_form($comment) { - global $comment_votes, $op, $user, $node; + global $comment_votes, $user, $node; static $votes; + $op = $_POST["op"]; + if ($op == "reply") { // preview comment: $output .= " "; @@ -1393,7 +1399,6 @@ function comment_already_moderated($uid, $users) { } function comment_search($keys) { - global $PHP_SELF; /* ** Return the results of performing a search using the indexed search diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d7b042b96..c52e37c94 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -676,7 +676,8 @@ function comment_link($type, $node = 0, $main = 0) { } function comment_page() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (empty($op)) { $op = arg(1); @@ -880,7 +881,7 @@ function comment_mod_roles($edit) { } function comment_mod_votes($edit) { - global $op; + $op = $_POST["op"]; $mid = arg(3); @@ -928,7 +929,7 @@ function comment_mod_votes($edit) { } function comment_mod_filters($edit) { - global $op; + $op = $_POST["op"]; $fid = arg(3); @@ -978,7 +979,10 @@ function comment_mod_filters($edit) { 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)) { $op = arg(2); @@ -1122,9 +1126,11 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $nid, $page = 0 } function comment_moderation_form($comment) { - global $comment_votes, $op, $user, $node; + global $comment_votes, $user, $node; static $votes; + $op = $_POST["op"]; + if ($op == "reply") { // preview comment: $output .= " "; @@ -1393,7 +1399,6 @@ function comment_already_moderated($uid, $users) { } function comment_search($keys) { - global $PHP_SELF; /* ** Return the results of performing a search using the indexed search diff --git a/modules/drupal.module b/modules/drupal.module index f9306dbff..8e3aaaff9 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -175,7 +175,6 @@ function drupal_auth_help() { } function drupal_user($type, $edit, $user) { - global $HTTP_HOST; $module = "drupal"; $name = module_invoke($module, "info", "name"); @@ -187,7 +186,7 @@ function drupal_user($type, $edit, $user) { } else { // 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; } diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index f9306dbff..8e3aaaff9 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -175,7 +175,6 @@ function drupal_auth_help() { } function drupal_user($type, $edit, $user) { - global $HTTP_HOST; $module = "drupal"; $name = module_invoke($module, "info", "name"); @@ -187,7 +186,7 @@ function drupal_user($type, $edit, $user) { } else { // 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; } diff --git a/modules/forum.module b/modules/forum.module index 814b07c69..3c9edcc49 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -449,7 +449,8 @@ function _forum_message_taxonomy() { } 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 (module_exist("taxonomy")) { diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 814b07c69..3c9edcc49 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -449,7 +449,8 @@ function _forum_message_taxonomy() { } 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 (module_exist("taxonomy")) { diff --git a/modules/import.module b/modules/import.module index 69abf97bf..b5ed8f92b 100644 --- a/modules/import.module +++ b/modules/import.module @@ -488,7 +488,8 @@ function import_tag() { } function import_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer news feeds")) { diff --git a/modules/locale.module b/modules/locale.module index 09453e86c..41197e51e 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -72,7 +72,7 @@ function locale_delete($lid) { } function locale_save($lid) { - global $edit; + $edit = $_POST["edit"]; foreach ($edit as $key=>$value) { db_query("UPDATE locales SET $key = '%s' WHERE lid = %d", $value, $lid); } @@ -124,7 +124,9 @@ function locale_languages($translation) { } 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")) { $edit = $locale_settings; @@ -197,7 +199,8 @@ function locale_seek() { } function locale_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer locales")) { locale_admin_initialize(); diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 09453e86c..41197e51e 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -72,7 +72,7 @@ function locale_delete($lid) { } function locale_save($lid) { - global $edit; + $edit = $_POST["edit"]; foreach ($edit as $key=>$value) { db_query("UPDATE locales SET $key = '%s' WHERE lid = %d", $value, $lid); } @@ -124,7 +124,9 @@ function locale_languages($translation) { } 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")) { $edit = $locale_settings; @@ -197,7 +199,8 @@ function locale_seek() { } function locale_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer locales")) { locale_admin_initialize(); diff --git a/modules/node.module b/modules/node.module index aa0c8b2b1..7ec69b207 100644 --- a/modules/node.module +++ b/modules/node.module @@ -422,7 +422,6 @@ function node_perm() { } function node_search($keys) { - global $PHP_SELF; // Return the results of performing a search using the indexed search // for this particular type of node. @@ -597,7 +596,7 @@ function node_admin_nodes() { */ function node_admin_settings($edit) { - global $op; + $op = $_POST["op"]; if ($op == t("Save configuration")) { /* @@ -762,7 +761,8 @@ function node_revision_list($node) { } function node_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer nodes")) { @@ -1094,7 +1094,9 @@ function node_form($edit, $error = NULL) { } function node_add($type) { - global $user, $edit; + global $user; + + $edit = $_POST["edit"]; /* ** If a node type has been specified, validate it existence. If no @@ -1353,7 +1355,10 @@ function node_delete($edit) { } 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 (empty($op)) { diff --git a/modules/node/node.module b/modules/node/node.module index aa0c8b2b1..7ec69b207 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -422,7 +422,6 @@ function node_perm() { } function node_search($keys) { - global $PHP_SELF; // Return the results of performing a search using the indexed search // for this particular type of node. @@ -597,7 +596,7 @@ function node_admin_nodes() { */ function node_admin_settings($edit) { - global $op; + $op = $_POST["op"]; if ($op == t("Save configuration")) { /* @@ -762,7 +761,8 @@ function node_revision_list($node) { } function node_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer nodes")) { @@ -1094,7 +1094,9 @@ function node_form($edit, $error = NULL) { } function node_add($type) { - global $user, $edit; + global $user; + + $edit = $_POST["edit"]; /* ** If a node type has been specified, validate it existence. If no @@ -1353,7 +1355,10 @@ function node_delete($edit) { } 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 (empty($op)) { diff --git a/modules/page.module b/modules/page.module index 178c7c4e8..87f70d744 100644 --- a/modules/page.module +++ b/modules/page.module @@ -89,7 +89,8 @@ function page_link($type) { } function page_body($node) { - global $op; + $op = $_POST["op"]; + if ($node->format == 0) { // HTML type $output = check_output($node->body); diff --git a/modules/page/page.module b/modules/page/page.module index 178c7c4e8..87f70d744 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -89,7 +89,8 @@ function page_link($type) { } function page_body($node) { - global $op; + $op = $_POST["op"]; + if ($node->format == 0) { // HTML type $output = check_output($node->body); diff --git a/modules/poll.module b/modules/poll.module index 0fc1db8a9..3c8477df5 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -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 ** poll_load() (i.e. for every poll that is loaded) for speed reasons. */ - global $REMOTE_ADDR, $user; + global $user; if ($node->allowvotes != -1) { return $node; @@ -20,7 +20,7 @@ function poll_allowvotes(&$node) { $id = "_". $user->uid ."_"; } else { - $id = $REMOTE_ADDR; + $id = $_SERVER["REMOTE_ADDR"]; } if (!strstr($node->voters, $id)) { $node->allowvotes = $node->active; diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 0fc1db8a9..3c8477df5 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -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 ** poll_load() (i.e. for every poll that is loaded) for speed reasons. */ - global $REMOTE_ADDR, $user; + global $user; if ($node->allowvotes != -1) { return $node; @@ -20,7 +20,7 @@ function poll_allowvotes(&$node) { $id = "_". $user->uid ."_"; } else { - $id = $REMOTE_ADDR; + $id = $_SERVER["REMOTE_ADDR"]; } if (!strstr($node->voters, $id)) { $node->allowvotes = $node->active; diff --git a/modules/profile.module b/modules/profile.module index d09639c85..8fb6da588 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -136,7 +136,7 @@ function _profile_form($edit, $mode) { function _profile_validate($edit, $mode) { - global $profile_fields, $user, $HTTP_POST_VARS; + global $profile_fields, $user; $enabled_fields = _profile_active_fields($mode); @@ -206,19 +206,19 @@ function _profile_user_view(&$user, $mode) { } 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 unset($edit["profile_avatar"]); - if ($HTTP_POST_FILES["edit"]["name"]["profile_avatar"] == "") { + if ($_FILES["edit"]["name"]["profile_avatar"] == "") { $edit["profile_avatar"] = $user->profile_avatar; 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)) { - $extension = strtolower(strrchr($HTTP_POST_FILES["edit"]["name"]["profile_avatar"], ".")); + $extension = strtolower(strrchr($_FILES["edit"]["name"]["profile_avatar"], ".")); $size = getimagesize($image_file); 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")))) { diff --git a/modules/profile/profile.module b/modules/profile/profile.module index d09639c85..8fb6da588 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -136,7 +136,7 @@ function _profile_form($edit, $mode) { function _profile_validate($edit, $mode) { - global $profile_fields, $user, $HTTP_POST_VARS; + global $profile_fields, $user; $enabled_fields = _profile_active_fields($mode); @@ -206,19 +206,19 @@ function _profile_user_view(&$user, $mode) { } 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 unset($edit["profile_avatar"]); - if ($HTTP_POST_FILES["edit"]["name"]["profile_avatar"] == "") { + if ($_FILES["edit"]["name"]["profile_avatar"] == "") { $edit["profile_avatar"] = $user->profile_avatar; 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)) { - $extension = strtolower(strrchr($HTTP_POST_FILES["edit"]["name"]["profile_avatar"], ".")); + $extension = strtolower(strrchr($_FILES["edit"]["name"]["profile_avatar"], ".")); $size = getimagesize($image_file); 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")))) { diff --git a/modules/queue.module b/modules/queue.module index 7d4f1d274..69c7f45a8 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -111,7 +111,10 @@ function queue_overview() { } function queue_view($nid) { - global $op, $edit, $user; + global $user; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; /* ** An associative array with the possible voting options: diff --git a/modules/search.module b/modules/search.module index c87372241..e680e2f1c 100644 --- a/modules/search.module +++ b/modules/search.module @@ -51,7 +51,7 @@ function search_settings() { * */ function search_admin() { - global $op; + $op = $_POST["op"]; // Only allow people with sufficient access. if (user_access("administer search")) { @@ -92,7 +92,6 @@ function search_cron() { * explanation of array items */ function do_search($search_array) { - global $PHP_SELF; $keys = strtolower($search_array["keys"]); $type = $search_array["type"]; @@ -167,10 +166,10 @@ function do_search($search_array) { $count = $value["count"]; switch ($type) { 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; 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; } } @@ -306,7 +305,9 @@ function search_save($edit) { } function search_view($keys = NULL) { - global $edit, $type; + global $type; + + $edit = $_POST["edit"]; if (user_access("search content")) { // Construct the search form: diff --git a/modules/search/search.module b/modules/search/search.module index c87372241..e680e2f1c 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -51,7 +51,7 @@ function search_settings() { * */ function search_admin() { - global $op; + $op = $_POST["op"]; // Only allow people with sufficient access. if (user_access("administer search")) { @@ -92,7 +92,6 @@ function search_cron() { * explanation of array items */ function do_search($search_array) { - global $PHP_SELF; $keys = strtolower($search_array["keys"]); $type = $search_array["type"]; @@ -167,10 +166,10 @@ function do_search($search_array) { $count = $value["count"]; switch ($type) { 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; 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; } } @@ -306,7 +305,9 @@ function search_save($edit) { } function search_view($keys = NULL) { - global $edit, $type; + global $type; + + $edit = $_POST["edit"]; if (user_access("search content")) { // Construct the search form: diff --git a/modules/statistics.module b/modules/statistics.module index 4c6a6fb77..f227baabf 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -259,7 +259,8 @@ function statistics_help() { /* Administration hook, defines module's administrative page */ function statistics_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; /* Only allow people with sufficient access. */ 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) { - global $HTTP_HOST, $view; + global $view; if (empty($view)) { $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"; } 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 "; } else { /* 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 "; } @@ -423,11 +424,11 @@ function statistics_recent_refer($nid = 0) { $query = "SELECT url,timestamp FROM accesslog WHERE url <> '' ORDER BY timestamp DESC"; } 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 "; } 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 "; } @@ -447,7 +448,7 @@ function statistics_recent_refer($nid = 0) { function statistics_top_refer($nid = 0) { - global $HTTP_HOST, $view; + global $view; $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"; } 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 "; } else { /* 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 "; } @@ -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"; } 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 "; } else { /* 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 "; } diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 4c6a6fb77..f227baabf 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -259,7 +259,8 @@ function statistics_help() { /* Administration hook, defines module's administrative page */ function statistics_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; /* Only allow people with sufficient access. */ 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) { - global $HTTP_HOST, $view; + global $view; if (empty($view)) { $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"; } 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 "; } else { /* 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 "; } @@ -423,11 +424,11 @@ function statistics_recent_refer($nid = 0) { $query = "SELECT url,timestamp FROM accesslog WHERE url <> '' ORDER BY timestamp DESC"; } 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 "; } 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 "; } @@ -447,7 +448,7 @@ function statistics_recent_refer($nid = 0) { function statistics_top_refer($nid = 0) { - global $HTTP_HOST, $view; + global $view; $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"; } 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 "; } else { /* 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 "; } @@ -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"; } 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 "; } else { /* 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 "; } diff --git a/modules/system.module b/modules/system.module index a0e69bbea..3158c24d7 100644 --- a/modules/system.module +++ b/modules/system.module @@ -310,7 +310,9 @@ function system_listing($type, $directory, $required = array()) { } function system_admin() { - global $op, $edit; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer site configuration")) { if ($op == t("Reset to defaults")) { diff --git a/modules/system/system.module b/modules/system/system.module index a0e69bbea..3158c24d7 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -310,7 +310,9 @@ function system_listing($type, $directory, $required = array()) { } function system_admin() { - global $op, $edit; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer site configuration")) { if ($op == t("Reset to defaults")) { diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 02ad81610..c6d9f8103 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -730,7 +730,8 @@ function taxonomy_page() { */ function taxonomy_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer taxonomy")) { if (empty($op)) { diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 02ad81610..c6d9f8103 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -730,7 +730,8 @@ function taxonomy_page() { */ function taxonomy_admin() { - global $op, $edit; + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer taxonomy")) { if (empty($op)) { diff --git a/modules/user.module b/modules/user.module index 8db17ffb5..5782a2782 100644 --- a/modules/user.module +++ b/modules/user.module @@ -27,17 +27,15 @@ function sess_read($key) { } 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 ''; } 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) { @@ -288,16 +286,18 @@ function user_perm() { } function user_search($keys) { - global $PHP_SELF; + $result = db_query_range("SELECT * FROM users WHERE name LIKE '%$keys%'", 0, 20); 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; } function user_block($op = "list", $delta = 0) { - global $user, $edit; + global $user; + + $edit = $_POST["edit"]; if ($op == "list") { $blocks[0]["info"] = t("Log in"); @@ -505,7 +505,7 @@ function user_auth_help_links() { /*** User features *********************************************************/ function user_login($edit = array(), $msg = "") { - global $user, $referer; + global $user; /* ** 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()) { global $user, $base_url; + $edit = $_POST["edit"]; /* ** If we are already logged on, go to the user page instead. */ @@ -871,7 +872,9 @@ function user_register($edit = array()) { function user_delete() { - global $edit, $user; + global $user; + + $edit = $_SERVER["edit"]; if ($edit["confirm"]) { watchdog("user","$user->name deactivated her own account."); @@ -1060,7 +1063,9 @@ function user_view($uid = 0) { } function user_page() { - global $edit, $op; + + $edit = $_POST["edit"]; + $op = $_POST["op"]; if (empty($op)) { $op = arg(1); @@ -1185,8 +1190,8 @@ function user_admin_create($edit = array()) { } function user_admin_access($edit = array()) { - global $op, $id, $type; + $op = $_POST["op"]; $type = arg(3); $id = arg(4); @@ -1329,8 +1334,8 @@ function user_admin_perm($edit = array()) { } function user_admin_role($edit = array()) { - global $op; + $op = $_POST["op"]; $id = arg(3); if ($op == t("Save role")) { @@ -1378,8 +1383,8 @@ function user_admin_role($edit = array()) { } function user_admin_edit($edit = array()) { - global $op; + $op = $_SERVER["op"]; $id = arg(3); if ($account = user_load(array("uid" => $id))) { @@ -1520,7 +1525,9 @@ function user_role_init() { } function user_admin() { - global $op, $edit; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer users")) { /* diff --git a/modules/user/user.module b/modules/user/user.module index 8db17ffb5..5782a2782 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -27,17 +27,15 @@ function sess_read($key) { } 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 ''; } 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) { @@ -288,16 +286,18 @@ function user_perm() { } function user_search($keys) { - global $PHP_SELF; + $result = db_query_range("SELECT * FROM users WHERE name LIKE '%$keys%'", 0, 20); 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; } function user_block($op = "list", $delta = 0) { - global $user, $edit; + global $user; + + $edit = $_POST["edit"]; if ($op == "list") { $blocks[0]["info"] = t("Log in"); @@ -505,7 +505,7 @@ function user_auth_help_links() { /*** User features *********************************************************/ function user_login($edit = array(), $msg = "") { - global $user, $referer; + global $user; /* ** 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()) { global $user, $base_url; + $edit = $_POST["edit"]; /* ** If we are already logged on, go to the user page instead. */ @@ -871,7 +872,9 @@ function user_register($edit = array()) { function user_delete() { - global $edit, $user; + global $user; + + $edit = $_SERVER["edit"]; if ($edit["confirm"]) { watchdog("user","$user->name deactivated her own account."); @@ -1060,7 +1063,9 @@ function user_view($uid = 0) { } function user_page() { - global $edit, $op; + + $edit = $_POST["edit"]; + $op = $_POST["op"]; if (empty($op)) { $op = arg(1); @@ -1185,8 +1190,8 @@ function user_admin_create($edit = array()) { } function user_admin_access($edit = array()) { - global $op, $id, $type; + $op = $_POST["op"]; $type = arg(3); $id = arg(4); @@ -1329,8 +1334,8 @@ function user_admin_perm($edit = array()) { } function user_admin_role($edit = array()) { - global $op; + $op = $_POST["op"]; $id = arg(3); if ($op == t("Save role")) { @@ -1378,8 +1383,8 @@ function user_admin_role($edit = array()) { } function user_admin_edit($edit = array()) { - global $op; + $op = $_SERVER["op"]; $id = arg(3); if ($account = user_load(array("uid" => $id))) { @@ -1520,7 +1525,9 @@ function user_role_init() { } function user_admin() { - global $op, $edit; + + $op = $_POST["op"]; + $edit = $_POST["edit"]; if (user_access("administer users")) { /* |