Changeset 1005

Show
Ignore:
Timestamp:
06/21/07 16:41:02 (1 year ago)
Author:
donncha
Message:

WP Merge to WP 2.2.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-db.php

    r987 r1005  
    8484        global $wpdb; 
    8585 
    86         extract($catarr); 
     86        extract($catarr, EXTR_SKIP); 
    8787 
    8888        if( trim( $cat_name ) == '' ) 
     
    125125        else 
    126126                $links_private = 0; 
    127  
    128  
    129         // Let's check if we have this category already, if so just do an update 
    130         if ( !$update && $cat_ID = category_object_exists( $category_nicename ) ) 
    131                 $update = true; 
    132127 
    133128        if (!$update) { 
     
    256251} 
    257252 
    258 function category_object_exists($cat_name) { 
    259         global $wpdb; 
    260         if (!$category_nicename = sanitize_title($cat_name)) 
    261                 return 0; 
    262  
    263         return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'"); 
    264 } 
    265  
    266253function category_exists($cat_name) { 
    267254        global $wpdb; 
     
    315302        global $wpdb, $current_user; 
    316303 
    317         extract($linkdata); 
     304        extract($linkdata, EXTR_SKIP); 
    318305 
    319306        $update = false; 
  • trunk/wp-admin/admin-footer.php

    r972 r1005  
    33<p class="logo"><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p> 
    44<p class="docs"><?php _e('<a href="http://codex.wordpress.org/">Documentation</a>'); ?> &#8212; <?php _e('<a href="http://wordpress.org/support/">Support Forums</a>'); ?><br /> 
    5 <?php printf( __('Version %s'), get_bloginfo('version') ); ?></p> 
     5<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), timer_stop(0, 2)); ?></p> 
    66</div> 
    77<?php do_action('admin_footer', ''); ?> 
  • trunk/wp-admin/admin-functions.php

    r989 r1005  
    348348 
    349349        $post->post_password = format_to_edit( $post->post_password ); 
     350         
     351        $post->menu_order = (int) $post->menu_order; 
    350352 
    351353        if ( $post->post_type == 'page' ) 
     
    397399function get_comment_to_edit( $id ) { 
    398400        $comment = get_comment( $id ); 
    399  
    400         $comment->comment_content = format_to_edit( $comment->comment_content, user_can_richedit() ); 
     401         
     402        $comment->comment_ID = (int) $comment->comment_ID; 
     403        $comment->comment_post_ID = (int) $comment->comment_post_ID; 
     404 
     405        $comment->comment_content = format_to_edit( $comment->comment_content ); 
    401406        $comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content); 
    402407 
    403408        $comment->comment_author = format_to_edit( $comment->comment_author ); 
    404409        $comment->comment_author_email = format_to_edit( $comment->comment_author_email ); 
     410        $comment->comment_author_url = clean_url($comment->comment_author_url); 
    405411        $comment->comment_author_url = format_to_edit( $comment->comment_author_url ); 
    406412 
     
    410416function get_category_to_edit( $id ) { 
    411417        $category = get_category( $id ); 
     418         
     419        $category->term_id = (int) $category->term_id; 
     420        $category->parent = (int) $category->parent; 
    412421 
    413422        return $category; 
     
    820829        $class = ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || " class='alternate'" == $class ) ? '' : " class='alternate'"; 
    821830 
    822         $category->category_count = number_format_i18n( $category->category_count ); 
    823         $category->link_count = number_format_i18n( $category->link_count ); 
     831        $category->category_count = number_format( $category->category_count ); 
     832        $category->link_count = number_format( $category->link_count ); 
    824833        $posts_count = ( $category->category_count > 0 ) ? "<a href='edit.php?cat=$category->cat_ID'>$category->category_count</a>" : $category->category_count; 
    825834        return "<tr id='cat-$category->cat_ID'$class> 
     
    949958if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    950959        echo " <a href='comment.php?action=editcomment&amp;c=".$comment->comment_ID."'>" .  __('Edit') . '</a>'; 
    951         echo ' | <a href="' . wp_nonce_url('ocomment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 
     960        echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; 
    952961        if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 
    953962                echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&amp;p=' . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; 
     
    10401049                $entry['meta_key']   = attribute_escape($entry['meta_key']); 
    10411050                $entry['meta_value'] = attribute_escape($entry['meta_value']); 
     1051                $entry['meta_id'] = (int) $entry['meta_id']; 
    10421052                $r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>"; 
    10431053                $r .= "\n\t\t<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>"; 
     
    10921102 
    10931103        foreach ( $keys as $key ) { 
    1094                 $key = attribute_escape( $key); 
     1104                $key = attribute_escape( $key ); 
    10951105                echo "\n\t<option value='$key'>$key</option>"; 
    10961106        } 
     
    11131123        $post_ID = (int) $post_ID; 
    11141124 
     1125        $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' ); 
     1126 
    11151127        $metakeyselect = $wpdb->escape( stripslashes( trim( $_POST['metakeyselect'] ) ) ); 
    11161128        $metakeyinput = $wpdb->escape( stripslashes( trim( $_POST['metakeyinput'] ) ) ); 
     
    11271139                if ( $metakeyinput) 
    11281140                        $metakey = $metakeyinput; // default 
     1141 
     1142                if ( in_array($metakey, $protected) ) 
     1143                        return false; 
    11291144 
    11301145                $result = $wpdb->query( " 
     
    11471162function update_meta( $mid, $mkey, $mvalue ) { 
    11481163        global $wpdb; 
     1164 
     1165        $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' ); 
     1166 
     1167        if ( in_array($mkey, $protected) ) 
     1168                return false; 
     1169 
    11491170        $mvalue = maybe_serialize( stripslashes( $mvalue )); 
    11501171        $mvalue = $wpdb->escape( $mvalue ); 
     
    13461367function page_template_dropdown( $default = '' ) { 
    13471368        $templates = get_page_templates(); 
    1348         ksort( $templates ); 
    13491369        foreach (array_keys( $templates ) as $template ) 
    13501370                : if ( $default == $templates[$template] ) 
     
    19461966                extract( $wp_filetype ); 
    19471967 
    1948                 if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' )
     1968                if ( !$type || !$ext
    19491969                        return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); 
    1950                  
    1951                 if ( !$ext ) 
    1952                         $ext = strrchr($file['name'], '.'); 
    19531970        } 
    19541971 
  • trunk/wp-admin/categories.php

    r972 r1005  
    119119 
    120120<?php include('edit-category-form.php'); ?> 
    121  
    122121<?php endif; ?> 
    123122 
  • trunk/wp-admin/comment.php

    r972 r1005  
    4040        $nonce_action .= $comment; 
    4141 
    42         if ( ! $comment = get_comment($comment) ) 
     42        if ( ! $comment = get_comment_to_edit($comment) ) 
    4343                wp_die(__('Oops, no comment with this ID.').sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php')); 
    4444 
     
    9292<tr> 
    9393<th scope="row"><?php _e('URL:'); ?></th> 
    94 <td><?php echo "<a href='$comment->comment_author_url'>$comment->comment_author_url</a>"; ?></td> 
     94<td><?php echo $comment->comment_author_url; ?></td> 
    9595</tr> 
    9696<?php } ?> 
    9797<tr> 
    9898<th scope="row" valign="top"><p><?php _e('Comment:'); ?></p></th> 
    99 <td><?php echo apply_filters( 'comment_text', $comment->comment_content ); ?></td> 
     99<td><?php echo $comment->comment_content; ?></td> 
    100100</tr> 
    101101</table> 
     
    156156                wp_redirect(wp_get_referer()); 
    157157        } else { 
    158                 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 
     158                wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='. (int) $comment->comment_post_ID.'&c=1#comments'); 
    159159        } 
    160160        exit(); 
     
    186186                wp_redirect(wp_get_referer()); 
    187187        } else { 
    188                 wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$comment->comment_post_ID.'&c=1#comments'); 
     188                wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='. (int) $comment->comment_post_ID.'&c=1#comments'); 
    189189        } 
    190190        exit(); 
  • trunk/wp-admin/edit-comments.php

    r976 r1005  
    158158?> 
    159159  <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'> 
    160     <td style="text-align: center"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 
     160    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 
    161161    <td><?php comment_author_link() ?></td> 
    162162    <td><?php comment_author_email_link() ?></td> 
  • trunk/wp-admin/edit-form-advanced.php

    r972 r1005  
    11<?php 
     2if ( isset($_GET['message']) ) 
     3          $_GET['message'] = (int) $_GET['message']; 
    24$messages[1] = __('Post updated'); 
    35$messages[2] = __('Custom field updated'); 
     
    57?> 
    68<?php if (isset($_GET['message'])) : ?> 
    7 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> 
     9<div id="message" class="updated fade"><p><?php echo wp_specialchars($messages[$_GET['message']]); ?></p></div> 
    810<?php endif; ?> 
    911 
     
    2224        wp_nonce_field('add-post'); 
    2325} else { 
     26        $post_ID = (int) $post_ID; 
    2427        $form_action = 'editpost'; 
    2528        $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 
     
    2730} 
    2831 
    29 $form_pingback = '<input type="hidden" name="post_pingback" value="' . get_option('default_pingback_flag') . '" id="post_pingback" />'; 
    30  
    31 $form_prevstatus = '<input type="hidden" name="prev_status" value="' . $post->post_status . '" />'; 
    32  
    33 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $post->to_ping) .'" />'; 
     32$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />'; 
     33 
     34$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />'; 
     35 
     36$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />'; 
    3437 
    3538if ('' != $post->pinged) { 
     
    4245} 
    4346 
    44 $saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . __('Save and Continue Editing') . '" />'; 
     47$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />'; 
    4548 
    4649if (empty($post->post_status)) $post->post_status = 'draft'; 
     
    4851?> 
    4952 
    50 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> 
     53<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 
    5154<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" /> 
    5255<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" /> 
    53 <input type="hidden" name="post_author" value="<?php echo $post->post_author ?>" /> 
     56<input type="hidden" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" /> 
    5457<input type="hidden" id="post_type" name="post_type" value="post" /> 
    5558 
     
    8992<fieldset id="passworddiv" class="dbx-box"> 
    9093<h3 class="dbx-handle"><?php _e('Post Password') ?></h3>  
    91 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div> 
     94<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div> 
    9295</fieldset> 
    9396 
    9497<fieldset id="slugdiv" class="dbx-box"> 
    9598<h3 class="dbx-handle"><?php _e('Post Slug') ?></h3>  
    96 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div> 
     99<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div> 
    97100</fieldset> 
    98101 
     
    126129if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"'; 
    127130else $selected = ''; 
    128 echo "<option value='$o->ID' $selected>$o->display_name</option>"; 
     131echo "<option value='" . (int) $o->ID . "' $selected>" . wp_specialchars( $o->display_name ) . "</option>"; 
    129132endforeach; 
    130133?> 
     
    141144<fieldset id="titlediv"> 
    142145        <legend><?php _e('Title') ?></legend> 
    143         <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div> 
     146        <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div> 
    144147</fieldset> 
    145148 
     
    169172?> 
    170173<?php if ( current_user_can('publish_posts') ) : ?> 
    171         <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />  
     174        <input name="publish" type="submit" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish'); ?>" />  
    172175<?php endif; ?> 
    173176<?php 
     
    187190<?php 
    188191if (current_user_can('upload_files')) { 
    189         $uploading_iframe_ID = (0 == $post_ID ? $temp_ID : $post_ID); 
     192        $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID); 
    190193        $uploading_iframe_src = wp_nonce_url("upload.php?style=inline&amp;tab=upload&amp;post_id=$uploading_iframe_ID", 'inlineuploading'); 
    191194        $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src); 
    192195        if ( false != $uploading_iframe_src ) 
    193                 echo '<iframe id="uploading" name="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>'; 
     196                echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>'; 
    194197} 
    195198?> 
  • trunk/wp-admin/edit-form-comment.php

    r972 r1005  
    33$toprow_title = sprintf(__('Editing Comment # %s'), $comment->comment_ID); 
    44$form_action = 'editedcomment'; 
    5 $form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='".$comment->comment_post_ID; 
     5$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='" . $comment->comment_post_ID; 
    66?> 
    77 
     
    99<?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?> 
    1010<div class="wrap"> 
    11 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> 
     11<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 
    1212<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' /> 
    1313 
     
    2121    <legend><label for="name"><?php _e('Name:') ?></label></legend> 
    2222        <div> 
    23           <input type="text" name="newcomment_author" size="25" value="<?php echo $comment->comment_author ?>" tabindex="1" id="name" /> 
     23          <input type="text" name="newcomment_author" size="25" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" /> 
    2424    </div> 
    2525</fieldset> 
     
    2727        <legend><label for="email"><?php _e('E-mail:') ?></label></legend> 
    2828                <div> 
    29                   <input type="text" name="newcomment_author_email" size="20" value="<?php echo $comment->comment_author_email ?>" tabindex="2" id="email" /> 
     29                  <input type="text" name="newcomment_author_email" size="20" value="<?php echo attribute_escape( $comment->comment_author_email ); ?>" tabindex="2" id="email" /> 
    3030    </div> 
    3131</fieldset> 
     
    3333        <legend><label for="newcomment_author_url"><?php _e('URL:') ?></label></legend> 
    3434                <div> 
    35                   <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url ?>" tabindex="3" /> 
     35                  <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="3" /> 
    3636    </div> 
    3737</fieldset> 
  • trunk/wp-admin/edit-form.php

    r828 r1005  
    77<input type="hidden" name="mode" value="bookmarklet" /> 
    88<?php endif; ?> 
    9 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> 
     9<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 
    1010<input type="hidden" name="action" value='post' /> 
    1111 
     
    2222    <fieldset id="titlediv"> 
    2323      <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>  
    24           <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div> 
     24          <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div> 
    2525    </fieldset> 
    2626 
     
    5050</script> 
    5151 
    52 <input type="hidden" name="post_pingback" value="<?php echo get_option('default_pingback_flag') ?>" id="post_pingback" /> 
     52<input type="hidden" name="post_pingback" value="<?php echo (int) get_option('default_pingback_flag') ?>" id="post_pingback" /> 
    5353 
    5454<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)'), 'http://wordpress.org/docs/reference/post/#trackback'); echo '<br />'; ?> 
     
    6565                echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' .  __('Advanced Editing &raquo;') . '" />'; 
    6666        } ?> 
    67         <input name="referredby" type="hidden" id="referredby" value="<?php if ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" /> 
     67        <input name="referredby" type="hidden" id="referredby" value="<?php if ( $refby = wp_get_referer() ) echo urlencode($refby); ?>" /> 
    6868</p> 
    6969 
  • trunk/wp-admin/edit-link-form.php

    r972 r1005  
    8181<tr> 
    8282<th scope="row" valign="top"><label for="link_name"><?php _e('Name:') ?></label></th> 
    83 <td><input type="text" name="link_name" id="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td> 
     83<td><input type="text" name="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td> 
    8484</tr> 
    8585<tr> 
    8686<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('Address:') ?></label></th> 
    87 <td width="80%"><input type="text" name="link_url" id="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td> 
     87<td width="80%"><input type="text" name="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td> 
    8888</tr> 
    8989<tr> 
    9090<th scope="row" valign="top"><label for="link_description"><?php _e('Description:') ?></label></th> 
    91 <td><input type="text" name="link_description" id="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td> 
     91<td><input type="text" name="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td> 
    9292</tr> 
    9393</table> 
  • trunk/wp-admin/edit-page-form.php

    r972 r1005  
    33<h2 id="write-post"><?php _e('Write Page'); ?></h2> 
    44<?php 
     5 
    56if (0 == $post_ID) { 
    67        $form_action = 'post'; 
     
    910        $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />"; 
    1011} else { 
     12        $post_ID = (int) $post_ID; 
    1113        $form_action = 'editpost'; 
    1214        $nonce_action = 'update-page_' . $post_ID; 
    1315        $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 
    1416} 
     17 
     18$temp_ID = (int) $temp_ID; 
     19$user_ID = (int) $user_ID; 
    1520 
    1621$sendto = clean_url(stripslashes(wp_get_referer())); 
     
    6974<fieldset id="passworddiv" class="dbx-box"> 
    7075<h3 class="dbx-handle"><?php _e('Page Password') ?></h3> 
    71 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div> 
     76<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div> 
    7277</fieldset> 
    7378 
     
    9499<fieldset id="slugdiv" class="dbx-box"> 
    95100<h3 class="dbx-handle"><?php _e('Page Slug') ?></h3> 
    96 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div> 
     101<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div> 
    97102</fieldset> 
    98103 
     
    107112if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"'; 
    108113else $selected = ''; 
     114$o->ID = (int) $o->ID; 
     115$o->display_name = wp_specialchars( $o->display_name ); 
    109116echo "<option value='$o->ID' $selected>$o->display_name</option>"; 
    110117endforeach; 
     
    127134<fieldset id="titlediv"> 
    128135  <legend><?php _e('Page Title') ?></legend> 
    129   <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div> 
     136  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div> 
    130137</fieldset> 
    131138 
     
    164171        $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src); 
    165172        if ( false != $uploading_iframe_src ) 
    166                 echo '<iframe id="uploading" name="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>'; 
     173                echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>'; 
    167174} 
    168175?> 
  • trunk/wp-admin/edit-pages.php

    r972 r1005  
    1111<p><?php _e('Pages are like posts except they live outside of the normal blog chronology and can be hierarchical. You can use pages to organize and manage any amount of content.'); ?> <a href="page-new.php"><?php _e('Create a new page &raquo;'); ?></a></p> 
    1212 
    13 <form name="searchform" id="searchform" action="" method="get"> 
     13<form name="searchform" action="" method="get"> 
    1414        <fieldset> 
    1515        <legend><?php _e('Search Pages&hellip;') ?></legend> 
    16         <input type="text" name="s" id="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" /> 
     16        <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo attribute_escape($_GET['s']); ?>" size="17" /> 
    1717        <input type="submit" name="submit" value="<?php _e('Search') ?>"  /> 
    1818        </fieldset> 
    1919</form> 
    20  
    21 <br style="clear:both;" /> 
    2220 
    2321<?php 
  • trunk/wp-admin/edit.php

    r972 r1005  
    7777  <fieldset>  
    7878  <legend><?php _e('Search Posts&hellip;') ?></legend>  
    79   <input type="text" name="s" id="s" value="<?php if (isset($s)) echo attribute_escape($s); ?>" size="17" />  
     79  <input type="text" name="s" value="<?php if (isset($s)) echo attribute_escape($s); ?>" size="17" />  
    8080  <input type="submit" name="submit" value="<?php _e('Search') ?>" class="button" />  
    8181  </fieldset> 
     
    197197                ?> 
    198198                <td style="text-align: center"> 
    199                         <?php comments_number("<a href='edit.php?p=$id&amp;c=1'>" . __('0') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('%') . '</a>') ?> 
     199                        <?php comments_number(__('0'), "<a href='edit.php?p=$id&amp;c=1'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('%') . '</a>') ?> 
    200200                        </td> 
    201201                <?php 
  • trunk/wp-admin/export.php

    r972 r1005  
    149149--> 
    150150 
    151 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"--> 
     151<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:i'); ?>"--> 
    152152<rss version="2.0" 
    153153        xmlns:content="http://purl.org/rss/1.0/modules/content/" 
  • trunk/wp-admin/import/livejournal.php

    r972 r1005  
    5050                        preg_match('|<eventtime>(.*?)</eventtime>|is', $post, $post_date); 
    5151                        $post_date = strtotime($post_date[1]); 
    52                         $post_date = date('Y-m-d H:i:s', $post_date); 
     52                        $post_date = gmdate('Y-m-d H:i:s', $post_date); 
    5353 
    5454                        preg_match('|<event>(.*?)</event>|is', $post, $post_content); 
  • trunk/wp-admin/import/textpattern.php

    r972 r1005  
    560560                echo '<p>'.__('Welcome to WordPress.  We hope (and expect!) that you will find this platform incredibly rewarding!  As a new WordPress user coming from Textpattern, there are some things that we would like to point out.  Hopefully, they will help your transition go as smoothly as possible.').'</p>'; 
    561561                echo '<h3>'.__('Users').'</h3>'; 
    562                 echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password.  Forget it.  You didn&#8217;t have that login in Textpattern, why should you have it here?  Instead we have taken care to import all of your users into our system.  Unfortunately there is one downside.  Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users.  <strong>Every user has the same username, but their passwords are reset to password123.</strong>  So <a href="%1$s">Login</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>'; 
     562                echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password.  Forget it.  You didn\'t have that login in Textpattern, why should you have it here?  Instead we have taken care to import all of your users into our system.  Unfortunately there is one downside.  Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users.  <strong>Every user has the same username, but their passwords are reset to password123.</strong>  So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>'; 
    563563                echo '<h3>'.__('Preserving Authors').'</h3>'; 
    564564                echo '<p>'.__('Secondly, we have attempted to preserve post authors.  If you are the only author or contributor to your blog, then you are safe.  In most cases, we are successful in this preservation endeavor.  However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>'; 
    565565                echo '<h3>'.__('Textile').'</h3>'; 
    566                 echo '<p>'.__('Also, since you&#8217;re coming from Textpattern, you probably have been using Textile to format your comments and posts.  If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>.  Trust me... You&#8217;ll want it.').'</p>'; 
     566                echo '<p>'.__('Also, since you\'re coming from Textpattern, you probably have been using Textile to format your comments and posts.  If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>.  Trust me... You\'ll want it.').'</p>'; 
    567567                echo '<h3>'.__('WordPress Resources').'</h3>'; 
    568568                echo '<p>'.__('Finally, there are numerous WordPress resources around the internet.  Some of them are:').'</p>'; 
     
    572572                echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>'; 
    573573                echo '</ul>'; 
    574                 echo '<p>'.sprintf(__('That&#8217;s it! What are you waiting for? Go <a href="%1$s">login</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>'; 
     574                echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '/wp-login.php').'</p>'; 
    575575        } 
    576576 
  • trunk/wp-admin/index.php

    r972 r1005  
    4444 
    4545<?php if ( $numcomments ) : ?> 
    46 <p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s)'), number_format_i18n($numcomments) ); ?> &raquo;</a></strong></p> 
     46<p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s)'), number_format($numcomments) ); ?> &raquo;</a></strong></p> 
    4747<?php endif; ?> 
    4848 
     
    104104$numcats  = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories"); 
    105105 
    106 $post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), number_format_i18n($numposts), 'edit.php'); 
    107 $comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), number_format_i18n($numcomms), 'edit-comments.php'); 
    108 $cat_str  = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), number_format_i18n($numcats), 'categories.php'); 
     106$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), number_format($numposts), 'edit.php'); 
     107$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), number_format($numcomms), 'edit-comments.php'); 
     108$cat_str  = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), number_format($numcats), 'categories.php'); 
    109109?> 
    110110 
  • trunk/wp-admin/link-manager.php

    r972 r1005  
    200200 
    201201<?php } ?> 
    202 <?php 
    203 if( wp_cache_get( "checked_bookmarks_table", "options" ) == false ) { 
    204         $results = $wpdb->get_results( "SELECT link_id, category_id, count( * ) AS c FROM {$wpdb->link2cat} GROUP BY link_id, category_id" ); 
    205         if( $results != null ) { 
    206                 foreach( $results as $link ) { 
    207                         if( $link->c > 1 ) { 
    208                                 $wpdb->query( "DELETE FROM {$wpdb->link2cat} WHERE link_id='{$link->link_id}' AND category_id='{$link->category_id}'" ); 
    209                                 $wpdb->query( "INSERT INTO {$wpdb->link2cat} VALUES ( 0, '{$link->link_id}', '{$link->category_id}' )" ); 
    210                         } 
    211                 } 
    212         } 
    213         wp_cache_set( "checked_bookmarks_table", "1", "options" ); 
    214 } ?> 
    215202 
    216203</div> 
  • trunk/wp-admin/moderation.php

    r972 r1005  
    124124<p><?php comment_date(__('M j, g:i A')); ?> &#8212; [ <?php 
    125125echo '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'">' . __('Edit') . '</a> | '; 
    126 echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\">" . __('Delete') . "</a> "; ?> ] &#8212; 
     126echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\">" . __('Delete') . "</a> | "; ?> 
    127127<?php 
    128128$post = get_post($comment->comment_post_ID); 
     
    130130$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 
    131131?> 
    132 <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a></p> 
    133 <p><?php _e('Bulk action:') ?> 
     132<a href="<?php echo get_permalink($comment->comment_post_ID); ?>" title="<?php echo $post_title; ?>"><?php _e('View Post') ?></a> ] &#8212; 
     133 <?php _e('Bulk action:') ?> 
    134134        <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-approve" value="approve" /> <label for="comment-<?php echo $comment->comment_ID; ?>-approve"><?php _e('Approve') ?></label> &nbsp; 
    135135        <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-spam" value="spam" /> <label for="comment-<?php echo $comment->comment_ID; ?>-spam"><?php _e('Spam') ?></label> &nbsp; 
     
    183183<noscript> 
    184184        <p> 
    185                 <input name="feelinglucky" type="checkbox" id="feelinglucky" value="true" /> <label for="feelinglucky"><?php _e('Delete every comment marked &#8220;defer.&#8221; <strong>Warning: This can&#8217;t be undone.</strong>'); ?></label> 
     185                <input name="feelinglucky" type="checkbox" id="feelinglucky" value="true" /> <label for="feelinglucky"><?php _e('Delete every comment marked "defer." <strong>Warning: This can&#8217;t be undone.</strong>'); ?></label> 
    186186        </p> 
    187187</noscript> 
  • trunk/wp-admin/options-reading.php

    r873