Make WordPress Core

Changeset 2436


Ignore:
Timestamp:
03/13/2005 04:36:09 PM (20 years ago)
Author:
ryan
Message:

Introducing wp_redirect(), first cut. http://mosquito.wordpress.org/view.php?id=592 Props: Toby Simmons

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/link-manager.php

    r2376 r2436  
    244244    } // end if save
    245245    setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
    246     header('Location: ' . $this_file);
     246    wp_redirect($this_file);
    247247    break;
    248248  } // end Save
     
    268268    $links_show_cat_id = $cat_id;
    269269    setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
    270     header('Location: '.$this_file);
     270    wp_redirect($this_file);
    271271    break;
    272272  } // end Delete
  • trunk/wp-admin/options.php

    r2322 r2436  
    8585        $goback = add_query_arg('updated', 'true', $_SERVER['HTTP_REFERER']);
    8686        $goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
    87     header('Location: ' . $goback);
     87        wp_redirect($goback);
    8888    break;
    8989
  • trunk/wp-admin/profile.php

    r2425 r2436  
    8787    $result = $wpdb->query("UPDATE $wpdb->users SET user_firstname='$newuser_firstname', $updatepassword user_lastname='$newuser_lastname', user_nickname='$newuser_nickname', user_icq='$newuser_icq', user_email='$newuser_email', user_url='$newuser_url', user_aim='$newuser_aim', user_msn='$newuser_msn', user_yim='$newuser_yim', user_idmode='$newuser_idmode', user_description = '$user_description', user_nicename = '$newuser_nicename' WHERE ID = $user_ID");
    8888
    89     header('Location: profile.php?updated=true');
     89    wp_redirect('profile.php?updated=true');
    9090break;
    9191
  • trunk/wp-comments-post.php

    r2431 r2436  
    5353$location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
    5454
    55 header("Location: $location");
    56 
     55wp_redirect($location);
    5756?>
  • trunk/wp-includes/functions.php

    r2432 r2436  
    17121712endif;
    17131713
     1714// Cookie safe redirect.  Works around IIS Set-Cookie bug.
     1715// http://support.microsoft.com/kb/q176113/
     1716if ( !function_exists('wp_redirect') ) :
     1717function wp_redirect($location) {
     1718    global $is_IIS;
     1719
     1720    if ($is_IIS)
     1721        header("Refresh: 0;url=$location");
     1722    else
     1723        header("Location: $location");
     1724}
     1725endif;
     1726
    17141727function is_plugin_page() {
    17151728    global $plugin_page;
  • trunk/wp-includes/vars.php

    r2240 r2436  
    3636// Server detection
    3737$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
     38$is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0;
    3839
    3940// if the config file does not provide the smilies array, let's define it here
  • trunk/wp-login.php

    r2425 r2436  
    185185            }
    186186            do_action('wp_login', $user_login);
    187             header("Location: $redirect_to");
     187            wp_redirect($redirect_to);
    188188            exit();
    189189        } else {
  • trunk/wp-pass.php

    r1964 r2436  
    88setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
    99
    10 header('Location: ' . $_SERVER['HTTP_REFERER']);
    11 
     10wp_redirect($_SERVER['HTTP_REFERER']);
    1211?>
Note: See TracChangeset for help on using the changeset viewer.