Changes from tags/2.3.1 at r6293 to tags/2.3 at r6293
- 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(); ?>2 1 <table class="widefat"> 3 2 <thead> -
tags/2.3/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 echo attribute_escape(__('Importmt-export.txt »')); ?>" />33 <input type="submit" value="<?php _e(sprintf('Import %s', 'mt-export.txt »')); ?>" /> 34 34 </p> 35 35 </form> -
tags/2.3/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 ere added!'), $tags_added ) . '<br /></p>';160 echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags where added!'), $tags_added ) . '<br /></p>'; 161 161 162 162 echo '<form action="admin.php?import=utw&step=4" method="post">'; -
tags/2.3/wp-admin/import/wp-cat2tag.php
r6293 r6293 64 64 print '</ul>'; 65 65 66 print '<p class="submit"><input type="submit" name=" submit" value="' . __('Convert »') . '" /></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 »') . '" /></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);144 143 } 145 144 } 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 153 145 // Change the category to a tag. 154 146 $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);159 147 160 148 // Set all parents to 0 (root-level) if their parent was the converted tag … … 173 161 } 174 162 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 175 187 function init() { 176 188 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 } 178 198 179 199 $this->header(); … … 195 215 $this->convert_them(); 196 216 break; 217 218 case 3 : 219 $this->convert_all_confirm(); 220 break; 221 222 case 4 : 223 $this->convert_all(); 224 break; 197 225 } 198 226 } -
tags/2.3/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' );42 41 43 42 if ( $category->term_id != $default_cat_id ) … … 495 494 $current = ''; 496 495 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>"; 498 497 parent_dropdown( $default, $item->ID, $level +1 ); 499 498 } -
tags/2.3/wp-admin/includes/upgrade.php
r6293 r6293 534 534 // Convert categories to terms. 535 535 $tt_ids = array(); 536 $have_tags = false;537 536 $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID"); 538 537 foreach ($categories as $category) { … … 581 580 582 581 if ( !empty($category->tag_count) ) { 583 $have_tags = true;584 582 $count = (int) $category->tag_count; 585 583 $taxonomy = 'post_tag'; … … 596 594 } 597 595 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"); 603 597 foreach ( $posts as $post ) { 604 598 $post_id = (int) $post->post_id; … … 665 659 update_option('default_link_category', $default_link_cat); 666 660 } 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"); 668 662 foreach ( $links as $link ) { 669 663 $link_id = (int) $link->link_id; … … 1009 1003 // Add the column list to the index create string 1010 1004 $index_string .= ' ('.$index_columns.')'; 1005 error_log("Index string: $index_string", 0); 1011 1006 if(!(($aindex = array_search($index_string, $indices)) === false)) { 1012 1007 unset($indices[$aindex]); -
tags/2.3/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 37 34 $r = ''; 38 35 … … 43 40 if ( $href ) 44 41 $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"; 48 43 $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n"; 49 44 $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 46 46 <?php _e('Category:') ?> <select name="cat_id"> 47 47 <?php 48 $categories = get_ terms('link_category', 'get=all');48 $categories = get_categories('hide_empty=0'); 49 49 foreach ($categories as $category) { 50 50 ?> 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> 52 52 <?php 53 53 } // end foreach -
tags/2.3/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.') );8 5 9 6 if ('' != $_POST['deletebookmarks']) … … 17 14 18 15 switch ($action) { 19 case 'deletebookmarks' :16 case 'deletebookmarks' : 20 17 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?')); 21 22 22 23 //for each link id (in $linkcheck[]) change category to selected value … … 41 42 check_admin_referer('bulk-bookmarks'); 42 43 44 // check the current user's level first. 45 if (!current_user_can('manage_links')) 46 wp_die(__('Cheatin’ uh?')); 47 43 48 //for each link id (in $linkcheck[]) change category to selected value 44 49 if (count($linkcheck) == 0) { … … 59 64 add_link(); 60 65 61 wp_redirect( wp_get_referer() . '?added=true');66 wp_redirect(wp_get_referer().'?added=true'); 62 67 exit; 63 68 break; … … 77 82 check_admin_referer('delete-bookmark_' . $link_id); 78 83 84 if (!current_user_can('manage_links')) 85 wp_die(__('Cheatin’ uh?')); 86 79 87 wp_delete_link($link_id); 80 88 … … 90 98 $submenu_file = 'link-manager.php'; 91 99 $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.')); 92 103 93 104 $link_id = (int) $_GET['link_id']; … … 96 107 wp_die(__('Link not found.')); 97 108 98 include_once ('admin-header.php');99 109 include ('edit-link-form.php'); 100 include ('admin-footer.php');101 110 break; 102 111 … … 104 113 break; 105 114 } 115 116 include ('admin-footer.php'); 106 117 ?> -
tags/2.3/wp-includes/bookmark.php
r6293 r6293 114 114 if (!empty($category_query)) { 115 115 $category_query .= ") AND taxonomy = 'link_category'"; 116 $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNERJOIN $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"; 117 117 } 118 118 -
tags/2.3/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) ) || is_preview())7 if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) ) 8 8 return; 9 9 -
tags/2.3/wp-includes/default-filters.php
r6293 r6293 26 26 } 27 27 28 // SaveURL28 // URL 29 29 $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'); 40 31 foreach ( $filters as $filter ) { 41 32 add_filter($filter, 'strip_tags'); … … 137 128 // Actions 138 129 add_action('wp_head', 'rsd_link'); 139 add_action('wp_head', 'wlwmanifest_link');140 130 add_action('wp_head', 'locale_stylesheet'); 141 131 add_action('publish_future_post', 'wp_publish_post', 10, 1); -
tags/2.3/wp-includes/formatting.php
r6293 r6293 1088 1088 } 1089 1089 1090 function clean_url( $url, $protocols = null , $context = 'display') {1090 function clean_url( $url, $protocols = null ) { 1091 1091 $original_url = $url; 1092 1092 … … 1104 1104 $url = 'http://' . $url; 1105 1105 1106 // Replace ampersands ony when displaying. 1107 if ( 'display' == $context ) 1108 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1109 1106 $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url); 1110 1107 if ( !is_array($protocols) ) 1111 1108 $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'); … … 1113 1110 return ''; 1114 1111 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); 1120 1113 } 1121 1114 -
tags/2.3/wp-includes/functions.php
r6293 r6293 727 727 728 728 function wp($query_vars = '') { 729 global $wp , $wp_query, $wp_the_query;729 global $wp; 730 730 731 731 $wp->main($query_vars); 732 733 if( !isset($wp_the_query) )734 $wp_the_query = $wp_query;735 732 } 736 733 -
tags/2.3/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" /> ';835 830 } 836 831 -
tags/2.3/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 );229 228 $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); 230 229 … … 438 437 $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), $lp['host']); 439 438 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) ) 441 440 $location = get_option('siteurl') . '/wp-admin/'; 442 441 -
tags/2.3/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 , $filter);105 return get_page($post, $output); 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 , $filter);114 return get_page($_post, $output); 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 , $filter);119 return get_page($_post, $output); 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 , $filter = 'raw') {975 function &get_page(&$page, $output = OBJECT) { 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 , $filter);988 return get_post($page, $output); 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 , $filter);1001 return get_post($page, $output); 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 , $filter);1006 return get_post($_page, $output); 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);1015 1013 1016 1014 // at this point, one way or another, $_post contains the page object … … 1204 1202 1205 1203 if ( empty($pages) ) 1206 return a pply_filters('get_pages', array(), $r);1204 return array(); 1207 1205 1208 1206 // Update cache. -
tags/2.3/wp-includes/query.php
r6293 r6293 933 933 934 934 if ( !empty($q['category__in']) ) { 935 $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNERJOIN $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) "; 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 951 960 // Category stuff for nice URLs 952 961 if ( '' != $q['category_name'] ) { … … 974 983 $q['cat'] = $reqcat; 975 984 976 $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNERJOIN $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) "; 977 986 $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' "; 978 987 $in_cats = array($q['cat']); … … 1016 1025 1017 1026 if ( !empty($q['tag__in']) ) { 1018 $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNERJOIN $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) "; 1019 1028 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; 1020 1029 $include_tags = "'" . implode("', '", $q['tag__in']) . "'"; … … 1026 1035 1027 1036 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) INNERJOIN $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) "; 1029 1038 $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' "; 1030 1039 $include_tags = "'" . implode("', '", $q['tag_slug__in']) . "'"; … … 1043 1052 } 1044 1053 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']; 1071 1076 } 1072 1077 -
tags/2.3/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 444 424 ?> -
tags/2.3/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 INNERJOIN $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'"); 1361 1361 foreach ( $results as $row ) { 1362 1362 $id = $term_ids[$row->term_taxonomy_id]; -
tags/2.3/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 .1';5 $wp_version = '2.3'; 6 6 $wp_db_version = 6124; 7 7 -
tags/2.3/wp-includes/widgets.php
r6293 r6293 787 787 788 788 $dims = array( 'width' => 350, 'height' => 170 ); 789 $class = array( 'classname' => 'widget_cat egories' );789 $class = array( 'classname' => 'widget_catgories' ); 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 = sanitize_url(strip_tags(stripslashes($_POST["rss-url-$number"])));1004 $url = clean_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/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);27 25 28 26 // Rather than duplicating this HTML all over the place, we'll stick it in function -
tags/2.3/wp-mail.php
r6293 r6293 61 61 } 62 62 63 // Set the author using the email address ( Fromor Reply-To, the last used)63 // Set the author using the email address (To or Reply-To, the last used) 64 64 // 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]; 72 69 echo "Author = {$author} <p>"; 73 70 $author = $wpdb->escape($author);
Note: See TracChangeset
for help on using the changeset viewer.