Make WordPress Core


Ignore:
Timestamp:
04/20/2004 10:56:47 PM (21 years ago)
Author:
saxmatt
Message:

Changed to superglobals, and eliminated $use_cache (since we always do).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r1106 r1108  
    1616
    1717if (!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);
    2121}
    2222
     
    2626    $wpvar = $wpvarstoreset[$i];
    2727    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"])) {
    3030                $$wpvar = '';
    3131            } else {
    32                 $$wpvar = $HTTP_GET_VARS["$wpvar"];
     32                $$wpvar = $_GET["$wpvar"];
    3333            }
    3434        } else {
    35             $$wpvar = $HTTP_POST_VARS["$wpvar"];
     35            $$wpvar = $_POST["$wpvar"];
    3636        }
    3737    }
     
    5959            require_once('admin-header.php');
    6060
    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']);
    6363            $content = format_to_post($content);
    64             $excerpt = balanceTags($HTTP_POST_VARS['excerpt']);
     64            $excerpt = balanceTags($_POST['excerpt']);
    6565            $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'];
    6868            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'];
    7171                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']);
    7474                }
    7575            }
    76             $post_status = $HTTP_POST_VARS['post_status'];
     76            $post_status = $_POST['post_status'];
    7777            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'];
    7979            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'];
    8181            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']));
    8383            $post_name = sanitize_title($post_title);
    84             $trackback = $HTTP_POST_VARS['trackback_url'];
     84            $trackback = $_POST['trackback_url'];
    8585        // Format trackbacks
    8686        $trackback = preg_replace('|\s+|', '\n', $trackback);
     
    8989            die (__('Cheatin’ uh?'));
    9090
    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'];
    9898            $jj = ($jj > 31) ? 31 : $jj;
    9999            $hh = ($hh > 23) ? $hh - 24 : $hh;
     
    107107        }
    108108
    109         if (!empty($HTTP_POST_VARS['mode'])) {
    110         switch($HTTP_POST_VARS['mode']) {
     109        if (!empty($_POST['mode'])) {
     110        switch($_POST['mode']) {
    111111            case 'bookmarklet':
    112112                $location = 'bookmarklet.php?a=b';
     
    124124
    125125        // 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';
    130130
    131131
     
    148148        $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
    149149
    150         if ('' != $HTTP_POST_VARS['advanced'])
     150        if ('' != $_POST['advanced'])
    151151            $location = "post.php?action=edit&post=$post_ID";
    152152
     
    220220        require_once('admin-header.php');
    221221
    222         $post = $HTTP_GET_VARS['post'];
     222        $post = $_GET['post'];
    223223        if ($user_level > 0) {
    224224            $postdata = get_postdata($post);
     
    278278            $blog_ID = 1;
    279279        }
    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'];
    282282            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']);
    285285            $content = format_to_post($content);
    286             $excerpt = balanceTags($HTTP_POST_VARS['excerpt']);
     286            $excerpt = balanceTags($_POST['excerpt']);
    287287            $excerpt = format_to_post($excerpt);
    288             $post_title = addslashes($HTTP_POST_VARS['post_title']);
     288            $post_title = addslashes($_POST['post_title']);
    289289            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"]);
    292292                    $latlonaddition = "";
    293293                    if( ($latf != null) && ($latf <= 90 ) && ($latf >= -90) && ($lonf != null) && ($lonf <= 360) && ($lonf >= -360) ) {
     
    298298                }
    299299            }
    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'];
    303303            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'];
    305305            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']);
    307307            $post_name = sanitize_title($_POST['post_name']);
    308308            if (empty($post_name)) $post_name = sanitize_title($post_title);
    309             $trackback = $HTTP_POST_VARS['trackback_url'];
     309            $trackback = $_POST['trackback_url'];
    310310        // Format trackbacks
    311311        $trackback = preg_replace('|\s+|', '\n', $trackback);
    312312       
    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'];
    322322            $jj = ($jj > 31) ? 31 : $jj;
    323323            $hh = ($hh > 23) ? $hh - 24 : $hh;
     
    400400        add_meta($post_ID);
    401401
    402         if ($HTTP_POST_VARS['save']) {
    403             $location = $HTTP_SERVER_VARS['HTTP_REFERER'];
     402        if ($_POST['save']) {
     403            $location = $_SERVER['HTTP_REFERER'];
    404404        } else {
    405405            $location = 'post.php';
     
    417417            die ('Cheatin&#8217; uh?');
    418418
    419         $post_id = intval($HTTP_GET_VARS['post']);
     419        $post_id = intval($_GET['post']);
    420420        $postdata = get_postdata($post_id) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'post.php'));
    421421        $authordata = get_userdata($postdata['Author_ID']);
     
    445445        }
    446446
    447         $sendback = $HTTP_SERVER_VARS['HTTP_REFERER'];
     447        $sendback = $_SERVER['HTTP_REFERER'];
    448448        if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php';
    449449        header ('Location: ' . $sendback);
     
    463463        }
    464464
    465         $comment = $HTTP_GET_VARS['comment'];
     465        $comment = $_GET['comment'];
    466466        $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)'));
    467467        $content = $commentdata['comment_content'];
     
    480480        die (__('Cheatin&#8217; uh?'));
    481481   
    482     $comment = $HTTP_GET_VARS['comment'];
    483     $p = $HTTP_GET_VARS['p'];
     482    $comment = $_GET['comment'];
     483    $p = $_GET['p'];
    484484    $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    485485   
     
    516516
    517517
    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'])) {
    521521        $noredir = true;
    522522    } else {
     
    534534    do_action('delete_comment', $comment);
    535535
    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']);
    538538    } else {
    539539        header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
     
    550550        die (__('Cheatin&#8217; uh?'));
    551551       
    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'])) {
    555555        $noredir = true;
    556556    } else {
     
    562562    wp_set_comment_status($comment, "hold");
    563563   
    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']);
    566566    } else {
    567567        header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
     
    578578        die (__('Cheatin&#8217; uh?'));
    579579   
    580     $comment = $HTTP_GET_VARS['comment'];
    581     $p = $HTTP_GET_VARS['p'];
     580    $comment = $_GET['comment'];
     581    $p = $_GET['p'];
    582582    $commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    583583
     
    607607        die (__('Cheatin&#8217; uh?'));
    608608       
    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'])) {
    612612        $noredir = true;
    613613    } else {
     
    622622   
    623623     
    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']);
    626626    } else {
    627627        header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
     
    638638            die (__('Cheatin&#8217; uh?'));
    639639
    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'];
    645645        $newcomment_author = addslashes($newcomment_author);
    646646        $newcomment_author_email = addslashes($newcomment_author_email);
    647647        $newcomment_author_url = addslashes($newcomment_author_url);
    648648
    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'];
    656656            $jj = ($jj > 31) ? 31 : $jj;
    657657            $hh = ($hh > 23) ? $hh - 24 : $hh;
     
    674674            );
    675675
    676         $referredby = $HTTP_POST_VARS['referredby'];
     676        $referredby = $_POST['referredby'];
    677677        if (!empty($referredby)) header('Location: ' . $referredby);
    678678        else header ("Location: edit.php?p=$comment_post_ID&c=1#comments");
Note: See TracChangeset for help on using the changeset viewer.