Changes from tags/2.3 at r6293 to tags/2.3.1 at r6293
- 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(); ?> 1 2 <table class="widefat"> 2 3 <thead> -
tags/2.3.1/wp-admin/import/mt.php
r6293 r6293 31 31 <?php _e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory'); ?></p> 32 32 <p class="submit"> 33 <input type="submit" value="<?php _e(sprintf('Import %s', 'mt-export.txt »')); ?>" />33 <input type="submit" value="<?php echo attribute_escape(__('Import mt-export.txt »')); ?>" /> 34 34 </p> 35 35 </form> -
tags/2.3.1/wp-admin/import/utw.php
r6293 r6293 158 158 $tags_added = $this->tag2post(); 159 159 160 echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags w here added!'), $tags_added ) . '<br /></p>';160 echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were added!'), $tags_added ) . '<br /></p>'; 161 161 162 162 echo '<form action="admin.php?import=utw&step=4" method="post">'; -
tags/2.3.1/wp-admin/import/wp-cat2tag.php
r6293 r6293 64 64 print '</ul>'; 65 65 66 print '<p class="submit"><input type="submit" name=" maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert »') . '" /></p>';66 print '<p class="submit"><input type="submit" name="submit" value="' . __('Convert »') . '" /></p>'; 67 67 print '</form>'; 68 68 } … … 141 141 if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") ) 142 142 $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post', '$id')"); 143 clean_post_cache($post); 143 144 } 144 145 } 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 145 153 // Change the category to a tag. 146 154 $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); 147 159 148 160 // Set all parents to 0 (root-level) if their parent was the converted tag … … 161 173 } 162 174 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" /> <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 187 175 function init() { 188 176 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; 198 178 199 179 $this->header(); … … 215 195 $this->convert_them(); 216 196 break; 217 218 case 3 :219 $this->convert_all_confirm();220 break;221 222 case 4 :223 $this->convert_all();224 break;225 197 } 226 198 } -
tags/2.3.1/wp-admin/includes/template.php
r6293 r6293 39 39 $edit = "<a href='categories.php?action=edit&cat_ID=$category->term_id' class='edit'>".__( 'Edit' )."</a></td>"; 40 40 $default_cat_id = (int) get_option( 'default_category' ); 41 $default_link_cat_id = (int) get_option( 'default_link_category' ); 41 42 42 43 if ( $category->term_id != $default_cat_id ) … … 494 495 $current = ''; 495 496 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>"; 497 498 parent_dropdown( $default, $item->ID, $level +1 ); 498 499 } -
tags/2.3.1/wp-admin/includes/upgrade.php
r6293 r6293 534 534 // Convert categories to terms. 535 535 $tt_ids = array(); 536 $have_tags = false; 536 537 $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID"); 537 538 foreach ($categories as $category) { … … 580 581 581 582 if ( !empty($category->tag_count) ) { 583 $have_tags = true; 582 584 $count = (int) $category->tag_count; 583 585 $taxonomy = 'post_tag'; … … 594 596 } 595 597 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"); 597 603 foreach ( $posts as $post ) { 598 604 $post_id = (int) $post->post_id; … … 659 665 update_option('default_link_category', $default_link_cat); 660 666 } 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"); 662 668 foreach ( $links as $link ) { 663 669 $link_id = (int) $link->link_id; … … 1003 1009 // Add the column list to the index create string 1004 1010 $index_string .= ' ('.$index_columns.')'; 1005 error_log("Index string: $index_string", 0);1006 1011 if(!(($aindex = array_search($index_string, $indices)) === false)) { 1007 1012 unset($indices[$aindex]); -
tags/2.3.1/wp-admin/includes/upload.php
r6293 r6293 32 32 $src_base = str_replace($src, '', $src_base); 33 33 34 if ( !trim($post_title) ) 35 $post_title = basename($src); 36 34 37 $r = ''; 35 38 … … 40 43 if ( $href ) 41 44 $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"; 43 48 $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n"; 44 49 $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 46 46 <?php _e('Category:') ?> <select name="cat_id"> 47 47 <?php 48 $categories = get_ categories('hide_empty=0');48 $categories = get_terms('link_category', 'get=all'); 49 49 foreach ($categories as $category) { 50 50 ?> 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> 52 52 <?php 53 53 } // end foreach -
tags/2.3.1/wp-admin/link.php
r6293 r6293 3 3 4 4 wp_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.') ); 5 8 6 9 if ('' != $_POST['deletebookmarks']) … … 14 17 15 18 switch ($action) { 16 19 case 'deletebookmarks' : 17 20 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’ uh?'));22 21 23 22 //for each link id (in $linkcheck[]) change category to selected value … … 42 41 check_admin_referer('bulk-bookmarks'); 43 42 44 // check the current user's level first.45 if (!current_user_can('manage_links'))46 wp_die(__('Cheatin’ uh?'));47 48 43 //for each link id (in $linkcheck[]) change category to selected value 49 44 if (count($linkcheck) == 0) { … … 64 59 add_link(); 65 60 66 wp_redirect( wp_get_referer().'?added=true');61 wp_redirect( wp_get_referer() . '?added=true' ); 67 62 exit; 68 63 break; … … 82 77 check_admin_referer('delete-bookmark_' . $link_id); 83 78 84 if (!current_user_can('manage_links'))85 wp_die(__('Cheatin’ uh?'));86 87 79 wp_delete_link($link_id); 88 80 … … 98 90 $submenu_file = 'link-manager.php'; 99 91 $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.'));103 92 104 93 $link_id = (int) $_GET['link_id']; … … 107 96 wp_die(__('Link not found.')); 108 97 98 include_once ('admin-header.php'); 109 99 include ('edit-link-form.php'); 100 include ('admin-footer.php'); 110 101 break; 111 102 … … 113 104 break; 114 105 } 115 116 include ('admin-footer.php');117 106 ?> -
tags/2.3.1/wp-includes/bookmark.php
r6293 r6293 114 114 if (!empty($category_query)) { 115 115 $category_query .= ") AND taxonomy = 'link_category'"; 116 $join = " LEFT JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) LEFTJOIN $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"; 117 117 } 118 118 -
tags/2.3.1/wp-includes/canonical.php
r6293 r6293 5 5 global $wp_rewrite, $posts, $is_IIS; 6 6 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() ) 8 8 return; 9 9 -
tags/2.3.1/wp-includes/default-filters.php
r6293 r6293 26 26 } 27 27 28 // URL28 // Save URL 29 29 $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'); 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'); 31 40 foreach ( $filters as $filter ) { 32 41 add_filter($filter, 'strip_tags'); … … 128 137 // Actions 129 138 add_action('wp_head', 'rsd_link'); 139 add_action('wp_head', 'wlwmanifest_link'); 130 140 add_action('wp_head', 'locale_stylesheet'); 131 141 add_action('publish_future_post', 'wp_publish_post', 10, 1); -
tags/2.3.1/wp-includes/formatting.php
r6293 r6293 1088 1088 } 1089 1089 1090 function clean_url( $url, $protocols = null ) {1090 function clean_url( $url, $protocols = null, $context = 'display' ) { 1091 1091 $original_url = $url; 1092 1092 … … 1104 1104 $url = 'http://' . $url; 1105 1105 1106 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1106 // Replace ampersands ony when displaying. 1107 if ( 'display' == $context ) 1108 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1109 1107 1110 if ( !is_array($protocols) ) 1108 1111 $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); … … 1110 1113 return ''; 1111 1114 1112 return apply_filters('clean_url', $url, $original_url); 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'); 1113 1120 } 1114 1121 -
tags/2.3.1/wp-includes/functions.php
r6293 r6293 727 727 728 728 function wp($query_vars = '') { 729 global $wp ;729 global $wp, $wp_query, $wp_the_query; 730 730 731 731 $wp->main($query_vars); 732 733 if( !isset($wp_the_query) ) 734 $wp_the_query = $wp_query; 732 735 } 733 736 -
tags/2.3.1/wp-includes/general-template.php
r6293 r6293 828 828 function rsd_link() { 829 829 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" /> '; 830 835 } 831 836 -
tags/2.3.1/wp-includes/pluggable.php
r6293 r6293 226 226 // Set the from name and email 227 227 $phpmailer->From = apply_filters( 'wp_mail_from', $from_email ); 228 $phpmailer->Sender = apply_filters( 'wp_mail_from', $from_email ); 228 229 $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); 229 230 … … 437 438 $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), $lp['host']); 438 439 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'])) ) 440 441 $location = get_option('siteurl') . '/wp-admin/'; 441 442 -
tags/2.3.1/wp-includes/post.php
r6293 r6293 103 103 } elseif ( is_object($post) ) { 104 104 if ( 'page' == $post->post_type ) 105 return get_page($post, $output );105 return get_page($post, $output, $filter); 106 106 if ( !isset($post_cache[$blog_id][$post->ID]) ) 107 107 $post_cache[$blog_id][$post->ID] = &$post; … … 112 112 $_post = & $post_cache[$blog_id][$post]; 113 113 elseif ( $_post = wp_cache_get($post, 'pages') ) 114 return get_page($_post, $output );114 return get_page($_post, $output, $filter); 115 115 else { 116 116 $query = "SELECT * FROM $wpdb->posts WHERE ID = '$post' LIMIT 1"; 117 117 $_post = & $wpdb->get_row($query); 118 118 if ( 'page' == $_post->post_type ) 119 return get_page($_post, $output );119 return get_page($_post, $output, $filter); 120 120 $post_cache[$blog_id][$post] = & $_post; 121 121 } … … 973 973 // Retrieves page data given a page ID or page object. 974 974 // Handles page caching. 975 function &get_page(&$page, $output = OBJECT ) {975 function &get_page(&$page, $output = OBJECT, $filter = 'raw') { 976 976 global $wpdb, $blog_id; 977 977 … … 986 986 } elseif ( is_object($page) ) { 987 987 if ( 'post' == $page->post_type ) 988 return get_post($page, $output );988 return get_post($page, $output, $filter); 989 989 wp_cache_add($page->ID, $page, 'pages'); 990 990 $_page = $page; … … 999 999 wp_cache_add($_page->ID, $_page, 'pages'); 1000 1000 } 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); 1002 1002 } else { // it's not in any caches, so off to the DB we go 1003 1003 // Why are we using assignment for this query? 1004 1004 $_page = & $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1"); 1005 1005 if ( 'post' == $_page->post_type ) 1006 return get_post($_page, $output );1006 return get_post($_page, $output, $filter); 1007 1007 // Potential issue: we're not checking to see if the post_type = 'page' 1008 1008 // So all non-'post' posts will get cached as pages. … … 1011 1011 } 1012 1012 } 1013 1014 $_page = sanitize_post($_page, $filter); 1013 1015 1014 1016 // at this point, one way or another, $_post contains the page object … … 1202 1204 1203 1205 if ( empty($pages) ) 1204 return a rray();1206 return apply_filters('get_pages', array(), $r); 1205 1207 1206 1208 // Update cache. -
tags/2.3.1/wp-includes/query.php
r6293 r6293 933 933 934 934 if ( !empty($q['category__in']) ) { 935 $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFTJOIN $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) "; 936 936 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' "; 937 937 $include_cats = "'" . implode("', '", $q['category__in']) . "'"; … … 949 949 } 950 950 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 960 951 // Category stuff for nice URLs 961 952 if ( '' != $q['category_name'] ) { … … 983 974 $q['cat'] = $reqcat; 984 975 985 $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFTJOIN $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) "; 986 977 $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' "; 987 978 $in_cats = array($q['cat']); … … 1025 1016 1026 1017 if ( !empty($q['tag__in']) ) { 1027 $join = " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFTJOIN $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) "; 1028 1019 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; 1029 1020 $include_tags = "'" . implode("', '", $q['tag__in']) . "'"; … … 1035 1026 1036 1027 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) LEFTJOIN $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) "; 1038 1029 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; 1039 1030 $include_tags = "'" . implode("', '", $q['tag_slug__in']) . "'"; … … 1052 1043 } 1053 1044 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 } 1076 1071 } 1077 1072 -
tags/2.3.1/wp-includes/script-loader.php
r6293 r6293 422 422 $wp_scripts->enqueue( $handle ); 423 423 } 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 424 444 ?> -
tags/2.3.1/wp-includes/taxonomy.php
r6293 r6293 1358 1358 1359 1359 // 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 LEFTJOIN $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'"); 1361 1361 foreach ( $results as $row ) { 1362 1362 $id = $term_ids[$row->term_taxonomy_id]; -
tags/2.3.1/wp-includes/version.php
r6293 r6293 3 3 // This holds the version number in a separate file so we can bump it without cluttering the SVN 4 4 5 $wp_version = '2.3 ';5 $wp_version = '2.3.1'; 6 6 $wp_db_version = 6124; 7 7 -
tags/2.3.1/wp-includes/widgets.php
r6293 r6293 787 787 788 788 $dims = array( 'width' => 350, 'height' => 170 ); 789 $class = array( 'classname' => 'widget_cat gories' );789 $class = array( 'classname' => 'widget_categories' ); 790 790 791 791 for ( $i = 1; $i <= 9; $i++ ) { … … 1002 1002 if ( $_POST["rss-submit-$number"] ) { 1003 1003 $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"]))); 1005 1005 $newoptions[$number]['title'] = trim(strip_tags(stripslashes($_POST["rss-title-$number"]))); 1006 1006 if ( $url !== $options[$number]['url'] ) { -
tags/2.3.1/wp-login.php
r6293 r6293 23 23 //Set a cookie now to see if they are supported by the browser. 24 24 setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); 25 if ( SITECOOKIEPATH != COOKIEPATH ) 26 setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); 25 27 26 28 // Rather than duplicating this HTML all over the place, we'll stick it in function -
tags/2.3.1/wp-mail.php
r6293 r6293 61 61 } 62 62 63 // Set the author using the email address ( Toor Reply-To, the last used)63 // Set the author using the email address (From or Reply-To, the last used) 64 64 // 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) ) { 69 72 echo "Author = {$author} <p>"; 70 73 $author = $wpdb->escape($author);
Note: See TracChangeset
for help on using the changeset viewer.