Make WordPress Core

Ticket #592: redirect.diff

File redirect.diff, 4.1 KB (added by solvingnormal, 17 years ago)
  • wp-pass.php

     
    77// 10 days
    88setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
    99
    10 header('Location: ' . $_SERVER['HTTP_REFERER']);
    11 
     10wp_redirect($_SERVER['HTTP_REFERER']);
    1211?>
     12 No newline at end of file
  • wp-login.php

     
    184184                                wp_setcookie($user_login, $user_pass);
    185185                        }
    186186                        do_action('wp_login', $user_login);
    187                         header("Location: $redirect_to");
     187                        wp_redirect($redirect_to);
    188188                        exit();
    189189                } else {
    190190                        if ($using_cookie)                     
  • wp-comments-post.php

     
    5252
    5353$location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
    5454
    55 header("Location: $location");
    56 
     55wp_redirect($location);
    5756?>
     57 No newline at end of file
  • wp-includes/functions.php

     
    17111711}
    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;
    17161729
  • wp-includes/vars.php

     
    3535
    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
    4041if (!isset($wpsmiliestrans)) {
  • wp-admin/options.php

     
    8484                $referred = remove_query_arg('updated' , $_SERVER['HTTP_REFERER']);
    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
    9090default:
  • wp-admin/profile.php

     
    8686
    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
    9292case 'IErightclick':
  • wp-admin/link-manager.php

     
    243243          WHERE link_id=$link_id");
    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
    249249
     
    267267    }
    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
    273273