Skip to content

Commit

Permalink
Changed to superglobals, and eliminated $use_cache (since we always do).
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@1108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
saxmatt committed Apr 20, 2004
1 parent e27e90a commit 10c6b7e
Show file tree
Hide file tree
Showing 49 changed files with 433 additions and 439 deletions.
9 changes: 4 additions & 5 deletions wp-admin/admin-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function gethelp_link($this_file, $helptag) {
return $s;
}

if (!isset($use_cache)) $use_cache=1;
if (!isset($blogID)) $blog_ID=1;
if (!isset($debug)) $debug=0;
timer_start();
Expand All @@ -37,14 +36,14 @@ function gethelp_link($this_file, $helptag) {
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
if (!isset($$wpvar)) {
if (empty($HTTP_POST_VARS["$wpvar"])) {
if (empty($HTTP_GET_VARS["$wpvar"])) {
if (empty($_POST["$wpvar"])) {
if (empty($_GET["$wpvar"])) {
$$wpvar = '';
} else {
$$wpvar = $HTTP_GET_VARS["$wpvar"];
$$wpvar = $_GET["$wpvar"];
}
} else {
$$wpvar = $HTTP_POST_VARS["$wpvar"];
$$wpvar = $_POST["$wpvar"];
}
}
}
Expand Down
32 changes: 16 additions & 16 deletions wp-admin/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ function add_magic_quotes($array) {
}

if (!get_magic_quotes_gpc()) {
$HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS);
$HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS);
$_GET = add_magic_quotes($_GET);
$_POST = add_magic_quotes($_POST);
$_COOKIE = add_magic_quotes($_COOKIE);
}

$wpvarstoreset = array('action','standalone','cat');
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
if (!isset($$wpvar)) {
if (empty($HTTP_POST_VARS["$wpvar"])) {
if (empty($HTTP_GET_VARS["$wpvar"])) {
if (empty($_POST["$wpvar"])) {
if (empty($_GET["$wpvar"])) {
$$wpvar = '';
} else {
$$wpvar = $HTTP_GET_VARS["$wpvar"];
$$wpvar = $_GET["$wpvar"];
}
} else {
$$wpvar = $HTTP_POST_VARS["$wpvar"];
$$wpvar = $_POST["$wpvar"];
}
}
}
Expand All @@ -45,10 +45,10 @@ function add_magic_quotes($array) {
if ($user_level < 3)
die ('Cheatin&#8217; uh?');

$cat_name= addslashes(stripslashes(stripslashes($HTTP_POST_VARS['cat_name'])));
$cat_name= addslashes(stripslashes(stripslashes($_POST['cat_name'])));
$category_nicename = sanitize_title($cat_name);
$category_description = addslashes(stripslashes(stripslashes($HTTP_POST_VARS['category_description'])));
$cat = intval($HTTP_POST_VARS['cat']);
$category_description = addslashes(stripslashes(stripslashes($_POST['category_description'])));
$cat = intval($_POST['cat']);

$wpdb->query("INSERT INTO $tablecategories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");

Expand All @@ -61,7 +61,7 @@ function add_magic_quotes($array) {
$standalone = 1;
require_once('admin-header.php');

$cat_ID = intval($HTTP_GET_VARS["cat_ID"]);
$cat_ID = intval($_GET["cat_ID"]);
$cat_name = get_catname($cat_ID);
$cat_name = addslashes($cat_name);
$category = $wpdb->get_row("SELECT * FROM $tablecategories WHERE cat_ID = " . $cat_ID);
Expand All @@ -84,15 +84,15 @@ function add_magic_quotes($array) {
case 'edit':

require_once ('admin-header.php');
$category = $wpdb->get_row("SELECT * FROM $tablecategories WHERE cat_ID = " . $HTTP_GET_VARS['cat_ID']);
$category = $wpdb->get_row("SELECT * FROM $tablecategories WHERE cat_ID = " . $_GET['cat_ID']);
$cat_name = stripslashes($category->cat_name);
?>

<div class="wrap">
<h2>Edit Category</h2>
<form name="editcat" action="categories.php" method="post">
<input type="hidden" name="action" value="editedcat" />
<input type="hidden" name="cat_ID" value="<?php echo $HTTP_GET_VARS['cat_ID'] ?>" />
<input type="hidden" name="cat_ID" value="<?php echo $_GET['cat_ID'] ?>" />
<p>Category name:<br />
<input type="text" name="cat_name" value="<?php echo $cat_name; ?>" /></p>
<p>Category parent:<br />
Expand All @@ -119,10 +119,10 @@ function add_magic_quotes($array) {
if ($user_level < 3)
die ('Cheatin&#8217; uh?');

$cat_name = addslashes(stripslashes(stripslashes($HTTP_POST_VARS['cat_name'])));
$cat_ID = addslashes($HTTP_POST_VARS['cat_ID']);
$cat_name = addslashes(stripslashes(stripslashes($_POST['cat_name'])));
$cat_ID = addslashes($_POST['cat_ID']);
$category_nicename = sanitize_title($cat_name);
$category_description = $HTTP_POST_VARS['category_description'];
$category_description = $_POST['category_description'];

$wpdb->query("UPDATE $tablecategories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = $cat WHERE cat_ID = $cat_ID");

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/edit-form-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function focusit() {
<?php
}
?>
<input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />
</p>
<?php
if ('' != $pinged) {
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/edit-form-comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function focusit() {
?>

<p class="submit"><input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" style="font-weight: bold;" tabindex="6" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />
</p>


Expand Down
2 changes: 1 addition & 1 deletion wp-admin/edit-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function focusit() {
<?php if ('bookmarklet' != $mode) {
echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing &raquo;') . '" />';
} ?>
<input name="referredby" type="hidden" id="referredby" value="<?php echo $HTTP_SERVER_VARS['HTTP_REFERER']; ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/import-b2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config.sample.php with the proper database connection information and renamed it to wp-config.php.");
require_once('../wp-config.php');
require('upgrade-functions.php');
$step = $HTTP_GET_VARS['step'];
$step = $_GET['step'];
if (!$step) $step = 0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Expand Down
8 changes: 4 additions & 4 deletions wp-admin/import-blogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
if (!isset($$wpvar)) {
if (empty($HTTP_POST_VARS["$wpvar"])) {
if (empty($HTTP_GET_VARS["$wpvar"])) {
if (empty($_POST["$wpvar"])) {
if (empty($_GET["$wpvar"])) {
$$wpvar = '';
} else {
$$wpvar = $HTTP_GET_VARS["$wpvar"];
$$wpvar = $_GET["$wpvar"];
}
} else {
$$wpvar = $HTTP_POST_VARS["$wpvar"];
$$wpvar = $_POST["$wpvar"];
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions wp-admin/import-greymatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
if (!isset($$wpvar)) {
if (empty($HTTP_POST_VARS["$wpvar"])) {
if (empty($HTTP_GET_VARS["$wpvar"])) {
if (empty($_POST["$wpvar"])) {
if (empty($_GET["$wpvar"])) {
$$wpvar = '';
} else {
$$wpvar = $HTTP_GET_VARS["$wpvar"];
$$wpvar = $_GET["$wpvar"];
}
} else {
$$wpvar = $HTTP_POST_VARS["$wpvar"];
$$wpvar = $_POST["$wpvar"];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/import-mt.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. You must install WordPress before you import any entries.");
require('../wp-config.php');

$step = $HTTP_GET_VARS['step'];
$step = $_GET['step'];
if (!$step) $step = 0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/import-textpattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require('../wp-config.php');
require('upgrade-functions.php');

$step = $HTTP_GET_VARS['step'];
$step = $_GET['step'];
if (!$step) $step = 0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Expand Down
12 changes: 6 additions & 6 deletions wp-admin/install-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

if (!is_writable('../')) die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");

$step = $HTTP_GET_VARS['step'];
$step = $_GET['step'];
if (!$step) $step = 0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Expand Down Expand Up @@ -104,11 +104,11 @@
break;

case 2:
$dbname = $HTTP_POST_VARS['dbname'];
$uname = $HTTP_POST_VARS['uname'];
$passwrd = $HTTP_POST_VARS['pwd'];
$dbhost = $HTTP_POST_VARS['dbhost'];
$prefix = $HTTP_POST_VARS['prefix'];
$dbname = $_POST['dbname'];
$uname = $_POST['uname'];
$passwrd = $_POST['pwd'];
$dbhost = $_POST['dbhost'];
$prefix = $_POST['prefix'];
if (empty($prefix)) $prefix = 'wp_';

// Test the db connection.
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require_once('../wp-config.php');
require('upgrade-functions.php');

$step = $HTTP_GET_VARS['step'];
$step = $_GET['step'];
if (!$step) $step = 0;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Expand Down
18 changes: 9 additions & 9 deletions wp-admin/link-add.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function add_magic_quotes($array) {
return $array;
}
if (!get_magic_quotes_gpc()) {
$HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS);
$HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS);
$_GET = add_magic_quotes($_GET);
$_POST = add_magic_quotes($_POST);
$_COOKIE = add_magic_quotes($_COOKIE);
}

$wpvarstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image',
Expand All @@ -44,19 +44,19 @@ function add_magic_quotes($array) {
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
if (!isset($$wpvar)) {
if (empty($HTTP_POST_VARS["$wpvar"])) {
if (empty($HTTP_GET_VARS["$wpvar"])) {
if (empty($_POST["$wpvar"])) {
if (empty($_GET["$wpvar"])) {
$$wpvar = '';
} else {
$$wpvar = $HTTP_GET_VARS["$wpvar"];
$$wpvar = $_GET["$wpvar"];
}
} else {
$$wpvar = $HTTP_POST_VARS["$wpvar"];
$$wpvar = $_POST["$wpvar"];
}
}
}
$link_url = stripslashes($HTTP_GET_VARS['linkurl']);
$link_name = htmlentities(stripslashes(urldecode($HTTP_GET_VARS['name'])));
$link_url = stripslashes($_GET['linkurl']);
$link_name = htmlentities(stripslashes(urldecode($_GET['name'])));

require('admin-header.php');
?>
Expand Down
6 changes: 3 additions & 3 deletions wp-admin/link-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$title = 'Import Blogroll';
$this_file = 'link-import.php';

$step = $HTTP_POST_VARS['step'];
$step = $_POST['step'];
if (!$step) $step = 0;
?>
<?php
Expand Down Expand Up @@ -88,12 +88,12 @@

<h2>Importing...</h2>
<?php
$cat_id = $HTTP_POST_VARS['cat_id'];
$cat_id = $_POST['cat_id'];
if (($cat_id == '') || ($cat_id == 0)) {
$cat_id = 1;
}

$opml_url = $HTTP_POST_VARS['opml_url'];
$opml_url = $_POST['opml_url'];
if (isset($opml_url) && $opml_url != '') {
$blogrolling = true;
}
Expand Down
Loading

0 comments on commit 10c6b7e

Please sign in to comment.