Changeset 920

Show
Ignore:
Timestamp:
03/19/07 13:04:29 (2 years ago)
Author:
donncha
Message:

WP Merge to rev 5061

Files:

Legend:

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

    r915 r920  
    371371                $text       = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) ); 
    372372                $text       = funky_javascript_fix( $text); 
    373                 $popupurl   = attribute_escape($_REQUEST['popupurl']); 
     373                $popupurl   = clean_url($_REQUEST['popupurl']); 
    374374        $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 
    375375    } 
     
    430430        $user->user_login   = attribute_escape($user->user_login); 
    431431        $user->user_email   = attribute_escape($user->user_email); 
    432         $user->user_url     = attribute_escape($user->user_url); 
     432        $user->user_url     = clean_url($user->user_url); 
    433433        $user->first_name   = attribute_escape($user->first_name); 
    434434        $user->last_name    = attribute_escape($user->last_name); 
     
    575575        $link = get_link( $link_id ); 
    576576 
    577         $link->link_url         = attribute_escape($link->link_url); 
     577        $link->link_url         = clean_url($link->link_url); 
    578578        $link->link_name        = attribute_escape($link->link_name); 
    579579        $link->link_image       = attribute_escape($link->link_image); 
    580580        $link->link_description = attribute_escape($link->link_description); 
    581         $link->link_rss         = attribute_escape($link->link_rss); 
     581        $link->link_rss         = clean_url($link->link_rss); 
    582582        $link->link_rel         = attribute_escape($link->link_rel); 
    583583        $link->link_notes       =  wp_specialchars($link->link_notes); 
     
    589589function get_default_link_to_edit() { 
    590590        if ( isset( $_GET['linkurl'] ) ) 
    591                 $link->link_url = attribute_escape( $_GET['linkurl']); 
     591                $link->link_url = clean_url( $_GET['linkurl']); 
    592592        else 
    593593                $link->link_url = ''; 
     
    808808 
    809809                if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) ) 
    810                         $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll of its posts will go into the default category of '%s'\nAll of its bookmarks will go into the default category of '%s'.\n'OK' to delete, 'Cancel' to stop." ), $category->cat_name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>"; 
     810                        $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll posts that were only assigned to this category will be assigned to the '%s' category.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop." ), $category->cat_name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>"; 
    811811                else 
    812812                        $edit .= "<td style='text-align:center'>".__( "Default" ); 
     
    892892        $r .= "</td>\n\t\t<td>"; 
    893893        if ( ( is_site_admin() || $current_user->ID == $user_object->ID ) && current_user_can( 'edit_user', $user_object->ID ) ) { 
    894                 $edit_link = attribute_escape( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" )); 
     894                $edit_link = clean_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" )); 
    895895                $r .= "<a href='$edit_link' class='edit'>".__( 'Edit' )."</a>"; 
    896896        } 
     
    21012101        } 
    21022102 
    2103         imageantialias( $dst, true ); 
     2103        if (function_exists('imageantialias')) 
     2104                imageantialias( $dst, true ); 
     2105         
    21042106        imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ); 
    21052107 
  • trunk/wp-admin/admin-header.php

    r909 r920  
    33if (!isset($_GET["page"])) require_once('admin.php'); 
    44if ( $editing ) { 
    5         wp_enqueue_script( array("dbx-admin-key?pagenow=$pagenow",'admin-custom-fields') ); 
     5        wp_enqueue_script( array('dbx-admin-key?pagenow=' . attribute_escape($pagenow),'admin-custom-fields') ); 
    66        if ( current_user_can('manage_categories') ) 
    77                wp_enqueue_script( 'ajaxcat' ); 
  • trunk/wp-admin/bookmarklet.php

    r828 r920  
    3838 
    3939$content  = wp_specialchars($_REQUEST['content']); 
    40 $popupurl = attribute_escape($_REQUEST['popupurl']); 
     40$popupurl = clean_url($_REQUEST['popupurl']); 
    4141if ( !empty($content) ) { 
    4242        $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); 
  • trunk/wp-admin/categories.php

    r915 r920  
    115115<?php if ( current_user_can('manage_categories') ) : ?> 
    116116<div class="wrap"> 
    117 <p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts and links in that category. Instead, posts in the deleted category are set to the category <strong>%s</strong> and links are set to <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category'))), apply_filters('the_category', get_catname(get_option('default_link_category')))) ?></p> 
     117<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts and links in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong> and links that were only assigned to the deleted category are set to <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category'))), apply_filters('the_category', get_catname(get_option('default_link_category')))) ?></p> 
    118118</div> 
    119119 
  • trunk/wp-admin/edit-comments.php

    r915 r920  
    102102if ( 1 < $page ) { 
    103103        $args['apage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1; 
    104         $r .=  '<a class="prev" href="' . attribute_escape(add_query_arg( $args )) . '">&laquo; '. __('Previous Page') .'</a>' . "\n"; 
     104        $r .=  '<a class="prev" href="' . clean_url(add_query_arg( $args )) . '">&laquo; '. __('Previous Page') .'</a>' . "\n"; 
    105105} 
    106106if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { 
     
    112112                        if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : 
    113113                                $args['apage'] = ( 1 == $page_num ) ? FALSE : $page_num; 
    114                                 $r .= '<a class="page-numbers" href="' . attribute_escape(add_query_arg($args)) . '">' . ( $page_num ) . "</a>\n"; 
     114                                $r .= '<a class="page-numbers" href="' . clean_url(add_query_arg($args)) . '">' . ( $page_num ) . "</a>\n"; 
    115115                                $in = true; 
    116116                        elseif ( $in == true ) : 
     
    123123if ( ( $page ) * 20 < $total || -1 == $total ) { 
    124124        $args['apage'] = $page + 1; 
    125         $r .=  '<a class="next" href="' . attribute_escape(add_query_arg($args)) . '">'. __('Next Page') .' &raquo;</a>' . "\n"; 
     125        $r .=  '<a class="next" href="' . clean_url(add_query_arg($args)) . '">'. __('Next Page') .' &raquo;</a>' . "\n"; 
    126126} 
    127127echo "<p class='pagenav'>$r</p>"; 
     
    249249if ( 1 < $page ) { 
    250250        $args['apage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1; 
    251         $r .=  '<a class="prev" href="' . attribute_escape(add_query_arg( $args )) . '">&laquo; '. __('Previous Page') .'</a>' . "\n"; 
     251        $r .=  '<a class="prev" href="' . clean_url(add_query_arg( $args )) . '">&laquo; '. __('Previous Page') .'</a>' . "\n"; 
    252252} 
    253253if ( ( $total_pages = ceil( $total / 20 ) ) > 1 ) { 
     
    259259                        if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) : 
    260260                                $args['apage'] = ( 1 == $page_num ) ? FALSE : $page_num; 
    261                                 $r .= '<a class="page-numbers" href="' . attribute_escape(add_query_arg($args)) . '">' . ( $page_num ) . "</a>\n"; 
     261                                $r .= '<a class="page-numbers" href="' . clean_url(add_query_arg($args)) . '">' . ( $page_num ) . "</a>\n"; 
    262262                                $in = true; 
    263263                        elseif ( $in == true ) : 
     
    270270if ( ( $page ) * 20 < $total || -1 == $total ) { 
    271271        $args['apage'] = $page + 1; 
    272         $r .=  '<a class="next" href="' . attribute_escape(add_query_arg($args)) . '">'. __('Next Page') .' &raquo;</a>' . "\n"; 
     272        $r .=  '<a class="next" href="' . clean_url(add_query_arg($args)) . '">'. __('Next Page') .' &raquo;</a>' . "\n"; 
    273273} 
    274274echo "<p class='pagenav'>$r</p>"; 
  • trunk/wp-admin/edit-form-advanced.php

    r909 r920  
    169169<input name="referredby" type="hidden" id="referredby" value="<?php  
    170170if ( !empty($_REQUEST['popupurl']) ) 
    171         echo attribute_escape(stripslashes($_REQUEST['popupurl'])); 
     171        echo clean_url(stripslashes($_REQUEST['popupurl'])); 
    172172else if ( url_to_postid(wp_get_referer()) == $post_ID ) 
    173173        echo 'redo'; 
    174174else 
    175         echo attribute_escape(stripslashes(wp_get_referer())); 
     175        echo clean_url(stripslashes(wp_get_referer())); 
    176176?>" /></p> 
    177177 
  • trunk/wp-admin/edit-page-form.php

    r865 r920  
    1414} 
    1515 
    16 $sendto = attribute_escape(stripslashes(wp_get_referer())); 
     16$sendto = clean_url(stripslashes(wp_get_referer())); 
    1717 
    1818if ( 0 != $post_ID && $sendto == get_permalink($post_ID) ) 
  • trunk/wp-admin/import/blogger.php

    r909 r920  
    8585                        $headers = array( 
    8686                                "GET /feeds/default/blogs HTTP/1.0", 
    87                                 "Host: www.blogger.com", 
     87                                "Host: www2.blogger.com", 
    8888                                "Authorization: AuthSub token=\"$this->token\"" 
    8989                        ); 
     
    548548 
    549549                $comment_post_ID = $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; 
    550                 $comment_author  = addslashes( $this->no_apos( strip_tags( $entry->author ) ) ); 
     550                preg_match('#<name>(.+?)</name>.*(?:\<uri>(.+?)</uri>)?#', $entry->author, $matches); 
     551                $comment_author  = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) ); 
     552                $comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) ); 
    551553                $comment_date    = $this->convert_date( $entry->updated ); 
    552554                $comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ); 
     
    564566                        ++$this->blogs[$importing_blog]['comments_skipped']; 
    565567                } else { 
    566                         $comment = compact('comment_post_ID', 'comment_author', 'comment_date', 'comment_content'); 
     568                        $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content'); 
    567569 
    568570                        $comment_id = wp_insert_comment($comment); 
     
    673675        } 
    674676 
    675         function _get_blogger_sock($host = 'www.blogger.com') { 
     677        function _get_blogger_sock($host = 'www2.blogger.com') { 
    676678                if ( !$sock = @ fsockopen($host, 80, $errno, $errstr) ) { 
    677679                        $this->uh_oh( 
  • trunk/wp-admin/link-manager.php

    r915 r920  
    134134                $link->link_name = attribute_escape(apply_filters('link_title', $link->link_name)); 
    135135                $link->link_description = wp_specialchars(apply_filters('link_description', $link->link_description)); 
    136                 $link->link_url = attribute_escape($link->link_url); 
     136                $link->link_url = clean_url($link->link_url); 
    137137                $link->link_category = wp_get_link_cats($link->link_id); 
    138138                $short_url = str_replace('http://', '', $link->link_url); 
  • trunk/wp-admin/options-head.php

    r636 r920  
    11<?php wp_reset_vars(array('action', 'standalone', 'option_group_id')); ?> 
    2  
    3 <br clear="all" /> 
    42 
    53<?php if (isset($_GET['updated'])) : ?> 
  • trunk/wp-admin/page.php

    r909 r920  
    6666        <div id='preview' class='wrap'> 
    6767        <h2 id="preview-post"><?php _e('Page Preview (updated when page is saved)'); ?></h2> 
    68                 <iframe src="<?php echo attribute_escape(apply_filters('preview_page_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe> 
     68                <iframe src="<?php echo clean_url(apply_filters('preview_page_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe> 
    6969        </div> 
    7070        <?php 
  • trunk/wp-admin/post.php

    r909 r920  
    7070        <div id='preview' class='wrap'> 
    7171        <h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?></h2> 
    72                 <iframe src="<?php echo attribute_escape(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe> 
     72                <iframe src="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe> 
    7373        </div> 
    7474        <?php 
  • trunk/wp-admin/upgrade.php

    r888 r920  
    3636switch($step) : 
    3737        case 0: 
    38                 $goback = attribute_escape(stripslashes(wp_get_referer())); 
     38                $goback = clean_url(stripslashes(wp_get_referer())); 
    3939?> 
    4040<h2><?php _e('Database Upgrade Required'); ?></h2> 
     
    5050                        $backto = __get_option('home') . '/'; 
    5151                else 
    52                         $backto = attribute_escape(stripslashes($_GET['backto'])); 
     52                        $backto = clean_url(stripslashes($_GET['backto'])); 
    5353                if( $wpdb->get_row( "SELECT blog_id FROM wp_blog_versions WHERE blog_id = '{$wpdb->blogid}'" ) ) { 
    5454                        $wpdb->query( "UPDATE wp_blog_versions SET db_version = '{$wp_db_version}' WHERE blog_id = '{$wpdb->blogid}'" ); 
  • trunk/wp-admin/upload-functions.php

    r909 r920  
    8484                                echo '<a href="' . get_permalink() . '">' . __('view') . '</a>'; 
    8585                                echo '&nbsp;|&nbsp;'; 
    86                                         echo '<a href="' . attribute_escape(add_query_arg('action', 'edit')) . '" title="' . __('Edit this file') . '">' . __('edit') . '</a>'; 
     86                                        echo '<a href="' . clean_url(add_query_arg('action', 'edit')) . '" title="' . __('Edit this file') . '">' . __('edit') . '</a>'; 
    8787                                echo '&nbsp;|&nbsp;'; 
    88                                 echo '<a href="' . attribute_escape(remove_query_arg(array('action', 'ID'))) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>'; 
     88                                echo '<a href="' . clean_url(remove_query_arg(array('action', 'ID'))) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>'; 
    8989                                echo '&nbsp;]'; ?></span> 
    9090                </div> 
     
    124124                                echo '<a href="' . get_permalink() . '">' . __('view') . '</a>'; 
    125125                                echo '&nbsp;|&nbsp;'; 
    126                                         echo '<a href="' . attribute_escape(add_query_arg('action', 'view')) . '">' . __('links') . '</a>'; 
     126                                        echo '<a href="' . clean_url(add_query_arg('action', 'view')) . '">' . __('links') . '</a>'; 
    127127                                echo '&nbsp;|&nbsp;'; 
    128                                 echo '<a href="' . attribute_escape(remove_query_arg(array('action','ID'))) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>'; 
     128                                echo '<a href="' . clean_url(remove_query_arg(array('action','ID'))) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>'; 
    129129                                echo '&nbsp;]'; ?></span> 
    130130                </div> 
  • trunk/wp-admin/upload.php

    r835 r920  
    9191        if ( isset($tab_array[4]) && is_array($tab_array[4]) ) 
    9292                add_query_arg( $tab_array[4], $href ); 
    93         $_href = attribute_escape( $href); 
     93        $_href = clean_url( $href); 
    9494        $page_links = ''; 
    9595        $class = 'upload-tab alignleft'; 
  • trunk/wp-admin/user-edit.php

    r850 r920  
    6262        <p><strong><?php _e('User updated.') ?></strong></p> 
    6363        <?php if ( $wp_http_referer ) : ?> 
    64         <p><a href="<?php echo attribute_escape($wp_http_referer); ?>"><?php _e('&laquo; Back to Authors and Users'); ?></a></p> 
     64        <p><a href="<?php echo clean_url($wp_http_referer); ?>"><?php _e('&laquo; Back to Authors and Users'); ?></a></p> 
    6565        <?php endif; ?> 
    6666</div> 
  • trunk/wp-comments-post.php

    r900 r920  
    2626// If the user is logged in 
    2727$user = wp_get_current_user(); 
    28 if ( $user->ID ) : 
     28if ( $user->ID ) { 
    2929        $comment_author       = $wpdb->escape($user->display_name); 
    3030        $comment_author_email = $wpdb->escape($user->user_email); 
    3131        $comment_author_url   = $wpdb->escape($user->user_url); 
    32 else : 
     32        if ( current_user_can('unfiltered_html') ) { 
     33                if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { 
     34                        kses_remove_filters(); // start with a clean slate 
     35                        kses_init_filters(); // set up the filters 
     36                } 
     37        } 
     38} else { 
    3339        if ( get_option('comment_registration') ) 
    3440                wp_die( __('Sorry, you must be logged in to post a comment.') ); 
    35 endif; 
     41
    3642 
    3743$comment_type = ''; 
  • trunk/wp-includes/bookmark-template.php

    r915 r920  
    9797                $the_link = '#'; 
    9898                if ( !empty($row->link_url) ) 
    99                         $the_link = wp_specialchars($row->link_url); 
     99                        $the_link = clean_url($row->link_url); 
    100100                $rel = $row->link_rel; 
    101101                if ( '' != $rel ) 
     
    261261                $the_link = '#'; 
    262262                if ( !empty($bookmark->link_url) ) 
    263                         $the_link = wp_specialchars($bookmark->link_url); 
     263                        $the_link = clean_url($bookmark->link_url); 
    264264 
    265265                $rel = $bookmark->link_rel; 
  • trunk/wp-includes/classes.php

    r918 r920  
    150150                                $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; 
    151151 
    152                         if( empty( $this->query_vars[$wpvar] ) == false
     152                        if ( !empty( $this->query_vars[$wpvar] )
    153153                                $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; 
    154154                } 
  • trunk/wp-includes/comment-template.php

    r915 r920  
    272272} 
    273273 
     274function wp_comment_form_unfiltered_html_nonce() { 
     275        global $post; 
     276        if ( current_user_can('unfiltered_html') ) 
     277                wp_nonce_field('unfiltered-html-comment_' . $post->ID, '_wp_unfiltered_html_comment', false); 
     278} 
     279 
    274280function comments_template( $file = '/comments.php' ) { 
    275281        global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity; 
  • trunk/wp-includes/comment.php

    r835 r920  
    170170                $comment_author_url = apply_filters('pre_comment_author_url', $_COOKIE['comment_author_url_'.COOKIEHASH]); 
    171171                $comment_author_url = stripslashes($comment_author_url); 
    172                 $comment_author_url = attribute_escape($comment_author_url); 
     172                $comment_author_url = clean_url($comment_author_url); 
    173173                $_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url; 
    174174        } 
  • trunk/wp-includes/default-filters.php

    r916 r920  
    3131add_filter('pre_comment_author_email', 'wp_filter_kses'); 
    3232add_filter('pre_comment_author_url', 'wp_filter_kses'); 
     33 
     34add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); 
    3335 
    3436// Default filters for these functions 
  • trunk/wp-includes/functions.php

    r916 r920  
    10201020} 
    10211021 
    1022 function wp_nonce_field($action = -1) { 
    1023         echo '<input type="hidden" name="_wpnonce" value="' . wp_create_nonce($action) . '" />'; 
    1024         wp_referer_field(); 
     1022function wp_nonce_field($action = -1, $name = "_wpnonce", $referer = true) { 
     1023        $name = attribute_escape($name); 
     1024        echo '<input type="hidden" name="' . $name . '" value="' . wp_create_nonce($action) . '" />'; 
     1025        if ( $referer ) 
     1026                wp_referer_field(); 
    10251027} 
    10261028 
     
    12901292        $adminurl = get_option('siteurl') . '/wp-admin'; 
    12911293        if ( wp_get_referer() ) 
    1292                 $adminurl = attribute_escape(wp_get_referer()); 
     1294                $adminurl = clean_url(wp_get_referer()); 
    12931295 
    12941296        $title = __('WordPress Confirmation'); 
     
    12981300                $q = http_build_query($_POST); 
    12991301                $q = explode( ini_get('arg_separator.output'), $q); 
    1300                 $html .= "\t<form method='post' action='$pagenow'>\n"; 
     1302                $html .= "\t<form method='post' action='" . attribute_escape($pagenow) . "'>\n"; 
    13011303                foreach ( (array) $q as $a ) { 
    13021304                        $v = substr(strstr($a, '='), 1); 
     
    13071309                $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n"; 
    13081310        } else { 
    1309                 $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . attribute_escape(add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] )) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; 
     1311                $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . clean_url(add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] )) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; 
    13101312        } 
    13111313        $html .= "</body>\n</html>"; 
  • trunk/wp-includes/general-template.php

    r915 r920  
    298298        $text = wptexturize($text); 
    299299        $title_text = attribute_escape($text); 
     300        $url = clean_url($url); 
    300301 
    301302        if ('link' == $format) 
     
    416417        } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { 
    417418                ('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC "; 
    418                 $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where $orderby $limit"); 
     419                $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"); 
    419420                if ( $arcresults ) { 
    420421                        foreach ( $arcresults as $arcresult ) { 
     
    987988                if ( $add_args ) 
    988989                        $link = add_query_arg( $add_args, $link ); 
    989                 $page_links[] = "<a class='prev page-numbers' href='" . attribute_escape($link) . "'>$prev_text</a>"; 
     990                $page_links[] = "<a class='prev page-numbers' href='" . clean_url($link) . "'>$prev_text</a>"; 
    990991        endif; 
    991992        for ( $n = 1; $n <= $total; $n++ ) : 
     
    9991000                                if ( $add_args ) 
    10001001                                        $link = add_query_arg( $add_args, $link ); 
    1001                                 $page_links[] = "<a class='page-numbers' href='" . attribute_escape($link) . "'>$n</a>"; 
     1002                                $page_links[] = "<a class='page-numbers' href='" . clean_url($link) . "'>$n</a>"; 
    10021003                                $dots = true; 
    10031004                        elseif ( $dots && !$show_all ) : 
     
    10121013                if ( $add_args ) 
    10131014                        $link = add_query_arg( $add_args, $link ); 
    1014                 $page_links[] = "<a class='next page-numbers' href='" . attribute_escape($link) . "'>$next_text</a>"; 
     1015                $page_links[] = "<a class='next page-numbers' href='" . clean_url($link) . "'>$next_text</a>"; 
    10151016        endif; 
    10161017        switch ( $type ) : 
  • trunk/wp-includes/link-template.php

    r915 r920  
    423423        global $wp_rewrite; 
    424424 
    425         $qstr = wp_specialchars($_SERVER['REQUEST_URI'])
     425        $qstr = $_SERVER['REQUEST_URI']
    426426 
    427427        $page_querystring = "paged"; 
     
    491491} 
    492492 
    493 function next_posts($max_page = 0) { // original by cfactor at cooltux.org 
     493function get_next_posts_page_link($max_page = 0) { 
    494494        global $paged, $pagenow; 
    495495 
     
    499499                $nextpage = intval($paged) + 1; 
    500500                if ( !$max_page || $max_page >= $nextpage ) 
    501                         echo get_pagenum_link($nextpage); 
    502         } 
     501                        return get_pagenum_link($nextpage); 
     502        } 
     503
     504 
     505function next_posts($max_page = 0) { 
     506        echo clean_url(get_next_posts_page_link($max_page)); 
    503507} 
    504508 
     
    518522} 
    519523 
    520  
    521 function previous_posts() { // original by cfactor at cooltux.org 
     524function get_previous_posts_page_link() { 
    522525        global $paged, $pagenow; 
    523526 
     
    526529                if ( $nextpage < 1 ) 
    527530                        $nextpage = 1; 
    528                 echo get_pagenum_link($nextpage); 
    529         } 
    530 
    531  
     531                return get_pagenum_link($nextpage); 
     532        } 
     533
     534 
     535function previous_posts() { 
     536        echo clean_url(get_previous_posts_page_link()); 
     537
    532538 
    533539function previous_posts_link($label='&laquo; Previous Page') { 
  • trunk/wp-includes/post-template.php

    r915 r920  
    282282 
    283283        $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), 
    284                 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => ''); 
     284                'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title'); 
    285285        $r = array_merge($defaults, $r); 
    286286 
  • trunk/wp-includes/script-loader.php

    r909 r920  
    151151                                        $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src; 
    152152                                        $src = add_query_arg('ver', $ver, $src); 
    153                                         $src = attribute_escape(apply_filters( 'script_loader_src', $src )); 
     153                                        $src = clean_url(apply_filters( 'script_loader_src', $src )); 
    154154                                        echo "<script type='text/javascript' src='$src'></script>\n"; 
    155155                                        $this->print_scripts_l10n( $handle ); 
  • trunk/wp-includes/user.php

    r876 r920  
    1010function get_usernumposts($userid) { 
    1111        global $wpdb; 
     12        $userid = (int) $userid; 
    1213        return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' AND post_type = 'post' AND post_status = 'publish'"); 
    1314} 
  • trunk/xmlrpc.php

    r915 r920  
    14291429                $upload = wp_upload_bits($name, $type, $bits, $overwrite); 
    14301430                if ( ! empty($upload['error']) ) { 
    1431                         logIO('O', '(MW) Could not write file '.$name); 
    1432                         return new IXR_Error(500, 'Could not write file '.$name); 
     1431                        $errorString = 'Could not write file ' . $name . ' (' . $upload['error'] . ')'; 
     1432                        logIO('O', '(MW) ' . $errorString); 
     1433                        return new IXR_Error(500, $errorString); 
    14331434                } 
    14341435                // Construct the attachment array