Make WordPress Core

Changes from tags/2.3 at r6293 to tags/2.3.1 at r6293


Ignore:
Location:
tags/2.3.1
Files:
8 added
24 edited

Legend:

Unmodified
Added
Removed
  • tags/2.3.1/wp-admin/edit-post-rows.php

    r6293 r6293  
     1<?php if ( ! defined('ABSPATH') ) die(); ?>
    12<table class="widefat">
    23    <thead>
  • tags/2.3.1/wp-admin/import/mt.php

    r6293 r6293  
    3131<?php _e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory'); ?></p>
    3232<p class="submit">
    33 <input type="submit" value="<?php _e(sprintf('Import %s', 'mt-export.txt &raquo;')); ?>" />
     33<input type="submit" value="<?php echo attribute_escape(__('Import mt-export.txt &raquo;')); ?>" />
    3434</p>
    3535</form>
  • tags/2.3.1/wp-admin/import/utw.php

    r6293 r6293  
    158158        $tags_added = $this->tag2post();
    159159
    160         echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>';
     160        echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were added!'), $tags_added ) . '<br /></p>';
    161161
    162162        echo '<form action="admin.php?import=utw&amp;step=4" method="post">';
  • tags/2.3.1/wp-admin/import/wp-cat2tag.php

    r6293 r6293  
    6464        print '</ul>';
    6565
    66         print '<p class="submit"><input type="submit" name="maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert &raquo;') . '" /></p>';
     66        print '<p class="submit"><input type="submit" name="submit" value="' . __('Convert &raquo;') . '" /></p>';
    6767        print '</form>';
    6868    }
     
    141141                        if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") )                       
    142142                            $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post', '$id')");
     143                        clean_post_cache($post);
    143144                    }
    144145                } else {
     146                    $tt_ids = $wpdb->get_col("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
     147                    if ( $tt_ids ) {
     148                        $posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id");
     149                        foreach ( (array) $posts as $post )
     150                            clean_post_cache($post);
     151                    }
     152
    145153                    // Change the category to a tag.
    146154                    $wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
     155
     156                    $terms = $wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
     157                    foreach ( (array) $terms as $term )
     158                        clean_category_cache($term);
    147159
    148160                    // Set all parents to 0 (root-level) if their parent was the converted tag
     
    161173    }
    162174
    163     function convert_all_confirm() {
    164         print '<div class="narrow">';
    165 
    166         print '<h3>' . __('Confirm') . '</h3>';
    167 
    168         print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>';
    169 
    170         print '<form action="admin.php?import=wp-cat2tag" method="post">';
    171         wp_nonce_field('import-cat2tag');
    172         print '<p style="text-align:center" class="submit"><input type="submit" value="' . __('Yes') . '" name="yes_convert_all_cats" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="' . __('No') . '" name="no_dont_do_it" /></p>';
    173         print '</form>';
    174 
    175         print '</div>';
    176     }
    177 
    178     function convert_all() {
    179         global $wpdb;
    180 
    181         $this->populate_all_categories();
    182         foreach ( $this->all_categories as $category )
    183             $this->categories_to_convert[] = $category->term_id;
    184         $this->convert_them();
    185     }
    186 
    187175    function init() {
    188176
    189         if (isset($_POST['maybe_convert_all_cats'])) {
    190             $step = 3;
    191         } elseif (isset($_POST['yes_convert_all_cats'])) {
    192             $step = 4;
    193         } elseif (isset($_POST['no_dont_do_it'])) {
    194             die('no_dont_do_it');
    195         } else {
    196             $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
    197         }
     177        $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
    198178
    199179        $this->header();
     
    215195                    $this->convert_them();
    216196                break;
    217 
    218                 case 3 :
    219                     $this->convert_all_confirm();
    220                 break;
    221 
    222                 case 4 :
    223                     $this->convert_all();
    224                 break;
    225197            }
    226198        }
  • tags/2.3.1/wp-admin/includes/template.php

    r6293 r6293  
    3939        $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->term_id' class='edit'>".__( 'Edit' )."</a></td>";
    4040        $default_cat_id = (int) get_option( 'default_category' );
     41        $default_link_cat_id = (int) get_option( 'default_link_category' );
    4142
    4243        if ( $category->term_id != $default_cat_id )
     
    494495                $current = '';
    495496
    496             echo "\n\t<option value='$item->ID'$current>$pad $item->post_title</option>";
     497            echo "\n\t<option value='$item->ID'$current>$pad " . wp_specialchars($item->post_title) . "</option>";
    497498            parent_dropdown( $default, $item->ID, $level +1 );
    498499        }
  • tags/2.3.1/wp-admin/includes/upgrade.php

    r6293 r6293  
    534534    // Convert categories to terms.
    535535    $tt_ids = array();
     536    $have_tags = false;
    536537    $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID");
    537538    foreach ($categories as $category) {
     
    580581
    581582        if ( !empty($category->tag_count) ) {
     583            $have_tags = true;
    582584            $count = (int) $category->tag_count;
    583585            $taxonomy = 'post_tag';
     
    594596    }
    595597
    596     $posts = $wpdb->get_results("SELECT * FROM $wpdb->post2cat");
     598    $select = 'post_id, category_id';
     599    if ( $have_tags )
     600        $select .= ', rel_type';
     601
     602    $posts = $wpdb->get_results("SELECT $select FROM $wpdb->post2cat GROUP BY post_id, category_id");
    597603    foreach ( $posts as $post ) {
    598604        $post_id = (int) $post->post_id;
     
    659665        update_option('default_link_category', $default_link_cat);
    660666    } else {
    661         $links = $wpdb->get_results("SELECT * FROM $wpdb->link2cat");
     667        $links = $wpdb->get_results("SELECT link_id, category_id FROM $wpdb->link2cat GROUP BY link_id, category_id");
    662668        foreach ( $links as $link ) {
    663669            $link_id = (int) $link->link_id;
     
    10031009                        // Add the column list to the index create string
    10041010                        $index_string .= ' ('.$index_columns.')';
    1005                         error_log("Index string: $index_string", 0);
    10061011                        if(!(($aindex = array_search($index_string, $indices)) === false)) {
    10071012                            unset($indices[$aindex]);
  • tags/2.3.1/wp-admin/includes/upload.php

    r6293 r6293  
    3232    $src_base = str_replace($src, '', $src_base);
    3333
     34    if ( !trim($post_title) )
     35        $post_title = basename($src);
     36
    3437    $r = '';
    3538
     
    4043    if ( $href )
    4144        $r .= "</a>\n";
    42     $r .= "\t\t\t\t<span class='upload-file-size'>".size_format(filesize($filesystem_path))."</span>\n";
     45    $size = @filesize($filesystem_path);
     46    if ( !empty($size) )
     47        $r .= "\t\t\t\t<span class='upload-file-size'>".size_format($size)."</span>\n";
    4348    $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n";
    4449    $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n";
  • tags/2.3.1/wp-admin/link-import.php

    r6293 r6293  
    4646<?php _e('Category:') ?> <select name="cat_id">
    4747<?php
    48 $categories = get_categories('hide_empty=0');
     48$categories = get_terms('link_category', 'get=all');
    4949foreach ($categories as $category) {
    5050?>
    51 <option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars(apply_filters('link_category', $category->cat_name)); ?></option>
     51<option value="<?php echo $category->term_id; ?>"><?php echo wp_specialchars(apply_filters('link_category', $category->name)); ?></option>
    5252<?php
    5353} // end foreach
  • tags/2.3.1/wp-admin/link.php

    r6293 r6293  
    33
    44wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
     5
     6if ( ! current_user_can('manage_links') )
     7    wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
    58
    69if ('' != $_POST['deletebookmarks'])
     
    1417
    1518switch ($action) {
    16         case 'deletebookmarks' :
     19    case 'deletebookmarks' :
    1720        check_admin_referer('bulk-bookmarks');
    18 
    19         // check the current user's level first.
    20         if (!current_user_can('manage_links'))
    21             wp_die(__('Cheatin&#8217; uh?'));
    2221
    2322        //for each link id (in $linkcheck[]) change category to selected value
     
    4241        check_admin_referer('bulk-bookmarks');
    4342
    44         // check the current user's level first.
    45         if (!current_user_can('manage_links'))
    46             wp_die(__('Cheatin&#8217; uh?'));
    47 
    4843        //for each link id (in $linkcheck[]) change category to selected value
    4944        if (count($linkcheck) == 0) {
     
    6459        add_link();
    6560
    66         wp_redirect(wp_get_referer().'?added=true');
     61        wp_redirect( wp_get_referer() . '?added=true' );
    6762        exit;
    6863        break;
     
    8277        check_admin_referer('delete-bookmark_' . $link_id);
    8378
    84         if (!current_user_can('manage_links'))
    85             wp_die(__('Cheatin&#8217; uh?'));
    86 
    8779        wp_delete_link($link_id);
    8880
     
    9890        $submenu_file = 'link-manager.php';
    9991        $title = __('Edit Link');
    100         include_once ('admin-header.php');
    101         if (!current_user_can('manage_links'))
    102             wp_die(__('You do not have sufficient permissions to edit the links for this blog.'));
    10392
    10493        $link_id = (int) $_GET['link_id'];
     
    10796            wp_die(__('Link not found.'));
    10897
     98        include_once ('admin-header.php');
    10999        include ('edit-link-form.php');
     100        include ('admin-footer.php');
    110101        break;
    111102
     
    113104        break;
    114105}
    115 
    116 include ('admin-footer.php');
    117106?>
  • tags/2.3.1/wp-includes/bookmark.php

    r6293 r6293  
    114114    if (!empty($category_query)) {
    115115        $category_query .= ") AND taxonomy = 'link_category'";
    116         $join = " LEFT JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) LEFT JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id";
     116        $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id";
    117117    }
    118118
  • tags/2.3.1/wp-includes/canonical.php

    r6293 r6293  
    55    global $wp_rewrite, $posts, $is_IIS;
    66
    7     if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) )
     7    if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) || is_preview() )
    88        return;
    99
  • tags/2.3.1/wp-includes/default-filters.php

    r6293 r6293  
    2626}
    2727
    28 // URL
     28// Save URL
    2929$filters = array('pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image',
    30     'pre_link_rss', 'comment_url');
     30    'pre_link_rss');
     31foreach ( $filters as $filter ) {
     32    add_filter($filter, 'strip_tags');
     33    add_filter($filter, 'trim');
     34    add_filter($filter, 'sanitize_url');
     35    add_filter($filter, 'wp_filter_kses');
     36}
     37
     38// Display URL
     39$filters = array('user_url', 'link_url', 'link_image', 'link_rss', 'comment_url');
    3140foreach ( $filters as $filter ) {
    3241    add_filter($filter, 'strip_tags');
     
    128137// Actions
    129138add_action('wp_head', 'rsd_link');
     139add_action('wp_head', 'wlwmanifest_link');
    130140add_action('wp_head', 'locale_stylesheet');
    131141add_action('publish_future_post', 'wp_publish_post', 10, 1);
  • tags/2.3.1/wp-includes/formatting.php

    r6293 r6293  
    10881088}
    10891089
    1090 function clean_url( $url, $protocols = null ) {
     1090function clean_url( $url, $protocols = null, $context = 'display' ) {
    10911091    $original_url = $url;
    10921092
     
    11041104        $url = 'http://' . $url;
    11051105
    1106     $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
     1106    // Replace ampersands ony when displaying.
     1107    if ( 'display' == $context )
     1108        $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
     1109
    11071110    if ( !is_array($protocols) )
    11081111        $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
     
    11101113        return '';
    11111114
    1112     return apply_filters('clean_url', $url, $original_url);
     1115    return apply_filters('clean_url', $url, $original_url, $context);
     1116}
     1117
     1118function sanitize_url( $url, $protocols = null ) {
     1119    return clean_url( $url, $protocols, 'db');
    11131120}
    11141121
  • tags/2.3.1/wp-includes/functions.php

    r6293 r6293  
    727727
    728728function wp($query_vars = '') {
    729     global $wp;
     729    global $wp, $wp_query, $wp_the_query;
    730730
    731731    $wp->main($query_vars);
     732
     733    if( !isset($wp_the_query) )
     734        $wp_the_query = $wp_query;
    732735}
    733736
  • tags/2.3.1/wp-includes/general-template.php

    r6293 r6293  
    828828function rsd_link() {
    829829    echo '  <link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . get_bloginfo('wpurl') . "/xmlrpc.php?rsd\" />\n";
     830}
     831
     832function wlwmanifest_link() {
     833    echo ' <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="'
     834        . get_bloginfo('wpurl') . '/wp-includes/wlwmanifest.xml" /> ';
    830835}
    831836
  • tags/2.3.1/wp-includes/pluggable.php

    r6293 r6293  
    226226    // Set the from name and email
    227227    $phpmailer->From = apply_filters( 'wp_mail_from', $from_email );
     228    $phpmailer->Sender = apply_filters( 'wp_mail_from', $from_email );
    228229    $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
    229230
     
    437438    $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), $lp['host']);
    438439
    439     if ( isset($lp['host']) && !in_array($lp['host'], $allowed_hosts) )
     440    if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
    440441        $location = get_option('siteurl') . '/wp-admin/';
    441442
  • tags/2.3.1/wp-includes/post.php

    r6293 r6293  
    103103    } elseif ( is_object($post) ) {
    104104        if ( 'page' == $post->post_type )
    105             return get_page($post, $output);
     105            return get_page($post, $output, $filter);
    106106        if ( !isset($post_cache[$blog_id][$post->ID]) )
    107107            $post_cache[$blog_id][$post->ID] = &$post;
     
    112112            $_post = & $post_cache[$blog_id][$post];
    113113        elseif ( $_post = wp_cache_get($post, 'pages') )
    114             return get_page($_post, $output);
     114            return get_page($_post, $output, $filter);
    115115        else {
    116116            $query = "SELECT * FROM $wpdb->posts WHERE ID = '$post' LIMIT 1";
    117117            $_post = & $wpdb->get_row($query);
    118118            if ( 'page' == $_post->post_type )
    119                 return get_page($_post, $output);
     119                return get_page($_post, $output, $filter);
    120120            $post_cache[$blog_id][$post] = & $_post;
    121121        }
     
    973973// Retrieves page data given a page ID or page object.
    974974// Handles page caching.
    975 function &get_page(&$page, $output = OBJECT) {
     975function &get_page(&$page, $output = OBJECT, $filter = 'raw') {
    976976    global $wpdb, $blog_id;
    977977
     
    986986    } elseif ( is_object($page) ) {
    987987        if ( 'post' == $page->post_type )
    988             return get_post($page, $output);
     988            return get_post($page, $output, $filter);
    989989        wp_cache_add($page->ID, $page, 'pages');
    990990        $_page = $page;
     
    999999                wp_cache_add($_page->ID, $_page, 'pages');
    10001000            } elseif ( isset($GLOBALS['post_cache'][$blog_id][$page]) ) { // it's actually a page, and is cached
    1001                 return get_post($page, $output);
     1001                return get_post($page, $output, $filter);
    10021002            } else { // it's not in any caches, so off to the DB we go
    10031003                // Why are we using assignment for this query?
    10041004                $_page = & $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1");
    10051005                if ( 'post' == $_page->post_type )
    1006                     return get_post($_page, $output);
     1006                    return get_post($_page, $output, $filter);
    10071007                // Potential issue: we're not checking to see if the post_type = 'page'
    10081008                // So all non-'post' posts will get cached as pages.
     
    10111011        }
    10121012    }
     1013
     1014    $_page = sanitize_post($_page, $filter);
    10131015
    10141016    // at this point, one way or another, $_post contains the page object
     
    12021204
    12031205    if ( empty($pages) )
    1204         return array();
     1206        return apply_filters('get_pages', array(), $r);
    12051207
    12061208    // Update cache.
  • tags/2.3.1/wp-includes/query.php

    r6293 r6293  
    933933
    934934        if ( !empty($q['category__in']) ) {
    935             $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
     935            $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
    936936            $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
    937937            $include_cats = "'" . implode("', '", $q['category__in']) . "'";
     
    949949        }
    950950
    951         if ( !empty($q['category__and']) ) {
    952             $count = 0;
    953             foreach ( $q['category__and'] as $category_and ) {
    954                 $join .= " LEFT JOIN $wpdb->term_relationships AS tr$count ON ($wpdb->posts.ID = tr$count.object_id) LEFT JOIN $wpdb->term_taxonomy AS tt$count ON (tr$count.term_taxonomy_id = tt$count.term_taxonomy_id) ";
    955                 $whichcat .= " AND tt$count.term_id = '$category_and' ";
    956                 $count++;
    957             }
    958         }
    959 
    960951        // Category stuff for nice URLs
    961952        if ( '' != $q['category_name'] ) {
     
    983974            $q['cat'] = $reqcat;
    984975
    985             $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
     976            $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
    986977            $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
    987978            $in_cats = array($q['cat']);
     
    10251016
    10261017        if ( !empty($q['tag__in']) ) {
    1027             $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
     1018            $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
    10281019            $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' ";
    10291020            $include_tags = "'" . implode("', '", $q['tag__in']) . "'";
     
    10351026
    10361027        if ( !empty($q['tag_slug__in']) ) {
    1037             $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) LEFT JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) ";
     1028            $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) INNER JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) ";
    10381029            $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' ";
    10391030            $include_tags = "'" . implode("', '", $q['tag_slug__in']) . "'";
     
    10521043        }
    10531044
    1054         if ( !empty($q['tag__and']) ) {
    1055             $count = 0;
    1056             foreach ( $q['tag__and'] as $tag_and ) {
    1057                 $join .= " LEFT JOIN $wpdb->term_relationships AS tr$count ON ($wpdb->posts.ID = tr$count.object_id) LEFT JOIN $wpdb->term_taxonomy AS tt$count ON (tr$count.term_taxonomy_id = tt$count.term_taxonomy_id) ";
    1058                 $whichcat .= " AND tt$count.term_id = '$tag_and' ";
    1059                 $count++;
    1060             }
    1061             $reqtag = is_term( $q['tag__and'][0], 'post_tag' );
    1062             if ( !empty($reqtag) )
    1063                 $q['tag_id'] = $reqtag['term_id'];
    1064         }
    1065 
    1066         if ( !empty($q['tag_slug__and']) ) {
    1067             $count = 0;
    1068             foreach ( $q['tag_slug__and'] as $tag_and ) {
    1069                 $join .= " LEFT JOIN $wpdb->term_relationships AS tr$count ON ($wpdb->posts.ID = tr$count.object_id) LEFT JOIN $wpdb->term_taxonomy AS tt$count ON (tr$count.term_taxonomy_id = tt$count.term_taxonomy_id) LEFT JOIN $wpdb->terms AS term$count ON (tt$count.term_id = term$count.term_id) ";
    1070                 $whichcat .= " AND term$count.slug = '$tag_and' ";
    1071                 $count++;
    1072             }
    1073             $reqtag = is_term( $q['tag_slug__and'][0], 'post_tag' );
    1074             if ( !empty($reqtag) )
    1075                 $q['tag_id'] = $reqtag['term_id'];
     1045        // Tag and slug intersections.
     1046        $intersections = array('category__and' => 'category', 'tag__and' => 'post_tag', 'tag_slug__and' => 'post_tag');
     1047        foreach ($intersections as $item => $taxonomy) {
     1048            if ( empty($q[$item]) ) continue;
     1049
     1050            if ( $item != 'category__and' ) {
     1051                $reqtag = is_term( $q[$item][0], 'post_tag' );
     1052                if ( !empty($reqtag) )
     1053                    $q['tag_id'] = $reqtag['term_id'];
     1054            }
     1055
     1056            $taxonomy_field = $item == 'tag_slug__and' ? 'slug' : 'term_id';
     1057
     1058            $q[$item] = array_unique($q[$item]);
     1059            $tsql = "SELECT p.ID FROM $wpdb->posts p INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) INNER JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) INNER JOIN $wpdb->terms t ON (tt.term_id = t.term_id)";
     1060            $tsql .= " WHERE tt.taxonomy = '$taxonomy' AND t.$taxonomy_field IN ('" . implode("', '", $q[$item]) . "')";
     1061            $tsql .= " GROUP BY p.ID HAVING count(p.ID) = " . count($q[$item]);
     1062
     1063            $post_ids = $wpdb->get_col($tsql);
     1064
     1065            if ( count($post_ids) )
     1066                $whichcat .= " AND $wpdb->posts.ID IN (" . implode(', ', $post_ids) . ") ";
     1067            else {
     1068                $whichcat = " AND 0 = 1";
     1069                break;
     1070            }
    10761071        }
    10771072
  • tags/2.3.1/wp-includes/script-loader.php

    r6293 r6293  
    422422    $wp_scripts->enqueue( $handle );
    423423}
     424
     425function wp_prototype_before_jquery( $js_array ) {
     426    if ( false === $jquery = array_search( 'jquery', $js_array ) )
     427        return $js_array;
     428
     429    if ( false === $prototype = array_search( 'prototype', $js_array ) )
     430        return $js_array;
     431
     432    if ( $prototype < $jquery )
     433        return $js_array;
     434
     435    unset($js_array[$prototype]);
     436
     437    array_splice( $js_array, $jquery, 0, 'prototype' );
     438
     439    return $js_array;
     440}
     441
     442add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
     443
    424444?>
  • tags/2.3.1/wp-includes/taxonomy.php

    r6293 r6293  
    13581358
    13591359    // Get the object and term ids and stick them in a lookup table
    1360     $results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships LEFT JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (".join(',', array_keys($term_ids)).") AND post_type = 'post' AND post_status = 'publish'");
     1360    $results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (".join(',', array_keys($term_ids)).") AND post_type = 'post' AND post_status = 'publish'");
    13611361    foreach ( $results as $row ) {
    13621362        $id = $term_ids[$row->term_taxonomy_id];
  • tags/2.3.1/wp-includes/version.php

    r6293 r6293  
    33// This holds the version number in a separate file so we can bump it without cluttering the SVN
    44
    5 $wp_version = '2.3';
     5$wp_version = '2.3.1';
    66$wp_db_version = 6124;
    77
  • tags/2.3.1/wp-includes/widgets.php

    r6293 r6293  
    787787
    788788    $dims = array( 'width' => 350, 'height' => 170 );
    789     $class = array( 'classname' => 'widget_catgories' );
     789    $class = array( 'classname' => 'widget_categories' );
    790790
    791791    for ( $i = 1; $i <= 9; $i++ ) {
     
    10021002    if ( $_POST["rss-submit-$number"] ) {
    10031003        $newoptions[$number]['items'] = (int) $_POST["rss-items-$number"];
    1004         $url = clean_url(strip_tags(stripslashes($_POST["rss-url-$number"])));
     1004        $url = sanitize_url(strip_tags(stripslashes($_POST["rss-url-$number"])));
    10051005        $newoptions[$number]['title'] = trim(strip_tags(stripslashes($_POST["rss-title-$number"])));
    10061006        if ( $url !== $options[$number]['url'] ) {
  • tags/2.3.1/wp-login.php

    r6293 r6293  
    2323//Set a cookie now to see if they are supported by the browser.
    2424setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
     25if ( SITECOOKIEPATH != COOKIEPATH )
     26    setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
    2527
    2628// Rather than duplicating this HTML all over the place, we'll stick it in function
  • tags/2.3.1/wp-mail.php

    r6293 r6293  
    6161            }
    6262
    63             // Set the author using the email address (To or Reply-To, the last used)
     63            // Set the author using the email address (From or Reply-To, the last used)
    6464            // otherwise use the site admin
    65             if (preg_match('/From: /', $line) | preg_match('/Reply-To: /', $line))  {
    66                 $author=trim($line);
    67                 if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) {
    68                     $author = $regs[1];
     65            if ( preg_match('/(From|Reply-To): /', $line) )  {
     66                if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) )
     67                    $author = $matches[0];
     68                else
     69                    $author = trim($line);
     70                $author = sanitize_email($author);
     71                if ( is_email($author) ) {
    6972                    echo "Author = {$author} <p>";
    7073                    $author = $wpdb->escape($author);
Note: See TracChangeset for help on using the changeset viewer.