Make WordPress Core

Changeset 1239


Ignore:
Timestamp:
05/07/2004 11:56:33 PM (22 years ago)
Author:
saxmatt
Message:

E_ALL fixes and cleanups.

Location:
trunk
Files:
16 edited

Legend:

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

    r1204 r1239  
    33
    44$title = __('Categories');
    5 /* <Categories> */
    65
    76function add_magic_quotes($array) {
     
    145144$messages[3] = __('Category updated.');
    146145?>
    147 <?php if ($_GET['message']) : ?>
     146<?php if (isset($_GET['message'])) : ?>
    148147<div class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
    149148<?php endif; ?>
     
    194193}
    195194
    196 /* </Categories> */
    197195include('admin-footer.php');
    198196?>
  • trunk/wp-admin/edit-comments.php

    r1131 r1239  
    3232  <fieldset>
    3333  <legend><?php _e('Show Comments That Contain...') ?></legend>
    34   <input type="text" name="s" value="<?php echo $s; ?>" size="17" />
     34  <input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
    3535  <input type="submit" name="submit" value="<?php _e('Search') ?>"  /> 
    3636  <input type="hidden" name="mode" value="<?php echo $mode; ?>" />
  • trunk/wp-admin/edit-form.php

    r1233 r1239  
    1919    $form_trackback = '<p><label for="trackback">' . sprintf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') .
    2020    '<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>';
    21     if ('' != $pinged) {
    22         $form_trackback .= '<p>' . __('Already pinged:') . '</p><ul>';
    23         $already_pinged = explode("\n", trim($pinged));
    24         foreach ($already_pinged as $pinged_url) {
    25             $form_trackback .= "\n\t<li>$pinged_url</li>";
    26         }
    27         $form_trackback .= '</ul>';
    28     }
    2921} else {
    3022    $form_trackback = '';
     
    3931
    4032<?php
    41 if ('bookmarklet' == $mode) {
     33if (isset($mode) && 'bookmarklet' == $mode) {
    4234    echo '<input type="hidden" name="mode" value="bookmarklet" />';
    4335}
     
    9991
    10092<?php echo $form_pingback ?>
    101 <?php echo $form_prevstatus ?>
    10293<?php echo $form_trackback; ?>
    10394<p><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
  • trunk/wp-admin/edit.php

    r1213 r1239  
    7171  <fieldset>
    7272  <legend><?php _e('Show Posts That Contain...') ?></legend>
    73   <input type="text" name="s" value="<?php echo $s; ?>" size="17" />
     73  <input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
    7474  <input type="submit" name="submit" value="<?php _e('Search') ?>"  />
    7575  </fieldset>
  • trunk/wp-admin/moderation.php

    r1163 r1239  
    104104</ul>
    105105<?php
    106 $ignored = $_GET['ignored'];
    107 $deleted = $_GET['deleted'];
    108 $approved = $_GET['approved'];
    109106
    110 if (($deleted) || ($approved) || ($ignored)) {
     107if (isset($deleted) || isset($approved) || isset($ignored)) {
    111108    echo "<div class='updated'>\n<p>";
    112109    if ($approved) {
  • trunk/wp-admin/options-head.php

    r1193 r1239  
    22
    33if ($user_level <= 6) {
    4     die(__("You have do not have sufficient permissions to edit the options for this blog."));
     4    die( __('You have do not have sufficient permissions to edit the options for this blog.') );
    55}
    66
    77//we need to iterate through the available option groups.
     8$groups = '';
    89$option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $tableoptiongroups ORDER BY group_id");
    910foreach ($option_groups as $option_group) {
     
    2930$_SERVER['REQUEST_URI'] = str_replace('?updated=true', '', $_SERVER['REQUEST_URI']);
    3031foreach ($sublines as $subline) {
    31     preg_match('/href="([^"]+)"/', $subline, $url);
    32     if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) {
    33         $subline = str_replace('a hr', 'a class="current" hr', $subline);
    34         if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) {
    35             $subline = preg_replace('|href=".*?"|', '', $subline);
     32    if (preg_match('/href="([^"]+)"/', $subline, $url)) {
     33        if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) {
     34            $subline = str_replace('a hr', 'a class="current" hr', $subline);
     35            if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) {
     36                $subline = preg_replace('|href=".*?"|', '', $subline);
     37            }
    3638        }
    3739    }
     
    4547<br clear="all" />
    4648
    47 <?php if ($updated) : ?>
     49<?php if (isset($updated)) : ?>
    4850<div class="updated"><p><strong><?php _e('Options saved.') ?></strong></p></div>
    4951<?php endif; ?>
  • trunk/wp-admin/plugins.php

    r1173 r1239  
    4747?>
    4848
    49 <?php if ($_GET['activate']) : ?>
     49<?php if (isset($_GET['activate'])) : ?>
    5050<div class="updated"><p><?php _e('Plugin <strong>activated</strong>.') ?></p>
    5151</div>
    5252<?php endif; ?>
    53 <?php if ($_GET['deactivate']) : ?>
     53<?php if (isset($_GET['deactivate'])) : ?>
    5454<div class="updated"><p><?php _e('Plugin <strong>deactivated</strong>.') ?></p>
    5555</div>
     
    8787<?php
    8888    sort($plugin_files); // Alphabetize by filename. Better way?
     89    $style = '';
    8990    foreach($plugin_files as $plugin_file) {
    9091        $plugin_data = implode('', file(ABSPATH . '/wp-content/plugins/' . $plugin_file));
     
    9495        preg_match("|Author:(.*)|i", $plugin_data, $author_name);
    9596        preg_match("|Author URI:(.*)|i", $plugin_data, $author_uri);
    96         preg_match("|Version:(.*)|i", $plugin_data, $version);
    97         $description = wptexturize(wp_filter_kses($description[1]));
     97        if ( preg_match("|Version:(.*)|i", $plugin_data, $version) )
     98            $version = $version[1];
     99        else
     100            $version ='';
     101
     102        $description = wptexturize($description[1]);
    98103
    99104        if ('' == $plugin_uri) {
    100105            $plugin = $plugin_name[1];
    101106        } else {
    102             $plugin = wp_filter_kses( __("<a href='{$plugin_uri[1]}' title='Visit plugin homepage'>{$plugin_name[1]}</a>") );
     107            $plugin = __("<a href='{$plugin_uri[1]}' title='Visit plugin homepage'>{$plugin_name[1]}</a>");
    103108        }
    104109
     
    106111            $author = $author_name[1];
    107112        } else {
    108             $author = wp_filter_kses( __("<a href='{$author_uri[1]}' title='Visit author homepage'>{$author_name[1]}</a>") );
     113            $author = __("<a href='{$author_uri[1]}' title='Visit author homepage'>{$author_name[1]}</a>");
    109114        }
    110115
     
    122127    <tr $style>
    123128        <td>$plugin</td>
    124         <td>{$version[1]}</td>
     129        <td>$version</td>
    125130        <td>$author</td>
    126131        <td>$description</td>
     
    137142
    138143<?php
    139 
    140144include('admin-footer.php');
    141145?>
  • trunk/wp-admin/post.php

    r1236 r1239  
    696696
    697697    if ($user_level > 0) {
    698         if ((!$withcomments) && (!$single)) {
    699 
    700             $action = 'post';
    701             get_currentuserinfo();
    702             $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID");
    703             if ($drafts) {
    704                 ?>
    705                 <div class="wrap">
    706                 <p><strong><?php _e('Your Drafts:') ?></strong>
    707                 <?php
    708                 $i = 0;
    709                 foreach ($drafts as $draft) {
    710                     if (0 != $i)
    711                         echo ', ';
    712                     $draft->post_title = stripslashes($draft->post_title);
    713                     if ($draft->post_title == '')
    714                         $draft->post_title = sprintf(__('Post # %s'), $draft->ID);
    715                     echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
    716                     ++$i;
    717                     }
    718                 ?>.</p>
    719                 </div>
    720                 <?php
    721             }
    722             //set defaults
    723             $post_status = get_settings('default_post_status');
    724             $comment_status = get_settings('default_comment_status');
    725             $ping_status = get_settings('default_ping_status');
    726             $post_pingback = get_settings('default_pingback_flag');
    727             $default_post_cat = get_settings('default_post_category');
    728 
    729             if (get_settings('advanced_edit')) {
    730                 include('edit-form-advanced.php');
    731             } else {
    732                 include('edit-form.php');
    733             }
     698        $action = 'post';
     699        get_currentuserinfo();
     700        $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID");
     701        if ($drafts) {
     702            ?>
     703            <div class="wrap">
     704            <p><strong><?php _e('Your Drafts:') ?></strong>
     705            <?php
     706            $i = 0;
     707            foreach ($drafts as $draft) {
     708                if (0 != $i)
     709                    echo ', ';
     710                $draft->post_title = stripslashes($draft->post_title);
     711                if ($draft->post_title == '')
     712                    $draft->post_title = sprintf(__('Post # %s'), $draft->ID);
     713                echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
     714                ++$i;
     715                }
     716            ?>.</p>
     717            </div>
     718            <?php
     719        }
     720        //set defaults
     721        $post_status = get_settings('default_post_status');
     722        $comment_status = get_settings('default_comment_status');
     723        $ping_status = get_settings('default_ping_status');
     724        $post_pingback = get_settings('default_pingback_flag');
     725        $default_post_cat = get_settings('default_post_category');
     726
     727        if (get_settings('advanced_edit')) {
     728            include('edit-form-advanced.php');
     729        } else {
     730            include('edit-form.php');
    734731        }
    735732?>
  • trunk/wp-admin/profile.php

    r1161 r1239  
    225225
    226226    ?>
    227 <?php if ($updated) { ?>
     227<?php if (isset($updated)) { ?>
    228228<div class="updated">
    229229<p><strong><?php _e('Profile updated.') ?></strong></p>
  • trunk/wp-admin/templates.php

    r1176 r1239  
    114114
    115115    ?>
    116 <?php if ('te' == $_GET['a']) : ?>
     116<?php if (isset($_GET['a'])) : ?>
    117117 <div class="updated"><p><?php _e('File edited successfully.') ?></p></div>
    118118<?php endif; ?>
  • trunk/wp-admin/users.php

    r1233 r1239  
    165165    include ('admin-header.php');
    166166    ?>
    167 <?php if ($_GET['deleted']) : ?>
     167<?php if (isset($_GET['deleted'])) : ?>
    168168<div class="updated"><p><?php _e('User deleted.') ?></p></div>
    169169<?php endif; ?>
     
    182182    <?php
    183183    $users = $wpdb->get_results("SELECT ID FROM $tableusers WHERE user_level > 0 ORDER BY ID");
     184    $style = '';
    184185    foreach ($users as $user) {
    185186        $user_data = get_userdata($user->ID);
  • trunk/wp-includes/functions-formatting.php

    r1150 r1239  
    224224function format_to_post($content) {
    225225    global $wpdb;
    226     $content = stripslashes(stripslashes($content));
    227226    $content = apply_filters('format_to_post', $content);
    228     $content = $wpdb->escape($content);
    229227    return $content;
    230228}
  • trunk/wp-includes/functions.php

    r1235 r1239  
    11<?php
    2 
    3 $curpath = dirname(__FILE__).'/';
    4 
    5 require($curpath . 'functions-formatting.php');
    62
    73if (!function_exists('_')) {
     
    846842    global $posts;
    847843
    848     if (empty($post_list)) {
    849         $post_list = $posts;
    850     }
    851 
    852     if (count($post_list) == 1) {
     844    if ($posts && 1 === count($posts)) {
    853845        // there's only one result  see if it has a geo code
    854         $row = $post_list[0];
     846        $row = $posts[0];
    855847        $lat = $row->post_lat;
    856848        $lon = $row->post_lon;
     
    865857        if(get_settings('use_default_geourl')) {
    866858            // send the default here
    867             echo "<meta name=\"ICBM\" content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
    868             echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")))."\" />\n";
    869             echo "<meta name=\"geo.position\" content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
     859            echo "<meta name='ICBM' content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
     860            echo "<meta name='DC.title' content=\"".convert_chars(strip_tags(get_bloginfo("name")))."\" />\n";
     861            echo "<meta name='geo.position' content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
    870862        }
    871863    }
  • trunk/wp-includes/template-functions-general.php

    r1235 r1239  
    485485function allowed_tags() {
    486486    global $allowedtags;
     487    $allowed = '';
    487488    foreach($allowedtags as $tag => $attributes) {
    488489        $allowed .= '<'.$tag;
  • trunk/wp-login.php

    r1203 r1239  
    121121        $user_login = $log;
    122122        $user_pass = $pwd;
    123         setcookie('wordpressuser_'.$cookiehash, $user_login, time()+31536000);
    124         setcookie('wordpresspass_'.$cookiehash, md5($user_pass), time()+31536000);
    125         if (empty($_COOKIE['wordpressblogid_'.$cookiehash])) {
    126             setcookie('wordpressblogid_'.$cookiehash, 1,time()+31536000);
    127         }
     123        setcookie('wordpressuser_'.$cookiehash, $user_login, time() + 31536000, COOKIEPATH);
     124        setcookie('wordpresspass_'.$cookiehash, md5($user_pass), time() + 31536000, COOKIEPATH);
     125
    128126        header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
    129127        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
  • trunk/wp-settings.php

    r1219 r1239  
    3838
    3939require (ABSPATH . WPINC . '/functions.php');
     40require (ABSPATH . WPINC . '/functions-formatting.php');
    4041require (ABSPATH . 'wp-config-extra.php');
    4142require (ABSPATH . WPINC . '/template-functions.php');
Note: See TracChangeset for help on using the changeset viewer.