Changeset 915
- Timestamp:
- 03/12/07 23:03:30 (2 years ago)
- Files:
-
- trunk/wp-admin/admin-functions.php (modified) (2 diffs)
- trunk/wp-admin/categories.php (modified) (1 diff)
- trunk/wp-admin/edit-comments.php (modified) (1 diff)
- trunk/wp-admin/index.php (modified) (1 diff)
- trunk/wp-admin/link-import.php (modified) (1 diff)
- trunk/wp-admin/link-manager.php (modified) (3 diffs)
- trunk/wp-admin/rtl.css (modified) (4 diffs)
- trunk/wp-admin/wpmu-blogs.php (modified) (1 diff)
- trunk/wp-includes/bookmark-template.php (modified) (2 diffs)
- trunk/wp-includes/category-template.php (modified) (1 diff)
- trunk/wp-includes/classes.php (modified) (2 diffs)
- trunk/wp-includes/comment-template.php (modified) (1 diff)
- trunk/wp-includes/feed.php (modified) (2 diffs)
- trunk/wp-includes/formatting.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (3 diffs)
- trunk/wp-includes/general-template.php (modified) (2 diffs)
- trunk/wp-includes/link-template.php (modified) (9 diffs)
- trunk/wp-includes/post-template.php (modified) (2 diffs)
- trunk/wp-includes/post.php (modified) (2 diffs)
- trunk/wp-includes/theme.php (modified) (1 diff)
- trunk/wp-includes/vars.php (modified) (1 diff)
- trunk/wp-links-opml.php (modified) (1 diff)
- trunk/xmlrpc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/admin-functions.php
r909 r915 710 710 function write_nested_categories( $categories ) { 711 711 foreach ( $categories as $category ) { 712 echo '<li id="category-', $category['cat_ID'], '"><label for="in-category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="in-category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : "" ), '/> ', wp_specialchars( $category['cat_name']), "</label></li>";712 echo '<li id="category-', $category['cat_ID'], '"><label for="in-category-', $category['cat_ID'], '" class="selectit"><input value="', $category['cat_ID'], '" type="checkbox" name="post_category[]" id="in-category-', $category['cat_ID'], '"', ($category['checked'] ? ' checked="checked"' : "" ), '/> ', wp_specialchars( apply_filters('the_category', $category['cat_name'] )), "</label></li>"; 713 713 714 714 if ( $category['children'] ) { … … 770 770 // Dandy new recursive multiple category stuff. 771 771 function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { 772 global $wpdb , $class;772 global $wpdb; 773 773 774 774 if (!$categories ) trunk/wp-admin/categories.php
r829 r915 115 115 <?php if ( current_user_can('manage_categories') ) : ?> 116 116 <div class="wrap"> 117 <p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts and links in that category. Instead, posts in the deleted category are set to the category <strong>%s</strong> and links are set to <strong>%s</strong>.'), get_catname(get_option('default_category')), get_catname(get_option('default_link_category'))) ?></p>117 <p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts and links in that category. Instead, posts in the deleted category are set to the category <strong>%s</strong> and links are set to <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category'))), apply_filters('the_category', get_catname(get_option('default_link_category')))) ?></p> 118 118 </div> 119 119 trunk/wp-admin/edit-comments.php
r909 r915 169 169 $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 170 170 ?> 171 | <a href="<?php echo get_permalink($comment->comment_post_ID); ?>" title="<?php echo $post_title; ?>"><?php _e('View Post') ?></a> ]</p>171 ] — <a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php echo $post_title; ?></a></p> 172 172 </li> 173 173 trunk/wp-admin/index.php
r899 r915 51 51 if ( $comments ) { 52 52 foreach ($comments as $comment) { 53 echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>');53 echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . apply_filters('the_title', get_the_title($comment->comment_post_ID)) . '</a>'); 54 54 edit_comment_link(__("Edit"), ' <small>(', ')</small>'); 55 55 echo '</li>'; trunk/wp-admin/link-import.php
r904 r915 49 49 foreach ($categories as $category) { 50 50 ?> 51 <option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars( $category->cat_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 trunk/wp-admin/link-manager.php
r832 r915 81 81 $select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('All') . "</option>\n"; 82 82 foreach ((array) $categories as $cat) 83 $select_cat .= '<option value="' . $cat->cat_ID . '"' . (($cat->cat_ID == $cat_id) ? " selected='selected'" : '') . '>' . wp_specialchars( $cat->cat_name) . "</option>\n";83 $select_cat .= '<option value="' . $cat->cat_ID . '"' . (($cat->cat_ID == $cat_id) ? " selected='selected'" : '') . '>' . wp_specialchars(apply_filters('link_category', $cat->cat_name)) . "</option>\n"; 84 84 $select_cat .= "</select>\n"; 85 85 … … 132 132 <?php 133 133 foreach ($links as $link) { 134 $link->link_name = attribute_escape( $link->link_name);135 $link->link_description = wp_specialchars( $link->link_description);134 $link->link_name = attribute_escape(apply_filters('link_title', $link->link_name)); 135 $link->link_description = wp_specialchars(apply_filters('link_description', $link->link_description)); 136 136 $link->link_url = attribute_escape($link->link_url); 137 137 $link->link_category = wp_get_link_cats($link->link_id); … … 161 161 foreach ($link->link_category as $category) { 162 162 $cat_name = get_the_category_by_ID($category); 163 $cat_name = wp_specialchars( $cat_name);163 $cat_name = wp_specialchars(apply_filters('link_category', $cat_name)); 164 164 if ( $cat_id != $category ) 165 165 $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>"; trunk/wp-admin/rtl.css
r804 r915 43 43 #adminmenu { 44 44 padding: .2em 2em .3em .2em; 45 height: 30px;45 height: 28px; 46 46 } 47 48 #adminmenu li { line-height: 160%; } 47 49 48 50 #adminmenu a { … … 57 59 } 58 60 59 # adminmenu li { line-height: 180%; }61 #submenu, #minisub { padding: 1px 3em 0 2em; } 60 62 61 #submenu, #minisub { padding: 3px 3em 0 2em; } 63 #submenu { height: 28px; } 64 65 #submenu li { line-height: 160%; } 66 67 #submenu a { 68 margin: 0 0 0 10px; 69 display: block; 70 float: right; 71 } 62 72 63 73 #submenu .current { … … 65 75 border-left: 2px solid #045290; 66 76 } 67 68 #submenu a {69 padding: .3em .4em .4em .4em;70 margin: 0 0 0 10px;71 display: block;72 float: right;73 }74 75 #submenu li { line-height: 120%; }76 77 77 78 #currenttheme img { … … 91 92 } 92 93 93 * html #postexcerpt .dbx-toggle-open, * html #postexcerpt .dbx-toggle-open, #postexcerpt div, #attachmentlinks div { 94 #postexcerpt div, #attachmentlinks div { 95 margin-right: auto; 96 margin-left: 8px; 97 } 98 99 * html #postexcerpt .dbx-toggle-open { 94 100 padding-right: 0; 95 101 padding-left: 8px; trunk/wp-admin/wpmu-blogs.php
r884 r915 79 79 <?php 80 80 while( list( $key, $val ) = each( $options ) ) { 81 $kellog = @unserialize( $val[ 'option_value' ] ); 82 if( is_array( $kellog ) ) { 83 print '<tr valign="top"> 84 <th scope="row">' . ucwords( str_replace( "_", " ", $val[ 'option_name' ] ) ) . '</th> 85 <td>'; 86 print '<textarea rows="5" cols="40" disabled>'; 87 reset( $kellog ); 88 while( list( $key, $val ) = each( $kellog ) ) 89 { 90 if( is_array( $val ) ) { 91 print "$key:\n"; 92 while( list( $k, $v ) = each( $val ) ) { 93 if( is_array( $v ) ) { 94 print " $k:\n"; 95 while( list( $k1, $v1 ) = each( $v ) ) { 96 print " $k1 -> $v1\n"; 97 } 98 } else { 99 if( $v1 != '' ) 100 print " $k1 -> $v1\n"; 101 } 102 } 103 } else { 104 if( $val != '' ) 105 print "$key -> $val\n"; 106 } 107 } 108 print '</textarea></td></tr>'; 109 } else { 110 ?> 111 <tr valign="top"> 112 <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val[ 'option_name' ] ) ) ?></th> 113 <td><input name="option[<?php echo $val[ 'option_name' ] ?>]" type="text" id="<?php echo $val[ 'option_name' ] ?>" value="<?php echo wp_specialchars( stripslashes( $val[ 'option_value' ] ), 1 ) ?>" size="40" /></td> 114 </tr> 115 <?php 81 $disabled = ''; 82 if ( is_serialized($val[ 'option_value' ]) ) { 83 if ( is_serialized_string($val[ 'option_value' ]) ) { 84 $val[ 'option_value' ] = wp_specialchars(maybe_unserialize($val[ 'option_value' ]), 'single'); 85 } else { 86 $val[ 'option_value' ] = "SERIALIZED DATA"; 87 $disabled = ' disabled="disabled"'; 88 } 116 89 } 90 ?> 91 <tr valign="top"> 92 <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val[ 'option_name' ] ) ) ?></th> 93 <td><input name="option[<?php echo $val[ 'option_name' ] ?>]" type="text" id="<?php echo $val[ 'option_name' ] ?>" value="<?php echo wp_specialchars( stripslashes( $val[ 'option_value' ] ), 1 ) ?>" size="40" <?php echo $disabled ?>/></td> 94 </tr> 95 <?php 117 96 } 118 97 ?> trunk/wp-includes/bookmark-template.php
r909 r915 267 267 $rel = ' rel="' . $rel . '"'; 268 268 269 $desc = attribute_escape( $bookmark->link_description);270 $name = attribute_escape($bookmark->link_name); 271 $title = $desc;269 $desc = attribute_escape(apply_filters('link_description', $bookmark->link_description)); 270 $name = attribute_escape(apply_filters('link_title', $bookmark->link_name)); 271 $title = $desc; 272 272 273 273 if ( $show_updated ) … … 337 337 continue; 338 338 $output .= str_replace(array('%id', '%class'), array("linkcat-$cat->cat_ID", $class), $category_before); 339 $output .= "$title_before$cat->cat_name$title_after\n\t<ul>\n"; 339 $catname = apply_filters( "link_category", $cat->cat_name ); 340 $output .= "$title_before$catname$title_after\n\t<ul>\n"; 340 341 $output .= _walk_bookmarks($bookmarks, $r); 341 342 $output .= "\n\t</ul>\n$category_after\n"; trunk/wp-includes/category-template.php
r904 r915 39 39 40 40 $catlink = str_replace('%category%', $category_nicename, $catlink); 41 $catlink = get_option('home') . user_trailingslashit($catlink );41 $catlink = get_option('home') . user_trailingslashit($catlink, 'category'); 42 42 } 43 43 return apply_filters('category_link', $catlink, $category_id); trunk/wp-includes/classes.php
r909 r915 581 581 582 582 $cat_name = attribute_escape( $category->cat_name); 583 $cat_name = apply_filters( 'list_cats', $cat_name, $category ); 583 584 $link = '<a href="' . get_category_link( $category->cat_ID ) . '" '; 584 585 if ( $use_desc_for_title == 0 || empty($category->category_description) ) … … 587 588 $link .= 'title="' . attribute_escape( apply_filters( 'category_description', $category->category_description, $category )) . '"'; 588 589 $link .= '>'; 589 $link .= apply_filters( 'list_cats', $category->cat_name, $category ).'</a>';590 $link .= $cat_name . '</a>'; 590 591 591 592 if ( (! empty($feed_image)) || (! empty($feed)) ) { trunk/wp-includes/comment-template.php
r909 r915 227 227 228 228 if ( '' != get_option('permalink_structure') ) 229 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback' );229 $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback'); 230 230 231 231 return $tb_url; trunk/wp-includes/feed.php
r909 r915 114 114 } else { 115 115 $link = get_author_posts_url($author_id, $author_nicename); 116 $link = $link . user_trailingslashit('feed' );116 $link = $link . user_trailingslashit('feed', 'feed'); 117 117 } 118 118 … … 132 132 } else { 133 133 $link = get_category_link($cat_ID); 134 $link = $link . user_trailingslashit('feed /');134 $link = $link . user_trailingslashit('feed', 'feed'); 135 135 } 136 136 trunk/wp-includes/formatting.php
r909 r915 564 564 565 565 function trailingslashit($string) { 566 if ( '/' != substr($string, -1)) { 567 $string .= '/'; 568 } 569 return $string; 566 return untrailingslashit($string) . '/'; 567 } 568 569 function untrailingslashit($string) { 570 return rtrim($string, '/'); 570 571 } 571 572 trunk/wp-includes/functions.php
r909 r915 1114 1114 } 1115 1115 1116 function wp_upload_bits($name, $type, $bits , $overwrite = false) {1116 function wp_upload_bits($name, $type, $bits) { 1117 1117 if ( empty($name) ) 1118 1118 return array('error' => __("Empty filename")); … … 1142 1142 } 1143 1143 1144 // If we are asked to over write the file then make sure 1145 // the $name has the complete path and is writable. 1146 if($overwrite) { 1147 if(!is_writable($name)) { 1148 return(array("error" => __("Can not over write file."))); 1149 } 1150 $new_file = $name; 1151 $filename = basename($name); 1152 } 1153 else { 1154 $new_file = $upload['path'] . "/$filename"; 1155 if ( ! wp_mkdir_p( dirname($new_file) ) ) { 1156 $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), dirname($new_file)); 1157 return array('error' => $message); 1158 } 1144 $new_file = $upload['path'] . "/$filename"; 1145 if ( ! wp_mkdir_p( dirname($new_file) ) ) { 1146 $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), dirname($new_file)); 1147 return array('error' => $message); 1159 1148 } 1160 1149 … … 1171 1160 @ chmod($new_file, $perms); 1172 1161 1173 // Compute the URL if this is a new file.1162 // Compute the URL 1174 1163 $url = $upload['url'] . "/$filename"; 1175 if($overwrite) {1176 $url = $name;1177 }1178 1164 1179 1165 return array('file' => $new_file, 'url' => $url, 'error' => false); trunk/wp-includes/general-template.php
r909 r915 216 216 if ( is_single() || is_page() ) { 217 217 $post = $wp_query->get_queried_object(); 218 $title = apply_filters('single_post_title', $title); 218 219 $title = strip_tags($post->post_title); 219 $title = apply_filters('single_post_title', $title);220 220 } 221 221 … … 583 583 if ( $ak_post_titles ) { 584 584 foreach ( $ak_post_titles as $ak_post_title ) { 585 586 $post_title = apply_filters( "the_title", $ak_post_title->post_title ); 587 $post_title = str_replace('"', '"', wptexturize( $post_title )); 588 585 589 if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) 586 590 $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; 587 591 if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one 588 $ak_titles_for_day["$ak_post_title->dom"] = str_replace('"', '"', wptexturize($ak_post_title->post_title));592 $ak_titles_for_day["$ak_post_title->dom"] = $post_title; 589 593 else 590 $ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . str_replace('"', '"', wptexturize($ak_post_title->post_title));594 $ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . $post_title; 591 595 } 592 596 } trunk/wp-includes/link-template.php
r909 r915 17 17 * @global object Uses $wp_rewrite 18 18 * @param $string string a URL with or without a trailing slash 19 * @param $type_of_url string the type of URL being considered (e.g. single, category, etc) for use in the filter 19 20 * @return string 20 21 */ 21 function user_trailingslashit($string ) {22 function user_trailingslashit($string, $type_of_url = '') { 22 23 global $wp_rewrite; 23 24 if ( $wp_rewrite->use_trailing_slashes ) 24 25 $string = trailingslashit($string); 25 26 else 26 $string = preg_replace('|/$|', '', $string); // untrailing slash 27 $string = untrailingslashit($string); 28 29 // Note that $type_of_url can be one of following: 30 // single, single_trackback, single_feed, single_paged, feed, category, page, year, month, day, paged 31 $string = apply_filters('user_trailingslashit', $string, $type_of_url); 27 32 return $string; 28 33 } … … 95 100 $post->post_name, 96 101 ); 97 return apply_filters('post_link', get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink), $post); 102 $permalink = get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink); 103 $permalink = user_trailingslashit($permalink, 'single'); 104 return apply_filters('post_link', $permalink, $post); 98 105 } else { // if they're not using the fancy permalink option 99 106 $permalink = get_option('home') . '/?p=' . $post->ID; … … 135 142 $link = str_replace('%pagename%', $link, $pagestruct); 136 143 $link = get_option('home') . "/$link"; 137 $link = user_trailingslashit($link );144 $link = user_trailingslashit($link, 'page'); 138 145 } else { 139 146 $link = get_option('home') . "/?page_id=$id"; … … 177 184 if ( !empty($yearlink) ) { 178 185 $yearlink = str_replace('%year%', $year, $yearlink); 179 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink ), $year);186 return apply_filters('year_link', get_option('home') . user_trailingslashit($yearlink, 'year'), $year); 180 187 } else { 181 188 return apply_filters('year_link', get_option('home') . '/?m=' . $year, $year); … … 193 200 $monthlink = str_replace('%year%', $year, $monthlink); 194 201 $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 195 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink ), $year, $month);202 return apply_filters('month_link', get_option('home') . user_trailingslashit($monthlink, 'month'), $year, $month); 196 203 } else { 197 204 return apply_filters('month_link', get_option('home') . '/?m=' . $year . zeroise($month, 2), $year, $month); … … 213 220 $daylink = str_replace('%monthnum%', zeroise(intval($month), 2), $daylink); 214 221 $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 215 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink ), $year, $month, $day);222 return apply_filters('day_link', get_option('home') . user_trailingslashit($daylink, 'day'), $year, $month, $day); 216 223 } else { 217 224 return apply_filters('day_link', get_option('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day); … … 237 244 $permalink = str_replace('%feed%', $feed, $permalink); 238 245 $permalink = preg_replace('#/+#', '/', "/$permalink"); 239 $output = get_option('home') . user_trailingslashit($permalink );246 $output = get_option('home') . user_trailingslashit($permalink, 'feed'); 240 247 } else { 241 248 if ( false !== strpos($feed, 'comments_') ) … … 258 265 if ( 'rss2' != $feed ) 259 266 $url .= "/$feed"; 260 $url = user_trailingslashit($url );267 $url = user_trailingslashit($url, 'single_feed'); 261 268 } else { 262 269 $url = get_option('home') . "/?feed=$feed&p=$id"; … … 472 479 $qstr = preg_replace('|^/+|', '', $qstr); 473 480 if ( $permalink ) 474 $qstr = user_trailingslashit($qstr );481 $qstr = user_trailingslashit($qstr, 'paged'); 475 482 $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_option('home') ) . $qstr ); 476 483 477 484 // showing /page/1/ or ?paged=1 is redundant 478 485 if ( 1 === $pagenum ) { 479 $qstr = str_replace(user_trailingslashit('index.php/page/1' ), '', $qstr); // for PATHINFO style480 $qstr = str_replace(user_trailingslashit('page/1' ), '', $qstr); // for mod_rewrite style486 $qstr = str_replace(user_trailingslashit('index.php/page/1', 'paged'), '', $qstr); // for PATHINFO style 487 $qstr = str_replace(user_trailingslashit('page/1', 'paged'), '', $qstr); // for mod_rewrite style 481 488 $qstr = remove_query_arg('paged', $qstr); // for query style 482 489 } trunk/wp-includes/post-template.php
r904 r915 156 156 $output .= ' '; 157 157 if ( ($i != $page) || ((!$more) && ($page==1)) ) { 158 if ( '' == get_option('permalink_structure') ) 159 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">'; 160 else 161 $output .= '<a href="' . trailingslashit(get_permalink()) . $i . '/">'; 158 if ( 1 == $i ) { 159 $output .= '<a href="' . get_permalink() . '">'; 160 } else { 161 if ( '' == get_option('permalink_structure') ) 162 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">'; 163 else 164 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">'; 165 } 162 166 } 163 167 $output .= $j; … … 171 175 $i = $page - 1; 172 176 if ( $i && $more ) { 173 if ( '' == get_option('permalink_structure') ) 174 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $previouspagelink . '</a>'; 175 else 176 $output .= '<a href="' . get_permalink() . $i . '/">'.$previouspagelink.'</a>'; 177 if ( 1 == $i ) { 178 $output .= '<a href="' . get_permalink() . '">' . $previouspagelink . '</a>'; 179 } else { 180 if ( '' == get_option('permalink_structure') ) 181 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $previouspagelink . '</a>'; 182 else 183 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $previouspagelink . '</a>'; 184 } 177 185 } 178 186 $i = $page + 1; 179 187 if ( $i <= $numpages && $more ) { 180 if ( '' == get_option('permalink_structure') ) 181 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">'.$nextpagelink.'</a>'; 182 else 183 $output .= '<a href="' . trailingslashit(get_permalink()) . $i . '/">' . $nextpagelink . '</a>'; 188 if ( 1 == $i ) { 189 $output .= '<a href="' . get_permalink() . '">' . $nextpagelink . '</a>'; 190 } else { 191 if ( '' == get_option('permalink_structure') ) 192 $output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $nextpagelink . '</a>'; 193 else 194 $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $nextpagelink . '</a>'; 195 } 184 196 } 185 197 $output .= $after; trunk/wp-includes/post.php
r909 r915 106 106 $_post = & $post_cache[$blog_id][$post->ID]; 107 107 } else { 108 $post = (int) $post; 108 109 if ( isset($post_cache[$blog_id][$post]) ) 109 110 $_post = & $post_cache[$blog_id][$post]; … … 933 934 $_page = $page; 934 935 } else { 936 $page = (int) $page; 935 937 // first, check the cache 936 938 if ( ! ( $_page = wp_cache_get($page, 'pages') ) ) { trunk/wp-includes/theme.php
r909 r915 442 442 443 443 if ( isset($mods[$name]) ) 444 return $mods[$name];445 446 return sprintf($default, get_template_directory_uri());444 return apply_filters( "theme_mod_$name", $mods[$name] ); 445 446 return apply_filters( "theme_mod_$name", sprintf($default, get_template_directory_uri()) ); 447 447 } 448 448 trunk/wp-includes/vars.php
r909 r915 14 14 15 15 // Simple browser detection 16 // We should probably be doing true/false instead of 1/0 here ~ Mark 17 $is_lynx = 0; $is_gecko = 0; $is_winIE = 0; $is_macIE = 0; $is_opera = 0; $is_NS4 = 0; 16 $is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = false; 18 17 19 if ( preg_match('/Lynx/', $_SERVER['HTTP_USER_AGENT']) ) 20 $is_lynx = 1; 21 elseif ( preg_match('/Gecko/', $_SERVER['HTTP_USER_AGENT']) ) 22 $is_gecko = 1; 23 elseif ( preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']) && preg_match('/Win/', $_SERVER['HTTP_USER_AGENT']) ) 24 $is_winIE = 1; 25 elseif ( preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT']) && preg_match('/Mac/', $_SERVER['HTTP_USER_AGENT']) ) 26 $is_macIE = 1; 27 elseif ( preg_match('/Opera/', $_SERVER['HTTP_USER_AGENT']) ) 28 $is_opera = 1; 29 elseif ( preg_match('/Nav/', $_SERVER['HTTP_USER_AGENT']) || preg_match('/Mozilla\/4\./', $_SERVER['HTTP_USER_AGENT']) ) 30 $is_NS4 = 1; 18 if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) { 19 $is_lynx = true; 20 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) { 21 $is_gecko = true; 22 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win')) { 23 $is_winIE = true; 24 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) { 25 $is_macIE = true; 26 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) { 27 $is_opera = true; 28 } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false) { 29 $is_NS4 = true; 30 } 31 31 32 32 $is_IE = ( $is_macIE || $is_winIE ); 33 33 34 34 // Server detection 35 $is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? 1 : 0;36 $is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? 1 : 0;35 $is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? true : false; 36 $is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? true : false; 37 37 38 38 // if the config file does not provide the smilies array, let's define it here trunk/wp-links-opml.php
r828 r915 30 30 31 31 foreach ((array) $cats as $cat) { 32 $catname = apply_filters('link_category', $cat->cat_name); 33 32 34 ?> 33 <outline type="category" title="<?php echo attribute_escape($cat ->cat_name); ?>">35 <outline type="category" title="<?php echo attribute_escape($catname); ?>"> 34 36 <?php 35 37 36 38 $bookmarks = get_bookmarks("category={$cat->cat_ID}"); 37 39 foreach ((array) $bookmarks as $bookmark) { 40 $title = attribute_escape(apply_filters('link_title', $bookmark->link_name)); 38 41 ?> 39 <outline text="<?php echo attribute_escape($bookmark->link_name); ?>" type="link" xmlUrl="<?php echo attribute_escape($bookmark->link_rss); ?>" htmlUrl="<?php echo attribute_escape($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" />42 <outline text="<?php echo $title; ?>" type="link" xmlUrl="<?php echo attribute_escape($bookmark->link_rss); ?>" htmlUrl="<?php echo attribute_escape($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" /> 40 43 <?php 41 44 trunk/xmlrpc.php
r909 r915 1394 1394 $bits = $data['bits']; 1395 1395 1396 // Default to new file, not over write.1397 $overwrite = false;1398 1396 if(!empty($data["overwrite"]) && ($data["overwrite"] == true)) { 1399 $overwrite = true;1400 1401 // If the file isn't writable then error out now.1402 if(!is_writable($data["name"])) {1403 return(new IXR_Error(500, "File is not writable, over write failed."));1404 }1405 1406 // We now know the file is good so don't use the sanitized name.1407 $name = $data["name"];1408 1409 1397 // Get postmeta info on the object. 1410 $old_ meta= $wpdb->get_row("1411 SELECT *1412 FROM {$wpdb->post meta}1413 WHERE meta_key = '_wp_attached_file'1414 AND meta_value = '{$name}'1398 $old_file = $wpdb->get_row(" 1399 SELECT ID 1400 FROM {$wpdb->posts} 1401 WHERE post_title = '{$name}' 1402 AND post_type = 'attachment' 1415 1403 "); 1416 1404 1417 // Get post info on the object. 1418 $old_post = get_post($old_meta->post_id); 1405 // Delete previous file. 1406 wp_delete_attachment($old_file->ID); 1407 1408 // Make sure the new name is different by pre-pending the 1409 // previous post id. 1410 $filename = preg_replace("/^wpid\d+-/", "", $name); 1411 $name = "wpid{$old_file->ID}-{$filename}"; 1419 1412 } 1420 1413 … … 1451 1444 ); 1452 1445 1453 // If we are over writing then set the correct post_id and URL1454 // instead of getting new ones.1455 if($overwrite) {1456 $post_id = $old_meta->post_id;1457 $attachment["post_parent"] = $old_meta->post_id;1458 $attachment["ID"] = $old_meta->post_id;1459 1460 $upload["url"] = $old_post->guid;1461 $attachment["guid"] = $old_post->guid;1462 }1463 1464 1446 // Save the data 1465 1447 $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); 1466 1448 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); 1467 1449 1468 return apply_filters( 'wp_handle_upload', array( 'file' => $ upload[ 'file' ], 'url' => $upload[ 'url' ], 'type' => $type ) );1450 return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) ); 1469 1451 } 1470 1452
