Changeset 1108 for trunk/wp-admin/post.php
- Timestamp:
- 04/20/2004 10:56:47 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r1106 r1108 16 16 17 17 if (!get_magic_quotes_gpc()) { 18 $ HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS);19 $ HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS);20 $ HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS);18 $_GET = add_magic_quotes($_GET); 19 $_POST = add_magic_quotes($_POST); 20 $_COOKIE = add_magic_quotes($_COOKIE); 21 21 } 22 22 … … 26 26 $wpvar = $wpvarstoreset[$i]; 27 27 if (!isset($$wpvar)) { 28 if (empty($ HTTP_POST_VARS["$wpvar"])) {29 if (empty($ HTTP_GET_VARS["$wpvar"])) {28 if (empty($_POST["$wpvar"])) { 29 if (empty($_GET["$wpvar"])) { 30 30 $$wpvar = ''; 31 31 } else { 32 $$wpvar = $ HTTP_GET_VARS["$wpvar"];32 $$wpvar = $_GET["$wpvar"]; 33 33 } 34 34 } else { 35 $$wpvar = $ HTTP_POST_VARS["$wpvar"];35 $$wpvar = $_POST["$wpvar"]; 36 36 } 37 37 } … … 59 59 require_once('admin-header.php'); 60 60 61 $post_pingback = intval($ HTTP_POST_VARS['post_pingback']);62 $content = balanceTags($ HTTP_POST_VARS['content']);61 $post_pingback = intval($_POST['post_pingback']); 62 $content = balanceTags($_POST['content']); 63 63 $content = format_to_post($content); 64 $excerpt = balanceTags($ HTTP_POST_VARS['excerpt']);64 $excerpt = balanceTags($_POST['excerpt']); 65 65 $excerpt = format_to_post($excerpt); 66 $post_title = addslashes($ HTTP_POST_VARS['post_title']);67 $post_categories = $ HTTP_POST_VARS['post_category'];66 $post_title = addslashes($_POST['post_title']); 67 $post_categories = $_POST['post_category']; 68 68 if(get_settings('use_geo_positions')) { 69 $latstr = $ HTTP_POST_VARS['post_latf'];70 $lonstr = $ HTTP_POST_VARS['post_lonf'];69 $latstr = $_POST['post_latf']; 70 $lonstr = $_POST['post_lonf']; 71 71 if((strlen($latstr) > 2) && (strlen($lonstr) > 2 ) ) { 72 $post_latf = floatval($ HTTP_POST_VARS['post_latf']);73 $post_lonf = floatval($ HTTP_POST_VARS['post_lonf']);72 $post_latf = floatval($_POST['post_latf']); 73 $post_lonf = floatval($_POST['post_lonf']); 74 74 } 75 75 } 76 $post_status = $ HTTP_POST_VARS['post_status'];76 $post_status = $_POST['post_status']; 77 77 if (empty($post_status)) $post_status = get_settings('default_post_status'); 78 $comment_status = $ HTTP_POST_VARS['comment_status'];78 $comment_status = $_POST['comment_status']; 79 79 if (empty($comment_status)) $comment_status = get_settings('default_comment_status'); 80 $ping_status = $ HTTP_POST_VARS['ping_status'];80 $ping_status = $_POST['ping_status']; 81 81 if (empty($ping_status)) $ping_status = get_settings('default_ping_status'); 82 $post_password = addslashes(stripslashes($ HTTP_POST_VARS['post_password']));82 $post_password = addslashes(stripslashes($_POST['post_password'])); 83 83 $post_name = sanitize_title($post_title); 84 $trackback = $ HTTP_POST_VARS['trackback_url'];84 $trackback = $_POST['trackback_url']; 85 85 // Format trackbacks 86 86 $trackback = preg_replace('|\s+|', '\n', $trackback); … … 89 89 die (__('Cheatin’ uh?')); 90 90 91 if (($user_level > 4) && (!empty($ HTTP_POST_VARS['edit_date']))) {92 $aa = $ HTTP_POST_VARS['aa'];93 $mm = $ HTTP_POST_VARS['mm'];94 $jj = $ HTTP_POST_VARS['jj'];95 $hh = $ HTTP_POST_VARS['hh'];96 $mn = $ HTTP_POST_VARS['mn'];97 $ss = $ HTTP_POST_VARS['ss'];91 if (($user_level > 4) && (!empty($_POST['edit_date']))) { 92 $aa = $_POST['aa']; 93 $mm = $_POST['mm']; 94 $jj = $_POST['jj']; 95 $hh = $_POST['hh']; 96 $mn = $_POST['mn']; 97 $ss = $_POST['ss']; 98 98 $jj = ($jj > 31) ? 31 : $jj; 99 99 $hh = ($hh > 23) ? $hh - 24 : $hh; … … 107 107 } 108 108 109 if (!empty($ HTTP_POST_VARS['mode'])) {110 switch($ HTTP_POST_VARS['mode']) {109 if (!empty($_POST['mode'])) { 110 switch($_POST['mode']) { 111 111 case 'bookmarklet': 112 112 $location = 'bookmarklet.php?a=b'; … … 124 124 125 125 // What to do based on which button they pressed 126 if ('' != $ HTTP_POST_VARS['saveasdraft']) $post_status = 'draft';127 if ('' != $ HTTP_POST_VARS['saveasprivate']) $post_status = 'private';128 if ('' != $ HTTP_POST_VARS['publish']) $post_status = 'publish';129 if ('' != $ HTTP_POST_VARS['advanced']) $post_status = 'draft';126 if ('' != $_POST['saveasdraft']) $post_status = 'draft'; 127 if ('' != $_POST['saveasprivate']) $post_status = 'private'; 128 if ('' != $_POST['publish']) $post_status = 'publish'; 129 if ('' != $_POST['advanced']) $post_status = 'draft'; 130 130 131 131 … … 148 148 $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); 149 149 150 if ('' != $ HTTP_POST_VARS['advanced'])150 if ('' != $_POST['advanced']) 151 151 $location = "post.php?action=edit&post=$post_ID"; 152 152 … … 220 220 require_once('admin-header.php'); 221 221 222 $post = $ HTTP_GET_VARS['post'];222 $post = $_GET['post']; 223 223 if ($user_level > 0) { 224 224 $postdata = get_postdata($post); … … 278 278 $blog_ID = 1; 279 279 } 280 $post_ID = $ HTTP_POST_VARS['post_ID'];281 $post_categories = $ HTTP_POST_VARS['post_category'];280 $post_ID = $_POST['post_ID']; 281 $post_categories = $_POST['post_category']; 282 282 if (!$post_categories) $post_categories[] = 1; 283 $post_autobr = intval($ HTTP_POST_VARS['post_autobr']);284 $content = balanceTags($ HTTP_POST_VARS['content']);283 $post_autobr = intval($_POST['post_autobr']); 284 $content = balanceTags($_POST['content']); 285 285 $content = format_to_post($content); 286 $excerpt = balanceTags($ HTTP_POST_VARS['excerpt']);286 $excerpt = balanceTags($_POST['excerpt']); 287 287 $excerpt = format_to_post($excerpt); 288 $post_title = addslashes($ HTTP_POST_VARS['post_title']);288 $post_title = addslashes($_POST['post_title']); 289 289 if(get_settings('use_geo_positions')) { 290 $latf = floatval($ HTTP_POST_VARS["post_latf"]);291 $lonf = floatval($ HTTP_POST_VARS["post_lonf"]);290 $latf = floatval($_POST["post_latf"]); 291 $lonf = floatval($_POST["post_lonf"]); 292 292 $latlonaddition = ""; 293 293 if( ($latf != null) && ($latf <= 90 ) && ($latf >= -90) && ($lonf != null) && ($lonf <= 360) && ($lonf >= -360) ) { … … 298 298 } 299 299 } 300 $prev_status = $ HTTP_POST_VARS['prev_status'];301 $post_status = $ HTTP_POST_VARS['post_status'];302 $comment_status = $ HTTP_POST_VARS['comment_status'];300 $prev_status = $_POST['prev_status']; 301 $post_status = $_POST['post_status']; 302 $comment_status = $_POST['comment_status']; 303 303 if (empty($comment_status)) $comment_status = get_settings('default_comment_status'); 304 $ping_status = $ HTTP_POST_VARS['ping_status'];304 $ping_status = $_POST['ping_status']; 305 305 if (empty($ping_status)) $ping_status = get_settings('default_ping_status'); 306 $post_password = addslashes($ HTTP_POST_VARS['post_password']);306 $post_password = addslashes($_POST['post_password']); 307 307 $post_name = sanitize_title($_POST['post_name']); 308 308 if (empty($post_name)) $post_name = sanitize_title($post_title); 309 $trackback = $ HTTP_POST_VARS['trackback_url'];309 $trackback = $_POST['trackback_url']; 310 310 // Format trackbacks 311 311 $trackback = preg_replace('|\s+|', '\n', $trackback); 312 312 313 if ('' != $ HTTP_POST_VARS['publish']) $post_status = 'publish';314 315 if (($user_level > 4) && (!empty($ HTTP_POST_VARS['edit_date']))) {316 $aa = $ HTTP_POST_VARS['aa'];317 $mm = $ HTTP_POST_VARS['mm'];318 $jj = $ HTTP_POST_VARS['jj'];319 $hh = $ HTTP_POST_VARS['hh'];320 $mn = $ HTTP_POST_VARS['mn'];321 $ss = $ HTTP_POST_VARS['ss'];313 if ('' != $_POST['publish']) $post_status = 'publish'; 314 315 if (($user_level > 4) && (!empty($_POST['edit_date']))) { 316 $aa = $_POST['aa']; 317 $mm = $_POST['mm']; 318 $jj = $_POST['jj']; 319 $hh = $_POST['hh']; 320 $mn = $_POST['mn']; 321 $ss = $_POST['ss']; 322 322 $jj = ($jj > 31) ? 31 : $jj; 323 323 $hh = ($hh > 23) ? $hh - 24 : $hh; … … 400 400 add_meta($post_ID); 401 401 402 if ($ HTTP_POST_VARS['save']) {403 $location = $ HTTP_SERVER_VARS['HTTP_REFERER'];402 if ($_POST['save']) { 403 $location = $_SERVER['HTTP_REFERER']; 404 404 } else { 405 405 $location = 'post.php'; … … 417 417 die ('Cheatin’ uh?'); 418 418 419 $post_id = intval($ HTTP_GET_VARS['post']);419 $post_id = intval($_GET['post']); 420 420 $postdata = get_postdata($post_id) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'post.php')); 421 421 $authordata = get_userdata($postdata['Author_ID']); … … 445 445 } 446 446 447 $sendback = $ HTTP_SERVER_VARS['HTTP_REFERER'];447 $sendback = $_SERVER['HTTP_REFERER']; 448 448 if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; 449 449 header ('Location: ' . $sendback); … … 463 463 } 464 464 465 $comment = $ HTTP_GET_VARS['comment'];465 $comment = $_GET['comment']; 466 466 $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)')); 467 467 $content = $commentdata['comment_content']; … … 480 480 die (__('Cheatin’ uh?')); 481 481 482 $comment = $ HTTP_GET_VARS['comment'];483 $p = $ HTTP_GET_VARS['p'];482 $comment = $_GET['comment']; 483 $p = $_GET['p']; 484 484 $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 485 485 … … 516 516 517 517 518 $comment = $ HTTP_GET_VARS['comment'];519 $p = $ HTTP_GET_VARS['p'];520 if (isset($ HTTP_GET_VARS['noredir'])) {518 $comment = $_GET['comment']; 519 $p = $_GET['p']; 520 if (isset($_GET['noredir'])) { 521 521 $noredir = true; 522 522 } else { … … 534 534 do_action('delete_comment', $comment); 535 535 536 if (($ HTTP_SERVER_VARS['HTTP_REFERER'] != "") && (false == $noredir)) {537 header('Location: ' . $ HTTP_SERVER_VARS['HTTP_REFERER']);536 if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { 537 header('Location: ' . $_SERVER['HTTP_REFERER']); 538 538 } else { 539 539 header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); … … 550 550 die (__('Cheatin’ uh?')); 551 551 552 $comment = $ HTTP_GET_VARS['comment'];553 $p = $ HTTP_GET_VARS['p'];554 if (isset($ HTTP_GET_VARS['noredir'])) {552 $comment = $_GET['comment']; 553 $p = $_GET['p']; 554 if (isset($_GET['noredir'])) { 555 555 $noredir = true; 556 556 } else { … … 562 562 wp_set_comment_status($comment, "hold"); 563 563 564 if (($ HTTP_SERVER_VARS['HTTP_REFERER'] != "") && (false == $noredir)) {565 header('Location: ' . $ HTTP_SERVER_VARS['HTTP_REFERER']);564 if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { 565 header('Location: ' . $_SERVER['HTTP_REFERER']); 566 566 } else { 567 567 header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); … … 578 578 die (__('Cheatin’ uh?')); 579 579 580 $comment = $ HTTP_GET_VARS['comment'];581 $p = $ HTTP_GET_VARS['p'];580 $comment = $_GET['comment']; 581 $p = $_GET['p']; 582 582 $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 583 583 … … 607 607 die (__('Cheatin’ uh?')); 608 608 609 $comment = $ HTTP_GET_VARS['comment'];610 $p = $ HTTP_GET_VARS['p'];611 if (isset($ HTTP_GET_VARS['noredir'])) {609 $comment = $_GET['comment']; 610 $p = $_GET['p']; 611 if (isset($_GET['noredir'])) { 612 612 $noredir = true; 613 613 } else { … … 622 622 623 623 624 if (($ HTTP_SERVER_VARS['HTTP_REFERER'] != "") && (false == $noredir)) {625 header('Location: ' . $ HTTP_SERVER_VARS['HTTP_REFERER']);624 if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) { 625 header('Location: ' . $_SERVER['HTTP_REFERER']); 626 626 } else { 627 627 header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); … … 638 638 die (__('Cheatin’ uh?')); 639 639 640 $comment_ID = $ HTTP_POST_VARS['comment_ID'];641 $comment_post_ID = $ HTTP_POST_VARS['comment_post_ID'];642 $newcomment_author = $ HTTP_POST_VARS['newcomment_author'];643 $newcomment_author_email = $ HTTP_POST_VARS['newcomment_author_email'];644 $newcomment_author_url = $ HTTP_POST_VARS['newcomment_author_url'];640 $comment_ID = $_POST['comment_ID']; 641 $comment_post_ID = $_POST['comment_post_ID']; 642 $newcomment_author = $_POST['newcomment_author']; 643 $newcomment_author_email = $_POST['newcomment_author_email']; 644 $newcomment_author_url = $_POST['newcomment_author_url']; 645 645 $newcomment_author = addslashes($newcomment_author); 646 646 $newcomment_author_email = addslashes($newcomment_author_email); 647 647 $newcomment_author_url = addslashes($newcomment_author_url); 648 648 649 if (($user_level > 4) && (!empty($ HTTP_POST_VARS['edit_date']))) {650 $aa = $ HTTP_POST_VARS['aa'];651 $mm = $ HTTP_POST_VARS['mm'];652 $jj = $ HTTP_POST_VARS['jj'];653 $hh = $ HTTP_POST_VARS['hh'];654 $mn = $ HTTP_POST_VARS['mn'];655 $ss = $ HTTP_POST_VARS['ss'];649 if (($user_level > 4) && (!empty($_POST['edit_date']))) { 650 $aa = $_POST['aa']; 651 $mm = $_POST['mm']; 652 $jj = $_POST['jj']; 653 $hh = $_POST['hh']; 654 $mn = $_POST['mn']; 655 $ss = $_POST['ss']; 656 656 $jj = ($jj > 31) ? 31 : $jj; 657 657 $hh = ($hh > 23) ? $hh - 24 : $hh; … … 674 674 ); 675 675 676 $referredby = $ HTTP_POST_VARS['referredby'];676 $referredby = $_POST['referredby']; 677 677 if (!empty($referredby)) header('Location: ' . $referredby); 678 678 else header ("Location: edit.php?p=$comment_post_ID&c=1#comments");
Note: See TracChangeset
for help on using the changeset viewer.