Make WordPress Core

Changeset 1974


Ignore:
Timestamp:
12/18/2004 08:56:26 PM (20 years ago)
Author:
saxmatt
Message:

Some code cleanups.

Location:
trunk
Files:
4 edited

Legend:

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

    r1956 r1974  
    11<?php
    22require_once('admin.php');
    3 $title = __('Template &amp; file editing');
     3$title = __('Template &amp; File Editing');
    44$parent_file =  'edit.php';
    55
  • trunk/wp-comments-post.php

    r1968 r1974  
    4444$location = get_permalink($comment_post_ID);
    4545
    46 if ($is_IIS) {
    47     header("Refresh: 0;url=$location");
    48 } else {
    49     header("Location: $location");
    50 }
     46header("Location: $location");
    5147
    5248?>
  • trunk/wp-includes/vars.php

    r1965 r1974  
    108108// Server detection
    109109$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
    110 $is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0;
    111110
    112111// if the config file does not provide the smilies array, let's define it here
  • trunk/wp-login.php

    r1964 r1974  
    22require( dirname(__FILE__) . '/wp-config.php' );
    33
    4 $wpvarstoreset = array('action');
    5 
    6 for ($i = 0; $i < count($wpvarstoreset); $i = $i + 1) {
    7     $wpvar = $wpvarstoreset[$i];
    8     if (!isset($$wpvar)) {
    9         if (empty($_POST["$wpvar"])) {
    10             if (empty($_GET["$wpvar"])) {
    11                 $$wpvar = '';
    12             } else {
    13                 $$wpvar = $_GET["$wpvar"];
    14             }
    15         } else {
    16             $$wpvar = $_POST["$wpvar"];
    17         }
    18     }
    19 }
    20 
     4$action = $_REQUEST['action'];
    215$error = '';
    226
     
    3721    setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
    3822
    39     if ($is_IIS)
    40         header('Refresh: 0;url=wp-login.php');
    41     else
    42         header('Location: wp-login.php');
     23    header('Location: wp-login.php');
    4324    exit();
    4425
     
    129110    if( !empty($_POST) ) {
    130111        $user_login = $_POST['log'];
    131         $user_pass = $_POST['pwd'];
     112        $user_pass  = $_POST['pwd'];
    132113        $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_POST['redirect_to']);
    133114    } elseif ( !empty($_COOKIE) ) {
    134         if (! empty($_COOKIE['wordpressuser_' . COOKIEHASH]))
     115        if (! empty($_COOKIE['wordpressuser_' . COOKIEHASH]) )
    135116            $user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
    136         if (! empty($_COOKIE['wordpresspass_' . COOKIEHASH])) {
     117        if (! empty($_COOKIE['wordpresspass_' . COOKIEHASH]) ) {
    137118            $user_pass = $_COOKIE['wordpresspass_' . COOKIEHASH];
    138119            $using_cookie = true;
     
    142123   
    143124    $user = get_userdatabylogin($user_login);
    144     if (0 == $user->user_level) {
     125    if ( 0 == $user->user_level )
    145126        $redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
    146     }
    147127
    148128    if ($user_login && $user_pass) {
     
    154134            }
    155135
    156             if ($is_IIS)
    157                 header("Refresh: 0;url=$redirect_to");
    158             else
    159                 header("Location: $redirect_to");
     136            header("Location: $redirect_to");
    160137            exit();
    161138        } else {
     
    164141        }
    165142    }
    166 
    167     ?>
     143    if ( isset($_REQUEST['redirect_to']) )
     144        $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_REQUEST['redirect_to']);
     145?>
    168146<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    169147<html xmlns="http://www.w3.org/1999/xhtml">
     
    174152    <script type="text/javascript">
    175153    function focusit() {
    176         // focus on first input field
    177154        document.getElementById('log').focus();
    178155    }
     
    185162<h1><a href="http://wordpress.org/">WordPress</a></h1>
    186163<?php
    187 if ($error)
     164if ( $error )
    188165    echo "<div id='login_error'>$error</div>";
    189166?>
     
    192169<p><label><?php _e('Login') ?>: <input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label></p>
    193170<p><label><?php _e('Password') ?>: <input type="password" name="pwd" value="" size="20" tabindex="2" /></label></p>
    194 <p class="submit"><input type="submit" name="submit" value="<?php _e('Login'); ?> &raquo;" tabindex="3" />
    195 <?php if (isset($_GET["redirect_to"])) { ?>
    196     <input type="hidden" name="redirect_to" value="<?php echo $_GET["redirect_to"] ?>" />
    197 <?php } else { ?>
    198     <input type="hidden" name="redirect_to" value="wp-admin/" />
    199 <?php } ?>
     171<p class="submit">
     172    <input type="submit" name="submit" value="<?php _e('Login'); ?> &raquo;" tabindex="3" />
     173    <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" />
    200174</p>
    201175</form>
Note: See TracChangeset for help on using the changeset viewer.