Make WordPress Core

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


Ignore:
Location:
tags
Files:
2 deleted
24 edited

Legend:

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

    r6293 r6293  
    1 <?php if ( ! defined('ABSPATH') ) die(); ?>
    21<table class="widefat">
    32    <thead>
  • tags/2.3/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 echo attribute_escape(__('Import mt-export.txt &raquo;')); ?>" />
     33<input type="submit" value="<?php _e(sprintf('Import %s', 'mt-export.txt &raquo;')); ?>" />
    3434</p>
    3535</form>
  • tags/2.3/wp-admin/import/utw.php

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

    r6293 r6293  
    6464        print '</ul>';
    6565
    66         print '<p class="submit"><input type="submit" name="submit" value="' . __('Convert &raquo;') . '" /></p>';
     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>';
    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);
    144143                    }
    145144                } 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 
    153145                    // Change the category to a tag.
    154146                    $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);
    159147
    160148                    // Set all parents to 0 (root-level) if their parent was the converted tag
     
    173161    }
    174162
     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
    175187    function init() {
    176188
    177         $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
     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        }
    178198
    179199        $this->header();
     
    195215                    $this->convert_them();
    196216                break;
     217
     218                case 3 :
     219                    $this->convert_all_confirm();
     220                break;
     221
     222                case 4 :
     223                    $this->convert_all();
     224                break;
    197225            }
    198226        }
  • tags/2.3/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' );
    4241
    4342        if ( $category->term_id != $default_cat_id )
     
    495494                $current = '';
    496495
    497             echo "\n\t<option value='$item->ID'$current>$pad " . wp_specialchars($item->post_title) . "</option>";
     496            echo "\n\t<option value='$item->ID'$current>$pad $item->post_title</option>";
    498497            parent_dropdown( $default, $item->ID, $level +1 );
    499498        }
  • tags/2.3/wp-admin/includes/upgrade.php

    r6293 r6293  
    534534    // Convert categories to terms.
    535535    $tt_ids = array();
    536     $have_tags = false;
    537536    $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID");
    538537    foreach ($categories as $category) {
     
    581580
    582581        if ( !empty($category->tag_count) ) {
    583             $have_tags = true;
    584582            $count = (int) $category->tag_count;
    585583            $taxonomy = 'post_tag';
     
    596594    }
    597595
    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");
     596    $posts = $wpdb->get_results("SELECT * FROM $wpdb->post2cat");
    603597    foreach ( $posts as $post ) {
    604598        $post_id = (int) $post->post_id;
     
    665659        update_option('default_link_category', $default_link_cat);
    666660    } else {
    667         $links = $wpdb->get_results("SELECT link_id, category_id FROM $wpdb->link2cat GROUP BY link_id, category_id");
     661        $links = $wpdb->get_results("SELECT * FROM $wpdb->link2cat");
    668662        foreach ( $links as $link ) {
    669663            $link_id = (int) $link->link_id;
     
    10091003                        // Add the column list to the index create string
    10101004                        $index_string .= ' ('.$index_columns.')';
     1005                        error_log("Index string: $index_string", 0);
    10111006                        if(!(($aindex = array_search($index_string, $indices)) === false)) {
    10121007                            unset($indices[$aindex]);
  • tags/2.3/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 
    3734    $r = '';
    3835
     
    4340    if ( $href )
    4441        $r .= "</a>\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";
     42    $r .= "\t\t\t\t<span class='upload-file-size'>".size_format(filesize($filesystem_path))."</span>\n";
    4843    $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n";
    4944    $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n";
  • tags/2.3/wp-admin/link-import.php

    r6293 r6293  
    4646<?php _e('Category:') ?> <select name="cat_id">
    4747<?php
    48 $categories = get_terms('link_category', 'get=all');
     48$categories = get_categories('hide_empty=0');
    4949foreach ($categories as $category) {
    5050?>
    51 <option value="<?php echo $category->term_id; ?>"><?php echo wp_specialchars(apply_filters('link_category', $category->name)); ?></option>
     51<option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars(apply_filters('link_category', $category->cat_name)); ?></option>
    5252<?php
    5353} // end foreach
  • tags/2.3/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 
    6 if ( ! current_user_can('manage_links') )
    7     wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
    85
    96if ('' != $_POST['deletebookmarks'])
     
    1714
    1815switch ($action) {
    19     case 'deletebookmarks' :
     16        case 'deletebookmarks' :
    2017        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?'));
    2122
    2223        //for each link id (in $linkcheck[]) change category to selected value
     
    4142        check_admin_referer('bulk-bookmarks');
    4243
     44        // check the current user's level first.
     45        if (!current_user_can('manage_links'))
     46            wp_die(__('Cheatin&#8217; uh?'));
     47
    4348        //for each link id (in $linkcheck[]) change category to selected value
    4449        if (count($linkcheck) == 0) {
     
    5964        add_link();
    6065
    61         wp_redirect( wp_get_referer() . '?added=true' );
     66        wp_redirect(wp_get_referer().'?added=true');
    6267        exit;
    6368        break;
     
    7782        check_admin_referer('delete-bookmark_' . $link_id);
    7883
     84        if (!current_user_can('manage_links'))
     85            wp_die(__('Cheatin&#8217; uh?'));
     86
    7987        wp_delete_link($link_id);
    8088
     
    9098        $submenu_file = 'link-manager.php';
    9199        $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.'));
    92103
    93104        $link_id = (int) $_GET['link_id'];
     
    96107            wp_die(__('Link not found.'));
    97108
    98         include_once ('admin-header.php');
    99109        include ('edit-link-form.php');
    100         include ('admin-footer.php');
    101110        break;
    102111
     
    104113        break;
    105114}
     115
     116include ('admin-footer.php');
    106117?>
  • tags/2.3/wp-includes/bookmark.php

    r6293 r6293  
    114114    if (!empty($category_query)) {
    115115        $category_query .= ") AND taxonomy = 'link_category'";
    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";
     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";
    117117    }
    118118
  • tags/2.3/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) ) || is_preview() )
     7    if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) )
    88        return;
    99
  • tags/2.3/wp-includes/default-filters.php

    r6293 r6293  
    2626}
    2727
    28 // Save URL
     28// URL
    2929$filters = array('pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image',
    30     'pre_link_rss');
    31 foreach ( $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');
     30    'pre_link_rss', 'comment_url');
    4031foreach ( $filters as $filter ) {
    4132    add_filter($filter, 'strip_tags');
     
    137128// Actions
    138129add_action('wp_head', 'rsd_link');
    139 add_action('wp_head', 'wlwmanifest_link');
    140130add_action('wp_head', 'locale_stylesheet');
    141131add_action('publish_future_post', 'wp_publish_post', 10, 1);
  • tags/2.3/wp-includes/formatting.php

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

    r6293 r6293  
    727727
    728728function wp($query_vars = '') {
    729     global $wp, $wp_query, $wp_the_query;
     729    global $wp;
    730730
    731731    $wp->main($query_vars);
    732 
    733     if( !isset($wp_the_query) )
    734         $wp_the_query = $wp_query;
    735732}
    736733
  • tags/2.3/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 
    832 function wlwmanifest_link() {
    833     echo ' <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="'
    834         . get_bloginfo('wpurl') . '/wp-includes/wlwmanifest.xml" /> ';
    835830}
    836831
  • tags/2.3/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 );
    229228    $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
    230229
     
    438437    $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), $lp['host']);
    439438
    440     if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
     439    if ( isset($lp['host']) && !in_array($lp['host'], $allowed_hosts) )
    441440        $location = get_option('siteurl') . '/wp-admin/';
    442441
  • tags/2.3/wp-includes/post.php

    r6293 r6293  
    103103    } elseif ( is_object($post) ) {
    104104        if ( 'page' == $post->post_type )
    105             return get_page($post, $output, $filter);
     105            return get_page($post, $output);
    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, $filter);
     114            return get_page($_post, $output);
    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, $filter);
     119                return get_page($_post, $output);
    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, $filter = 'raw') {
     975function &get_page(&$page, $output = OBJECT) {
    976976    global $wpdb, $blog_id;
    977977
     
    986986    } elseif ( is_object($page) ) {
    987987        if ( 'post' == $page->post_type )
    988             return get_post($page, $output, $filter);
     988            return get_post($page, $output);
    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, $filter);
     1001                return get_post($page, $output);
    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, $filter);
     1006                    return get_post($_page, $output);
    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);
    10151013
    10161014    // at this point, one way or another, $_post contains the page object
     
    12041202
    12051203    if ( empty($pages) )
    1206         return apply_filters('get_pages', array(), $r);
     1204        return array();
    12071205
    12081206    // Update cache.
  • tags/2.3/wp-includes/query.php

    r6293 r6293  
    933933
    934934        if ( !empty($q['category__in']) ) {
    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) ";
     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) ";
    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
    951960        // Category stuff for nice URLs
    952961        if ( '' != $q['category_name'] ) {
     
    974983            $q['cat'] = $reqcat;
    975984
    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) ";
     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) ";
    977986            $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
    978987            $in_cats = array($q['cat']);
     
    10161025
    10171026        if ( !empty($q['tag__in']) ) {
    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) ";
     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) ";
    10191028            $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' ";
    10201029            $include_tags = "'" . implode("', '", $q['tag__in']) . "'";
     
    10261035
    10271036        if ( !empty($q['tag_slug__in']) ) {
    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) ";
     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) ";
    10291038            $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' ";
    10301039            $include_tags = "'" . implode("', '", $q['tag_slug__in']) . "'";
     
    10431052        }
    10441053
    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             }
     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'];
    10711076        }
    10721077
  • tags/2.3/wp-includes/script-loader.php

    r6293 r6293  
    422422    $wp_scripts->enqueue( $handle );
    423423}
    424 
    425 function 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 
    442 add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
    443 
    444424?>
  • tags/2.3/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 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'");
     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'");
    13611361    foreach ( $results as $row ) {
    13621362        $id = $term_ids[$row->term_taxonomy_id];
  • tags/2.3/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.1';
     5$wp_version = '2.3';
    66$wp_db_version = 6124;
    77
  • tags/2.3/wp-includes/widgets.php

    r6293 r6293  
    787787
    788788    $dims = array( 'width' => 350, 'height' => 170 );
    789     $class = array( 'classname' => 'widget_categories' );
     789    $class = array( 'classname' => 'widget_catgories' );
    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 = sanitize_url(strip_tags(stripslashes($_POST["rss-url-$number"])));
     1004        $url = clean_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/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);
    25 if ( SITECOOKIEPATH != COOKIEPATH )
    26     setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
    2725
    2826// Rather than duplicating this HTML all over the place, we'll stick it in function
  • tags/2.3/wp-mail.php

    r6293 r6293  
    6161            }
    6262
    63             // Set the author using the email address (From or Reply-To, the last used)
     63            // Set the author using the email address (To or Reply-To, the last used)
    6464            // otherwise use the site admin
    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) ) {
     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];
    7269                    echo "Author = {$author} <p>";
    7370                    $author = $wpdb->escape($author);
Note: See TracChangeset for help on using the changeset viewer.