Changes from tags/2.7 at r10539 to tags/2.7.1 at r10539
- Location:
- tags/2.7.1
- Files:
-
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/2.7.1/wp-admin/admin-ajax.php
r10539 r10539 431 431 if ( empty( $tags ) ) 432 432 die( __('No tags found!') ); 433 434 if ( is_wp_error($tags) ) 435 die($tags->get_error_message()); 433 436 434 437 foreach ( $tags as $key => $tag ) { … … 721 724 722 725 $data = ''; 723 $message = sprintf( __('Draft Saved at %s.'), date ( __('g:i:s a'), current_time( 'timestamp', true) ) );726 $message = sprintf( __('Draft Saved at %s.'), date_i18n( __('g:i:s a') ) ); 724 727 725 728 $supplemental = array(); -
tags/2.7.1/wp-admin/admin.php
r10539 r10539 62 62 // backwards compatibility for plugins using add_management_page 63 63 if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) { 64 wp_redirect('tools.php?page=' . $plugin_page); 64 // There could be plugin specific params on the URL, so we need the whole query string 65 if ( !empty($_SERVER[ 'QUERY_STRING' ]) ) 66 $query_string = $_SERVER[ 'QUERY_STRING' ]; 67 else 68 $query_string = 'page=' . $plugin_page; 69 wp_redirect( 'tools.php?' . $query_string ); 65 70 exit; 66 71 } -
tags/2.7.1/wp-admin/css/colors-classic.css
r10539 r10539 614 614 } 615 615 616 .plugins .active { 616 .plugins .active, 617 .plugins .active th, 618 .plugins .active td { 617 619 background-color: #e7f7d3; 618 620 } 619 621 620 .plugins .togl { 621 border-right-color: #ccc; 622 } 623 624 #the-comment-list .unapproved { 622 #the-comment-list .unapproved, 623 #the-comment-list .unapproved th, 624 #the-comment-list .unapproved td { 625 625 background-color: #ffffe0; 626 626 } -
tags/2.7.1/wp-admin/css/colors-fresh.css
r10539 r10539 614 614 } 615 615 616 .plugins .active { 616 .plugins .active, 617 .plugins .active th, 618 .plugins .active td { 617 619 background-color: #e7f7d3; 618 620 } 619 621 620 .plugins .togl { 621 border-right-color: #ccc; 622 } 623 624 #the-comment-list .unapproved { 622 #the-comment-list .unapproved, 623 #the-comment-list .unapproved th, 624 #the-comment-list .unapproved td { 625 625 background-color: #ffffe0; 626 626 } -
tags/2.7.1/wp-admin/css/ie.css
r10539 r10539 179 179 } 180 180 /* end Inline Editor */ 181 182 input { 183 line-height: 1; 184 } 181 185 182 186 * html .row-actions { … … 274 278 } 275 279 276 #ed_toolbar input { 280 #ed_toolbar input, 281 #ed_reply_toolbar input { 277 282 overflow: visible; 278 283 padding: 0 4px; -
tags/2.7.1/wp-admin/css/press-this.css
r10539 r10539 121 121 padding: 7px; 122 122 margin: 0 0 10px; 123 background-image: url(../images/postbox-bg.gif); 124 background-position: left top; 125 background-repeat: repeat-x; 123 background: #dfdfdf url("../images/gray-grad.png") repeat-x left top; 126 124 font-size: 12px; 127 125 font-weight: bold; -
tags/2.7.1/wp-admin/edit-comments.php
r10539 r10539 19 19 20 20 $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] ); 21 $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); 22 21 if ( current_user_can('moderate_comments')) { 22 $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); 23 } else { 24 $deleted_spam = 0; 25 } 23 26 $redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam; 24 27 if ( $post_id ) … … 273 276 274 277 if ( 'spam' == $comment_status ) { 275 wp_nonce_field('bulk-spam-delete', '_spam_nonce'); ?> 276 <input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" /> 277 <?php } ?> 278 wp_nonce_field('bulk-spam-delete', '_spam_nonce'); 279 if ( current_user_can ('moderate_comments')) { ?> 280 <input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" /> 281 <?php } 282 } ?> 278 283 <?php do_action('manage_comments_nav', $comment_status); ?> 279 284 </div> … … 325 330 <option value="unapprove"><?php _e('Unapprove'); ?></option> 326 331 <?php endif; ?> 327 <?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?>332 <?php if ( empty($comment_status) || 'moderated' == $comment_status || 'spam' == $comment_status ): ?> 328 333 <option value="approve"><?php _e('Approve'); ?></option> 329 334 <?php endif; ?> -
tags/2.7.1/wp-admin/edit-link-form.php
r10539 r10539 119 119 <label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label> 120 120 <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" /> 121 <input type="button" id="category-add-su mbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />121 <input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" /> 122 122 <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?> 123 123 <span id="category-ajax-response"></span> -
tags/2.7.1/wp-admin/import/blogger.php
r10539 r10539 551 551 552 552 // Clean up content 553 $post_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);553 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); 554 554 $post_content = str_replace('<br>', '<br />', $post_content); 555 555 $post_content = str_replace('<hr>', '<hr />', $post_content); … … 604 604 605 605 // Clean up content 606 $comment_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);606 $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content); 607 607 $comment_content = str_replace('<br>', '<br />', $comment_content); 608 608 $comment_content = str_replace('<hr>', '<hr />', $comment_content); -
tags/2.7.1/wp-admin/import/blogware.php
r10539 r10539 90 90 91 91 // Clean up content 92 $post_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);92 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); 93 93 $post_content = str_replace('<br>', '<br />', $post_content); 94 94 $post_content = str_replace('<hr>', '<hr />', $post_content); … … 130 130 131 131 // Clean up content 132 $comment_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);132 $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content); 133 133 $comment_content = str_replace('<br>', '<br />', $comment_content); 134 134 $comment_content = str_replace('<hr>', '<hr />', $comment_content); -
tags/2.7.1/wp-admin/import/livejournal.php
r10539 r10539 71 71 72 72 // Clean up content 73 $post_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);73 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); 74 74 $post_content = str_replace('<br>', '<br />', $post_content); 75 75 $post_content = str_replace('<hr>', '<hr />', $post_content); … … 107 107 108 108 // Clean up content 109 $comment_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);109 $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content); 110 110 $comment_content = str_replace('<br>', '<br />', $comment_content); 111 111 $comment_content = str_replace('<hr>', '<hr />', $comment_content); -
tags/2.7.1/wp-admin/import/mt.php
r10539 r10539 439 439 } else { 440 440 // Processing multi-line field, check context. 441 442 $line .= "\n"; 441 442 if( !empty($line) ) 443 $line .= "\n"; 444 443 445 if ( 'body' == $context ) { 444 446 $post->post_content .= $line; -
tags/2.7.1/wp-admin/import/rss.php
r10539 r10539 104 104 105 105 // Clean up content 106 $post_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);106 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); 107 107 $post_content = str_replace('<br>', '<br />', $post_content); 108 108 $post_content = str_replace('<hr>', '<hr />', $post_content); -
tags/2.7.1/wp-admin/import/wordpress.php
r10539 r10539 382 382 383 383 $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' ); 384 $post_excerpt = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);384 $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt); 385 385 $post_excerpt = str_replace('<br>', '<br />', $post_excerpt); 386 386 $post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt); 387 387 388 388 $post_content = $this->get_tag( $post, 'content:encoded' ); 389 $post_content = preg_replace ('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);389 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); 390 390 $post_content = str_replace('<br>', '<br />', $post_content); 391 391 $post_content = str_replace('<hr>', '<hr />', $post_content); -
tags/2.7.1/wp-admin/includes/bookmark.php
r10539 r10539 143 143 $update = true; 144 144 145 if ( trim( $link_name ) == '' ) 146 return 0; 145 if ( trim( $link_name ) == '' ) { 146 if ( trim( $link_url ) != '' ) { 147 $link_name = $link_url; 148 } else { 149 return 0; 150 } 151 } 147 152 148 153 if ( trim( $link_url ) == '' ) -
tags/2.7.1/wp-admin/includes/dashboard.php
r10539 r10539 182 182 // Posts 183 183 $num = number_format_i18n( $num_posts->publish ); 184 if ( current_user_can( 'edit_posts' ) ) 185 $text = "<a href='edit.php'>$num</a>"; 186 else 187 $text = $num; 188 echo '<td class="first b b-posts">' . $text . '</td>'; 189 echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', intval($num_posts->publish) ) . '</td>'; 184 $text = __ngettext( 'Post', 'Posts', intval($num_posts->publish) ); 185 if ( current_user_can( 'edit_posts' ) ) { 186 $num = "<a href='edit.php'>$num</a>"; 187 $text = "<a href='edit.php'>$text</a>"; 188 } 189 echo '<td class="first b b-posts">' . $num . '</td>'; 190 echo '<td class="t posts">' . $text . '</td>'; 190 191 /* TODO: Show status breakdown on hover 191 192 if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can … … 207 208 // Total Comments 208 209 $num = number_format_i18n($num_comm->total_comments); 209 if ( current_user_can( 'moderate_comments' ) ) 210 $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments ); 211 if ( current_user_can( 'moderate_comments' ) ) { 210 212 $num = "<a href='edit-comments.php'>$num</a>"; 211 echo '<td class="b b-comments">'.$num.'</td>'; 212 echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>'; 213 $text = "<a href='edit-comments.php'>$text</a>"; 214 } 215 echo '<td class="b b-comments">' . $num . '</td>'; 216 echo '<td class="last t comments">' . $text . '</td>'; 213 217 214 218 echo '</tr><tr>'; … … 216 220 // Pages 217 221 $num = number_format_i18n( $num_pages->publish ); 218 if ( current_user_can( 'edit_pages' ) ) 222 $text = __ngettext( 'Page', 'Pages', $num_pages->publish ); 223 if ( current_user_can( 'edit_pages' ) ) { 219 224 $num = "<a href='edit-pages.php'>$num</a>"; 220 echo '<td class="first b b_pages">'.$num.'</td>'; 221 echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>'; 225 $text = "<a href='edit-pages.php'>$text</a>"; 226 } 227 echo '<td class="first b b_pages">' . $num . '</td>'; 228 echo '<td class="t pages">' . $text . '</td>'; 222 229 223 230 // Approved Comments 224 231 $num = number_format_i18n($num_comm->approved); 225 if ( current_user_can( 'moderate_comments' ) ) 232 $text = __ngettext( 'Approved', 'Approved', $num_comm->approved ); 233 if ( current_user_can( 'moderate_comments' ) ) { 226 234 $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>"; 227 echo '<td class="b b_approved">'.$num.'</td>'; 228 echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>'; 235 $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>$text</a>"; 236 } 237 echo '<td class="b b_approved">' . $num . '</td>'; 238 echo '<td class="last t">' . $text . '</td>'; 229 239 230 240 echo "</tr>\n\t<tr>"; … … 232 242 // Categories 233 243 $num = number_format_i18n( $num_cats ); 234 if ( current_user_can( 'manage_categories' ) ) 244 $text = __ngettext( 'Category', 'Categories', $num_cats ); 245 if ( current_user_can( 'manage_categories' ) ) { 235 246 $num = "<a href='categories.php'>$num</a>"; 236 echo '<td class="first b b-cats">'.$num.'</td>'; 237 echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>'; 247 $text = "<a href='categories.php'>$text</a>"; 248 } 249 echo '<td class="first b b-cats">' . $num . '</td>'; 250 echo '<td class="t cats">' . $text . '</td>'; 238 251 239 252 // Pending Comments 240 253 $num = number_format_i18n($num_comm->moderated); 241 if ( current_user_can( 'moderate_comments' ) ) 254 $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated ); 255 if ( current_user_can( 'moderate_comments' ) ) { 242 256 $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>"; 243 echo '<td class="b b-waiting">'.$num.'</td>'; 244 echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>'; 257 $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>"; 258 } 259 echo '<td class="b b-waiting">' . $num . '</td>'; 260 echo '<td class="last t">' . $text . '</td>'; 245 261 246 262 echo "</tr>\n\t<tr>"; … … 248 264 // Tags 249 265 $num = number_format_i18n( $num_tags ); 250 if ( current_user_can( 'manage_categories' ) ) 266 $text = __ngettext( 'Tag', 'Tags', $num_tags ); 267 if ( current_user_can( 'manage_categories' ) ) { 251 268 $num = "<a href='edit-tags.php'>$num</a>"; 252 echo '<td class="first b b-tags">'.$num.'</td>'; 253 echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>'; 269 $text = "<a href='edit-tags.php'>$text</a>"; 270 } 271 echo '<td class="first b b-tags">' . $num . '</td>'; 272 echo '<td class="t tags">' . $text . '</td>'; 254 273 255 274 // Spam Comments 256 275 $num = number_format_i18n($num_comm->spam); 257 if ( current_user_can( 'moderate_comments' ) ) 276 $text = __ngettext( 'Spam', 'Spam', $num_comm->spam ); 277 if ( current_user_can( 'moderate_comments' ) ) { 258 278 $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>"; 259 echo '<td class="b b-spam">'.$num.'</td>'; 260 echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>'; 279 $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>"; 280 } 281 echo '<td class="b b-spam">' . $num . '</td>'; 282 echo '<td class="last t">' . $text . '</td>'; 261 283 262 284 echo "</tr>"; … … 282 304 update_right_now_message(); 283 305 284 echo "\n\t".'< /div>';306 echo "\n\t".'<br class="clear" /></div>'; 285 307 do_action( 'rightnow_end' ); 286 308 do_action( 'activity_box_end' ); -
tags/2.7.1/wp-admin/includes/file.php
r10539 r10539 668 668 $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : $credentials['private_key']); 669 669 670 //sanitize the hostname, Some people might pass in odd-data: 671 $credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off 672 670 673 if ( strpos($credentials['hostname'], ':') ) 671 674 list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2); 675 else 676 unset($credentials['port']); 672 677 673 678 if ( defined('FTP_SSH') || (isset($_POST['connection_type']) && 'ssh' == $_POST['connection_type']) ) … … 680 685 if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { 681 686 $stored_credentials = $credentials; 682 unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']); 687 if ( !empty($stored_credentials['port']) ) //save port as part of hostname to simplify above code. 688 $stored_credentials['hostname'] .= ':' . $stored_credentials['port']; 689 690 unset($stored_credentials['password'], $stored_credentials['port'], $stored_credentials['private_key'], $stored_credentials['public_key']); 683 691 update_option('ftp_credentials', $stored_credentials); 684 692 return $credentials; -
tags/2.7.1/wp-admin/includes/media.php
r10539 r10539 370 370 check_admin_referer('media-form'); 371 371 372 if ( isset($_POST['send']) ) { 373 $keys = array_keys($_POST['send']); 374 $send_id = (int) array_shift($keys); 375 } 376 372 377 if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { 373 378 $post = $_post = get_post($attachment_id, ARRAY_A); … … 380 385 if ( isset($attachment['menu_order']) ) 381 386 $post['menu_order'] = $attachment['menu_order']; 382 if ( isset($attachment['post_parent']) ) 383 $post['post_parent'] = $attachment['post_parent']; 387 if ( isset($send_id) && $attachment_id == $send_id ) { 388 if ( isset($attachment['post_parent']) ) 389 $post['post_parent'] = $attachment['post_parent']; 390 } 384 391 385 392 $post = apply_filters('attachment_fields_to_save', $post, $attachment); … … 409 416 } 410 417 411 if ( isset($_POST['send']) ) { 412 $keys = array_keys($_POST['send']); 413 $send_id = (int) array_shift($keys); 418 if ( isset($send_id) ) { 414 419 $attachment = stripslashes_deep( $_POST['attachments'][$send_id] ); 415 420 $html = $attachment['post_title']; -
tags/2.7.1/wp-admin/includes/plugin.php
r10539 r10539 122 122 $plugin_data['Title'] = $plugin_data['Name']; 123 123 124 if ( ! empty($plugin_data['AuthorURI']) )124 if ( ! empty($plugin_data['AuthorURI']) && ! empty($plugin_data['Author']) ) 125 125 $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>'; 126 126 … … 863 863 $parent = get_admin_page_parent(); 864 864 865 if ( isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )865 if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) ) 866 866 return false; 867 867 -
tags/2.7.1/wp-admin/includes/post.php
r10539 r10539 229 229 $post_data = &$_POST; 230 230 231 if ( 'page' == $post_data['post_type'] ) {231 if ( isset($post_data['post_type']) && 'page' == $post_data['post_type'] ) { 232 232 if ( ! current_user_can( 'edit_pages' ) ) 233 233 wp_die( __('You are not allowed to edit pages.') ); … … 237 237 } 238 238 239 $post_IDs = array_map( intval, (array) $post_data['post'] );239 $post_IDs = array_map( 'intval', (array) $post_data['post'] ); 240 240 241 241 $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' ); … … 910 910 } 911 911 912 $post->filter = 'sample'; 913 912 914 $permalink = get_permalink($post, true); 913 915 … … 927 929 $post->post_date = $original_date; 928 930 $post->post_name = $original_name; 931 unset($post->filter); 932 929 933 return $permalink; 930 934 } … … 1162 1166 if ( ! empty($mce_external_languages) ) { 1163 1167 foreach ( $mce_external_languages as $name => $path ) { 1164 if ( is_file($path) &&is_readable($path) ) {1168 if ( @is_file($path) && @is_readable($path) ) { 1165 1169 include_once($path); 1166 $ext_plugins .= $strings ;1170 $ext_plugins .= $strings . "\n"; 1167 1171 $loaded_langs[] = $name; 1168 1172 } … … 1185 1189 $path = trailingslashit( realpath($path) ); 1186 1190 1187 if ( is_file($path . $mce_locale . '.js') )1188 $strings .= @file_get_contents($path . $mce_locale . '.js') ;1189 1190 if ( is_file($path . $mce_locale . '_dlg.js') )1191 $strings .= @file_get_contents($path . $mce_locale . '_dlg.js') ;1191 if ( @is_file($path . $mce_locale . '.js') ) 1192 $strings .= @file_get_contents($path . $mce_locale . '.js') . "\n"; 1193 1194 if ( @is_file($path . $mce_locale . '_dlg.js') ) 1195 $strings .= @file_get_contents($path . $mce_locale . '_dlg.js') . "\n"; 1192 1196 1193 1197 if ( 'en' != $mce_locale && empty($strings) ) { 1194 if ( is_file($path . 'en.js') ) {1198 if ( @is_file($path . 'en.js') ) { 1195 1199 $str1 = @file_get_contents($path . 'en.js'); 1196 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) ;1200 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n"; 1197 1201 } 1198 1202 1199 if ( is_file($path . 'en_dlg.js') ) {1203 if ( @is_file($path . 'en_dlg.js') ) { 1200 1204 $str2 = @file_get_contents($path . 'en_dlg.js'); 1201 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) ;1205 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n"; 1202 1206 } 1203 1207 } -
tags/2.7.1/wp-admin/includes/schema.php
r10539 r10539 352 352 353 353 // Add caps for Administrator role 354 $role = get_role('administrator');354 $role =& get_role('administrator'); 355 355 $role->add_cap('switch_themes'); 356 356 $role->add_cap('edit_themes'); … … 385 385 386 386 // Add caps for Editor role 387 $role = get_role('editor');387 $role =& get_role('editor'); 388 388 $role->add_cap('moderate_comments'); 389 389 $role->add_cap('manage_categories'); … … 407 407 408 408 // Add caps for Author role 409 $role = get_role('author');409 $role =& get_role('author'); 410 410 $role->add_cap('upload_files'); 411 411 $role->add_cap('edit_posts'); … … 418 418 419 419 // Add caps for Contributor role 420 $role = get_role('contributor');420 $role =& get_role('contributor'); 421 421 $role->add_cap('edit_posts'); 422 422 $role->add_cap('read'); … … 425 425 426 426 // Add caps for Subscriber role 427 $role = get_role('subscriber');427 $role =& get_role('subscriber'); 428 428 $role->add_cap('read'); 429 429 $role->add_cap('level_0'); … … 438 438 $roles = array('administrator', 'editor'); 439 439 foreach ($roles as $role) { 440 $role = get_role($role);440 $role =& get_role($role); 441 441 if ( empty($role) ) 442 442 continue; … … 459 459 } 460 460 461 $role = get_role('administrator');461 $role =& get_role('administrator'); 462 462 if ( ! empty($role) ) { 463 463 $role->add_cap('delete_users'); … … 465 465 } 466 466 467 $role = get_role('author');467 $role =& get_role('author'); 468 468 if ( ! empty($role) ) { 469 469 $role->add_cap('delete_posts'); … … 471 471 } 472 472 473 $role = get_role('contributor');473 $role =& get_role('contributor'); 474 474 if ( ! empty($role) ) { 475 475 $role->add_cap('delete_posts'); … … 483 483 */ 484 484 function populate_roles_230() { 485 $role = get_role( 'administrator' );485 $role =& get_role( 'administrator' ); 486 486 487 487 if ( !empty( $role ) ) { … … 496 496 */ 497 497 function populate_roles_250() { 498 $role = get_role( 'administrator' );498 $role =& get_role( 'administrator' ); 499 499 500 500 if ( !empty( $role ) ) { … … 509 509 */ 510 510 function populate_roles_260() { 511 $role = get_role( 'administrator' );511 $role =& get_role( 'administrator' ); 512 512 513 513 if ( !empty( $role ) ) { … … 523 523 */ 524 524 function populate_roles_270() { 525 $role = get_role( 'administrator' );525 $role =& get_role( 'administrator' ); 526 526 527 527 if ( !empty( $role ) ) { -
tags/2.7.1/wp-admin/includes/template.php
r10539 r10539 440 440 * @param unknown_type $popular_cats 441 441 */ 442 function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) { 443 $walker = new Walker_Category_Checklist; 442 function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null ) { 443 if ( empty($walker) || !is_a($walker, 'Walker') ) 444 $walker = new Walker_Category_Checklist; 445 444 446 $descendants_and_self = (int) $descendants_and_self; 445 447 … … 2398 2400 2399 2401 if ( $for_post ) 2400 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date) ) ? false : true;2402 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ) ? false : true; 2401 2403 2402 2404 $tab_index_attribute = ''; -
tags/2.7.1/wp-admin/index.php
r10539 r10539 42 42 </div><!-- wrap --> 43 43 44 <?php require( './admin-footer.php'); ?>44 <?php require(ABSPATH . 'wp-admin/admin-footer.php'); ?> -
tags/2.7.1/wp-admin/js/common.js
r10539 r10539 1 1 2 wpCookies = {2 var wpCookies = { 3 3 // The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL. 4 4 -
tags/2.7.1/wp-admin/js/editor.js
r10539 r10539 1 1 2 switchEditors = {2 var switchEditors = { 3 3 4 4 mode : '', … … 170 170 return pee; 171 171 } 172 } 172 }; -
tags/2.7.1/wp-admin/js/link.js
r10539 r10539 12 12 // Ajax Cat 13 13 var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } ); 14 jQuery('#category-add-su mbit').click( function() { newCat.focus(); } );14 jQuery('#category-add-submit').click( function() { newCat.focus(); } ); 15 15 var noSyncChecks = false; // prophylactic. necessary? 16 16 var syncChecks = function() { -
tags/2.7.1/wp-admin/js/plugin-install.js
r10539 r10539 30 30 return false; 31 31 }); 32 33 $(window).resize( function() { tb_position() } );34 32 }); 35 33 -
tags/2.7.1/wp-admin/link-manager.php
r10539 r10539 169 169 $link->link_category = wp_get_link_cats($link->link_id); 170 170 $short_url = str_replace('http://', '', $link->link_url); 171 $short_url = str_replace('www.', '', $short_url);171 $short_url = preg_replace('/^www./i', '', $short_url); 172 172 if ('/' == substr($short_url, -1)) 173 173 $short_url = substr($short_url, 0, -1); -
tags/2.7.1/wp-admin/menu-header.php
r10539 r10539 75 75 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 76 76 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 77 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) {77 if ( ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") && ('index.php' != $submenu[$item[2]][0][2]) ) || !empty($menu_hook)) { 78 78 $admin_is_parent = true; 79 79 echo "$img$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>{$item[0]}</a>"; … … 116 116 $menu_hook = get_plugin_page_hook($sub_item[2], $item[2]); 117 117 118 if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) {118 if ( ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") && ('index.php' != $sub_item[2]) ) || ! empty($menu_hook) ) { 119 119 // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir 120 120 $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]); -
tags/2.7.1/wp-admin/menu.php
r10539 r10539 84 84 } 85 85 86 $menu[55] = array( __('Tools'), ' manage_options', 'tools.php', '', 'menu-top', 'menu-tools', 'div' );86 $menu[55] = array( __('Tools'), 'read', 'tools.php', '', 'menu-top', 'menu-tools', 'div' ); 87 87 $submenu['tools.php'][5] = array( __('Tools'), 'read', 'tools.php' ); 88 88 $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' ); -
tags/2.7.1/wp-admin/theme-editor.php
r10539 r10539 97 97 98 98 $description = get_file_description($file); 99 $desc_header = ( $description != $file_show ) ? " $description</strong> (%s)" : "%s";99 $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (%s)" : "%s"; 100 100 ?> 101 101 <div class="wrap"> … … 121 121 <div class="tablenav"> 122 122 <div class="alignleft"> 123 <big>< strong><?php echo sprintf($desc_header, $file_show); ?></big>123 <big><?php echo sprintf($desc_header, $file_show); ?></big> 124 124 </div> 125 125 <br class="clear" /> -
tags/2.7.1/wp-admin/update-core.php
r10539 r10539 135 135 global $wp_filesystem; 136 136 137 $url = wp_nonce_url('update-core.php?action=do-core-upgrade', 'upgrade-core'); 137 if ( $reinstall ) 138 $url = 'update-core.php?action=do-core-reinstall'; 139 else 140 $url = 'update-core.php?action=do-core-upgrade'; 141 $url = wp_nonce_url($url, 'upgrade-core'); 138 142 if ( false === ($credentials = request_filesystem_credentials($url)) ) 139 143 return; -
tags/2.7.1/wp-admin/wp-admin.css
r10539 r10539 16 16 } 17 17 18 .plugins . togl {19 w idth: 150px;18 .plugins .action-links { 19 white-space: nowrap; 20 20 } 21 21 … … 436 436 } 437 437 438 #ed_toolbar input { 438 #ed_toolbar input, 439 #ed_reply_toolbar input { 439 440 margin: 3px 1px 4px; 440 441 line-height: 18px; … … 449 450 -webkit-border-radius: 3px; 450 451 border-radius: 3px; 452 } 453 454 #ed_reply_toolbar input { 455 margin: 1px 2px 1px 1px; 451 456 } 452 457 … … 1644 1649 1645 1650 #edit-slug-box { 1651 height: 1em; 1646 1652 margin-top: 8px; 1647 1653 padding: 0 7px; … … 1853 1859 padding: 0; 1854 1860 line-height: 19px; 1861 } 1862 1863 #category-adder h4 { 1864 margin-top: 4px; 1865 margin-bottom: 0px; 1866 } 1867 1868 #categorydiv .ui-tabs-panel { 1869 border-width: 3px; 1870 border-style: solid; 1871 } 1872 1873 ul#category-tabs { 1874 margin-top: 12px; 1875 } 1876 1877 ul#category-tabs li { 1878 padding: 5px 8px; 1879 -moz-border-radius: 3px 3px 0 0; 1880 -webkit-border-top-left-radius: 3px; 1881 -webkit-border-top-right-radius: 3px; 1882 -khtml-border-top-left-radius: 3px; 1883 -khtml-border-top-right-radius: 3px; 1884 border-top-left-radius: 3px; 1885 border-top-right-radius: 3px; 1855 1886 } 1856 1887 … … 2253 2284 } 2254 2285 2255 #replyrow #ed_reply_toolbar input {2256 margin: 1px 2px 1px 1px;2257 min-width: 24px;2258 padding: 3px 4px;2259 font-size: 11px;2260 -moz-border-radius: 3px;2261 -khtml-border-radius: 3px;2262 -webkit-border-radius: 3px;2263 border-radius: 3px;2264 }2265 2266 2286 /* show/hide settings */ 2267 2268 2287 #screen-meta { 2269 2288 position: relative; -
tags/2.7.1/wp-config-sample.php
r10539 r10539 38 38 * 39 39 * Change these to different unique phrases! 40 * You can generate these using the {@link http ://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}40 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service} 41 41 * 42 42 * @since 2.6.0 -
tags/2.7.1/wp-includes/bookmark-template.php
r10539 r10539 27 27 * 'show_images' - Default is 1 (integer). Whether to show link image if 28 28 * available. 29 * 'show_name' - Default is 1(integer). Whether to show link name if29 * 'show_name' - Default is 0 (integer). Whether to show link name if 30 30 * available. 31 31 * 'before' - Default is '<li>' (string). The html or text to prepend to each -
tags/2.7.1/wp-includes/canonical.php
r10539 r10539 120 120 if ( $redirect_url = get_year_link(get_query_var('year')) ) 121 121 $redirect['query'] = remove_query_arg('year', $redirect['query']); 122 } elseif ( is_category() && !empty($_GET['cat']) ) {122 } elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) { 123 123 if ( $redirect_url = get_category_link(get_query_var('cat')) ) 124 124 $redirect['query'] = remove_query_arg('cat', $redirect['query']); … … 137 137 // Strip off paging and feed 138 138 $paged_redirect['path'] = preg_replace('#/page/[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing paging 139 $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+ )?$#', '/', $paged_redirect['path']); // strip off feed endings139 $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $paged_redirect['path']); // strip off feed endings 140 140 $paged_redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing comment paging 141 141 } -
tags/2.7.1/wp-includes/capabilities.php
r10539 r10539 534 534 $this->allcaps = array(); 535 535 foreach ( (array) $this->roles as $role ) { 536 $role = $wp_roles->get_role( $role );536 $role =& $wp_roles->get_role( $role ); 537 537 $this->allcaps = array_merge( $this->allcaps, $role->capabilities ); 538 538 } -
tags/2.7.1/wp-includes/category-template.php
r10539 r10539 398 398 if ( $show_option_all ) { 399 399 $show_option_all = apply_filters( 'list_cats', $show_option_all ); 400 $output .= "\t<option value='0'>$show_option_all</option>\n"; 400 $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : ''; 401 $output .= "\t<option value='0'$selected>$show_option_all</option>\n"; 401 402 } 402 403 403 404 if ( $show_option_none ) { 404 405 $show_option_none = apply_filters( 'list_cats', $show_option_none ); 405 $output .= "\t<option value='-1'>$show_option_none</option>\n"; 406 $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : ''; 407 $output .= "\t<option value='-1'$selected>$show_option_none</option>\n"; 406 408 } 407 409 … … 444 446 * 'child_of' (int) default is 0 - See {@link get_categories()}. 445 447 * 'exclude' (string) - See {@link get_categories()}. 448 * 'exclude_tree' (string) - See {@link get_categories()}. 446 449 * 'echo' (bool|int) default is 1 - Whether to display or retrieve content. 447 450 * 'current_category' (int) - See {@link get_categories()}. … … 462 465 'hide_empty' => 1, 'use_desc_for_title' => 1, 463 466 'child_of' => 0, 'feed' => '', 'feed_type' => '', 464 'feed_image' => '', 'exclude' => '', ' current_category' => 0,467 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0, 465 468 'hierarchical' => true, 'title_li' => __( 'Categories' ), 466 469 'echo' => 1, 'depth' => 0 … … 475 478 if ( isset( $r['show_date'] ) ) { 476 479 $r['include_last_update_time'] = $r['show_date']; 480 } 481 482 if ( true == $r['hierarchical'] ) { 483 $r['exclude_tree'] = $r['exclude']; 484 $r['exclude'] = ''; 477 485 } 478 486 … … 537 545 * be to return the top 45 tags in the tag cloud list. 538 546 * 539 * The 'topic_count_text_callback' argument is a function, which, given the count547 * The 'topic_count_text_callback' argument is a function, which, given the count 540 548 * of the posts with that tag, returns a text for the tooltip of the tag link. 541 * @see default_topic_count_text542 549 * 543 550 * The 'exclude' and 'include' arguments are used for the {@link get_tags()} … … 614 621 * The 'topic_count_text_callback' argument is a function, which given the count 615 622 * of the posts with that tag returns a text for the tooltip of the tag link. 616 * @see default_topic_count_text617 *618 623 * 619 624 * @todo Complete functionality. … … 650 655 uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') ); 651 656 else 652 uasort( $tags, create_function('$a, $b', 'return ($a->count <$b->count);') );657 uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') ); 653 658 654 659 if ( 'DESC' == $order ) … … 721 726 */ 722 727 function walk_category_tree() { 723 $walker = new Walker_Category;724 728 $args = func_get_args(); 729 // the user's options are the third parameter 730 if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') ) 731 $walker = new Walker_Category; 732 else 733 $walker = $args[2]['walker']; 734 725 735 return call_user_func_array(array( &$walker, 'walk' ), $args ); 726 736 } … … 734 744 */ 735 745 function walk_category_dropdown_tree() { 736 $walker = new Walker_CategoryDropdown;737 746 $args = func_get_args(); 747 // the user's options are the third parameter 748 if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') ) 749 $walker = new Walker_CategoryDropdown; 750 else 751 $walker = $args[2]['walker']; 752 738 753 return call_user_func_array(array( &$walker, 'walk' ), $args ); 739 754 } -
tags/2.7.1/wp-includes/class-phpmailer.php
r10539 r10539 1410 1410 function EncodeQ ($str, $position = 'text') { 1411 1411 /* There should not be any EOL in the string */ 1412 $encoded = preg_replace(" [\r\n]", '', $str);1412 $encoded = preg_replace("/[\r\n]/", '', $str); 1413 1413 1414 1414 switch (strtolower($position)) { -
tags/2.7.1/wp-includes/comment-template.php
r10539 r10539 834 834 835 835 $overridden_cpage = FALSE; 836 if ( '' == get_query_var('cpage') && get_option('page_comments') && 'newest' == get_option('default_comments_page')) {837 set_query_var( 'cpage', get_comment_pages_count());836 if ( '' == get_query_var('cpage') && get_option('page_comments') ) { 837 set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 ); 838 838 $overridden_cpage = TRUE; 839 839 } … … 987 987 $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>'; 988 988 else 989 $link = "<a rel='nofollow' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";989 $link = "<a rel='nofollow' class='comment-reply-link' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 990 990 return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post); 991 991 } … … 1038 1038 $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>'; 1039 1039 } else { 1040 $link = "<a rel='nofollow' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";1040 $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 1041 1041 } 1042 1042 return apply_filters('post_comments_link', $before . $link . $after, $post); -
tags/2.7.1/wp-includes/comment.php
r10539 r10539 46 46 return false; // If moderation is set to manual 47 47 48 if ( get_option('comment_max_links') && preg_match_all(" |(href\t*?=\t*?['\"]?)?(https?:)?//|i", apply_filters('comment_text',$comment), $out) >= get_option('comment_max_links') )48 if ( get_option('comment_max_links') && preg_match_all("/<[Aa][^>]*[Hh][Rr][Ee][Ff]=['\"]([^\"'>]+)[^>]*>/", apply_filters('comment_text',$comment), $out) >= get_option('comment_max_links') ) 49 49 return false; // Check # of external links 50 50 … … 593 593 594 594 // Count comments older than this one 595 $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_ date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );595 $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_approved = '1' AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) ); 596 596 597 597 // No older comments? Then it's page #1. … … 1581 1581 */ 1582 1582 function _close_comments_for_old_posts( $posts ) { 1583 if ( empty($posts) || !is_sing le() || !get_option('close_comments_for_old_posts') )1583 if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') ) 1584 1584 return $posts; 1585 1585 -
tags/2.7.1/wp-includes/compat.php
r10539 r10539 97 97 } 98 98 99 if ( !function_exists( 'htmlspecialchars_decode' ) ) { 100 // Added in PHP 5.1.0 101 // Error checks from PEAR::PHP_Compat 102 function htmlspecialchars_decode( $str, $quote_style = ENT_COMPAT ) 103 { 104 if ( !is_scalar( $string ) ) { 105 trigger_error( 'htmlspecialchars_decode() expects parameter 1 to be string, ' . gettype( $string ) . ' given', E_USER_WARNING ); 106 return; 107 } 108 109 if ( !is_int( $quote_style ) && $quote_style !== null ) { 110 trigger_error( 'htmlspecialchars_decode() expects parameter 2 to be integer, ' . gettype( $quote_style ) . ' given', E_USER_WARNING ); 111 return; 112 } 113 114 return wp_specialchars_decode( $str, $quote_style ); 115 } 116 } 117 99 118 ?> -
tags/2.7.1/wp-includes/cron.php
r10539 r10539 17 17 * 18 18 * @param int $timestamp Timestamp for when to run the event. 19 * @param callback $hook Function or method to call,when cron is run.20 * @param array $args Optional. Arguments to pass to the hook function.19 * @param string $hook Action hook to execute when cron is run. 20 * @param array $args Optional. Arguments to pass to the hook's callback function. 21 21 */ 22 22 function wp_schedule_single_event( $timestamp, $hook, $args = array()) { … … 44 44 * @param int $timestamp Timestamp for when to run the event. 45 45 * @param string $recurrence How often the event should recur. 46 * @param callback $hook Function or method to call,when cron is run.47 * @param array $args Optional. Arguments to pass to the hook function.46 * @param string $hook Action hook to execute when cron is run. 47 * @param array $args Optional. Arguments to pass to the hook's callback function. 48 48 * @return bool|null False on failure, null when complete with scheduling event. 49 49 */ … … 66 66 * @param int $timestamp Timestamp for when to run the event. 67 67 * @param string $recurrence How often the event should recur. 68 * @param callback $hook Function or method to call,when cron is run.69 * @param array $args Optional. Arguments to pass to the hook function.68 * @param string $hook Action hook to execute when cron is run. 69 * @param array $args Optional. Arguments to pass to the hook's callback function. 70 70 * @return bool|null False on failure. Null when event is rescheduled. 71 71 */ … … 101 101 * 102 102 * @param int $timestamp Timestamp for when to run the event. 103 * @param callback $hook Function or method to call, when cron is run. 104 * @param array $args Optional. Arguments to pass to the hook function. 103 * @param string $hook Action hook, the execution of which will be unscheduled. 104 * @param array $args Arguments to pass to the hook's callback function. 105 * Although not passed to a callback function, these arguments are used 106 * to uniquely identify the scheduled event, so they should be the same 107 * as those used when originally scheduling the event. 105 108 */ 106 109 function wp_unschedule_event( $timestamp, $hook, $args = array() ) { … … 120 123 * @since 2.1.0 121 124 * 122 * @param callback $hook Function or method to call, when cron is run.125 * @param string $hook Action hook, the execution of which will be unscheduled. 123 126 * @param mixed $args,... Optional. Event arguments. 124 127 */ … … 135 138 * @since 2.1.0 136 139 * 137 * @param callback $hook Function or method to call,when cron is run.138 * @param array $args Optional. Arguments to pass to the hook function.140 * @param string $hook Action hook to execute when cron is run. 141 * @param array $args Optional. Arguments to pass to the hook's callback function. 139 142 * @return bool|int The UNIX timestamp of the next time the scheduled event will occur. 140 143 */ … … 281 284 * @since 2.1.0 282 285 * 283 * @param callback $hook Function or method to call,when cron is run.284 * @param array $args Optional. Arguments to pass to the hook function.286 * @param string $hook Action hook to execute when cron is run. 287 * @param array $args Optional. Arguments to pass to the hook's callback function. 285 288 * @return string|bool False, if no schedule. Schedule on success. 286 289 */ -
tags/2.7.1/wp-includes/feed-atom-comments.php
r10539 r10539 12 12 xmlns="http://www.w3.org/2005/Atom" 13 13 xml:lang="<?php echo get_option('rss_language'); ?>" 14 xmlns:thr="http://purl.org/syndication/thread/1.0" 14 15 <?php do_action('atom_ns'); ?> 15 16 > … … 64 65 </author> 65 66 66 <id><?php comment_ link(); ?></id>67 <id><?php comment_guid(); ?></id> 67 68 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated> 68 69 <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published> … … 79 80 // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, its more important that they both use the same system 80 81 ?> 81 <thr:in-reply-to ref="<?php echo get_comment_link($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />82 <thr:in-reply-to ref="<?php comment_guid($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" /> 82 83 <?php endif; 83 84 do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); -
tags/2.7.1/wp-includes/feed.php
r10539 r10539 224 224 * @subpackage Feed 225 225 * @since unknown 226 */ 227 function comment_guid() { 228 echo get_comment_guid(); 226 * 227 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. 228 */ 229 function comment_guid($comment_id = null) { 230 echo get_comment_guid($comment_id); 229 231 } 230 232 … … 236 238 * @since unknown 237 239 * 240 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. 238 241 * @return bool|string false on failure or guid for comment on success. 239 242 */ 240 function get_comment_guid( ) {241 global $comment;243 function get_comment_guid($comment_id = null) { 244 $comment = get_comment($comment_id); 242 245 243 246 if ( !is_object($comment) ) … … 253 256 */ 254 257 function comment_link() { 255 echo get_comment_link();258 echo clean_url( get_comment_link() ); 256 259 } 257 260 -
tags/2.7.1/wp-includes/formatting.php
r10539 r10539 187 187 * Converts a number of special characters into their HTML entities. 188 188 * 189 * Differs from htmlspecialchars as existing HTML entities will not be encoded. 190 * Specifically changes: & to &, < to < and > to >. 191 * 192 * $quotes can be set to 'single' to encode ' to ', 'double' to encode " to 193 * ", or '1' to do both. Default is 0 where no quotes are encoded. 189 * Specifically deals with: &, <, >, ", and '. 190 * 191 * $quote_style can be set to ENT_COMPAT to encode " to 192 * ", or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded. 194 193 * 195 194 * @since 1.2.2 196 195 * 197 * @param string $text The text which is to be encoded. 198 * @param mixed $quotes Optional. Converts single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default 0. 196 * @param string $string The text which is to be encoded. 197 * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES. 198 * @param string $charset Optional. The character encoding of the string. Default is false. 199 * @param boolean $double_encode Optional. Whether or not to encode existing html entities. Default is false. 199 200 * @return string The encoded text with HTML entities. 200 201 */ 201 function wp_specialchars( $text, $quotes = 0 ) { 202 // Like htmlspecialchars except don't double-encode HTML entities 203 $text = str_replace('&&', '&&', $text); 204 $text = str_replace('&&', '&&', $text); 205 $text = preg_replace('/&(?:$|([^#])(?![a-z1-4]{1,8};))/', '&$1', $text); 206 $text = str_replace('<', '<', $text); 207 $text = str_replace('>', '>', $text); 208 if ( 'double' === $quotes ) { 209 $text = str_replace('"', '"', $text); 210 } elseif ( 'single' === $quotes ) { 211 $text = str_replace("'", ''', $text); 212 } elseif ( $quotes ) { 213 $text = str_replace('"', '"', $text); 214 $text = str_replace("'", ''', $text); 215 } 216 return $text; 202 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) 203 { 204 $string = (string) $string; 205 206 if ( 0 === strlen( $string ) ) { 207 return ''; 208 } 209 210 // Don't bother if there are no specialchars - saves some processing 211 if ( !preg_match( '/[&<>"\']/', $string ) ) { 212 return $string; 213 } 214 215 // Account for the previous behaviour of the function when the $quote_style is not an accepted value 216 if ( empty( $quote_style ) ) { 217 $quote_style = ENT_NOQUOTES; 218 } elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) { 219 $quote_style = ENT_QUOTES; 220 } 221 222 // Store the site charset as a static to avoid multiple calls to wp_load_alloptions() 223 if ( !$charset ) { 224 static $_charset; 225 if ( !isset( $_charset ) ) { 226 $alloptions = wp_load_alloptions(); 227 $_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : ''; 228 } 229 $charset = $_charset; 230 } 231 if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) ) { 232 $charset = 'UTF-8'; 233 } 234 235 $_quote_style = $quote_style; 236 237 if ( $quote_style === 'double' ) { 238 $quote_style = ENT_COMPAT; 239 $_quote_style = ENT_COMPAT; 240 } elseif ( $quote_style === 'single' ) { 241 $quote_style = ENT_NOQUOTES; 242 } 243 244 // Handle double encoding ourselves 245 if ( !$double_encode ) { 246 $string = wp_specialchars_decode( $string, $_quote_style ); 247 $string = preg_replace( '/&(#?x?[0-9]+|[a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string ); 248 } 249 250 $string = @htmlspecialchars( $string, $quote_style, $charset ); 251 252 // Handle double encoding ourselves 253 if ( !$double_encode ) { 254 $string = str_replace( array( '|wp_entity|', '|/wp_entity|' ), array( '&', ';' ), $string ); 255 } 256 257 // Backwards compatibility 258 if ( 'single' === $_quote_style ) { 259 $string = str_replace( "'", ''', $string ); 260 } 261 262 return $string; 263 } 264 265 /** 266 * Converts a number of HTML entities into their special characters. 267 * 268 * Specifically deals with: &, <, >, ", and '. 269 * 270 * $quote_style can be set to ENT_COMPAT to decode " entities, 271 * or ENT_QUOTES to do both " and '. Default is ENT_NOQUOTES where no quotes are decoded. 272 * 273 * @since 2.8 274 * 275 * @param string $string The text which is to be decoded. 276 * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old wp_specialchars() values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES. 277 * @return string The decoded text without HTML entities. 278 */ 279 function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) 280 { 281 $string = (string) $string; 282 283 if ( 0 === strlen( $string ) ) { 284 return ''; 285 } 286 287 // Don't bother if there are no entities - saves a lot of processing 288 if ( strpos( $string, '&' ) === false ) { 289 return $string; 290 } 291 292 // Match the previous behaviour of wp_specialchars() when the $quote_style is not an accepted value 293 if ( empty( $quote_style ) ) { 294 $quote_style = ENT_NOQUOTES; 295 } elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) { 296 $quote_style = ENT_QUOTES; 297 } 298 299 // More complete than get_html_translation_table( HTML_SPECIALCHARS ) 300 $single = array( ''' => '\'', ''' => '\'' ); 301 $single_preg = array( '/�*39;/' => ''', '/�*27;/i' => ''' ); 302 $double = array( '"' => '"', '"' => '"', '"' => '"' ); 303 $double_preg = array( '/�*34;/' => '"', '/�*22;/i' => '"' ); 304 $others = array( '<' => '<', '<' => '<', '>' => '>', '>' => '>', '&' => '&', '&' => '&', '&' => '&' ); 305 $others_preg = array( '/�*60;/' => '<', '/�*62;/' => '>', '/�*38;/' => '&', '/�*26;/i' => '&' ); 306 307 if ( $quote_style === ENT_QUOTES ) { 308 $translation = array_merge( $single, $double, $others ); 309 $translation_preg = array_merge( $single_preg, $double_preg, $others_preg ); 310 } elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) { 311 $translation = array_merge( $double, $others ); 312 $translation_preg = array_merge( $double_preg, $others_preg ); 313 } elseif ( $quote_style === 'single' ) { 314 $translation = array_merge( $single, $others ); 315 $translation_preg = array_merge( $single_preg, $others_preg ); 316 } elseif ( $quote_style === ENT_NOQUOTES ) { 317 $translation = $others; 318 $translation_preg = $others_preg; 319 } 320 321 // Remove zero padding on numeric entities 322 $string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string ); 323 324 // Replace characters according to translation table 325 return strtr( $string, $translation ); 326 } 327 328 /** 329 * Checks for invalid UTF8 in a string. 330 * 331 * @since 2.8 332 * 333 * @param string $string The text which is to be checked. 334 * @param boolean $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false. 335 * @return string The checked text. 336 */ 337 function wp_check_invalid_utf8( $string, $strip = false ) 338 { 339 $string = (string) $string; 340 341 if ( 0 === strlen( $string ) ) { 342 return ''; 343 } 344 345 // Store the site charset as a static to avoid multiple calls to get_option() 346 static $is_utf8; 347 if ( !isset( $is_utf8 ) ) { 348 $is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ); 349 } 350 if ( !$is_utf8 ) { 351 return $string; 352 } 353 354 // Check for support for utf8 in the installed PCRE library once and store the result in a static 355 static $utf8_pcre; 356 if ( !isset( $utf8_pcre ) ) { 357 $utf8_pcre = @preg_match( '/^./u', 'a' ); 358 } 359 // We can't demand utf8 in the PCRE installation, so just return the string in those cases 360 if ( !$utf8_pcre ) { 361 return $string; 362 } 363 364 // preg_match fails when it encounters invalid UTF8 in $string 365 if ( 1 === @preg_match( '/^./us', $string ) ) { 366 return $string; 367 } 368 369 // Attempt to strip the bad chars if requested (not recommended) 370 if ( $strip && function_exists( 'iconv' ) ) { 371 return iconv( 'utf-8', 'utf-8', $string ); 372 } 373 374 return ''; 217 375 } 218 376 … … 1148 1306 } else { 1149 1307 $subject = str_replace('_', ' ', $matches[2]); 1150 /** @todo use preg_replace_callback() */ 1151 $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject); 1308 $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject); 1152 1309 return $subject; 1153 1310 } … … 1158 1315 * 1159 1316 * Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the 1160 * value of gmt_offset.1317 * value of the 'gmt_offset' option. 1161 1318 * 1162 1319 * @since 1.2.0 1163 1320 * 1321 * @uses get_option() to retrieve the the value of 'gmt_offset'. 1164 1322 * @param string $string The date to be converted. 1165 1323 * @return string GMT version of the date provided. … … 1743 1901 */ 1744 1902 function js_escape($text) { 1745 $safe_text = wp_specialchars($text, 'double'); 1746 $safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text)); 1747 $safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text)); 1748 return apply_filters('js_escape', $safe_text, $text); 1903 $safe_text = wp_check_invalid_utf8( $text ); 1904 $safe_text = wp_specialchars( $safe_text, ENT_COMPAT ); 1905 $safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes( $safe_text ) ); 1906 $safe_text = preg_replace( "/\r?\n/", "\\n", addslashes( $safe_text ) ); 1907 return apply_filters( 'js_escape', $safe_text, $text ); 1749 1908 } 1750 1909 … … 1757 1916 * @return string 1758 1917 */ 1759 function attribute_escape($text) { 1760 $safe_text = wp_specialchars($text, true); 1761 return apply_filters('attribute_escape', $safe_text, $text); 1918 function attribute_escape( $text ) { 1919 $safe_text = wp_check_invalid_utf8( $text ); 1920 $safe_text = wp_specialchars( $safe_text, ENT_QUOTES ); 1921 return apply_filters( 'attribute_escape', $safe_text, $text ); 1762 1922 } 1763 1923 … … 1771 1931 */ 1772 1932 function tag_escape($tag_name) { 1773 $safe_tag = strtolower( preg_replace(' [^a-zA-Z_:]', '', $tag_name) );1933 $safe_tag = strtolower( preg_replace('/[^a-zA-Z_:]/', '', $tag_name) ); 1774 1934 return apply_filters('tag_escape', $safe_tag, $tag_name); 1775 1935 } -
tags/2.7.1/wp-includes/functions.php
r10539 r10539 80 80 * The 'timestamp' type will return the current timestamp. 81 81 * 82 * If the $gmt is set to either '1' or 'true', then both types will use the83 * GMT offset in the WordPress option to add the GMT offset to the time.82 * If $gmt is set to either '1' or 'true', then both types will use GMT time. 83 * if $gmt is false, the output is adjusted with the GMT offset in the WordPress option. 84 84 * 85 85 * @since 1.0.0 86 86 * 87 87 * @param string $type Either 'mysql' or 'timestamp'. 88 * @param int|bool $gmt Optional. Whether to use $gmt offset. Default is false.88 * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false. 89 89 * @return int|string String if $type is 'gmt', int if $type is 'timestamp'. 90 90 */ … … 2805 2805 */ 2806 2806 function is_ssl() { 2807 return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; 2807 if ( isset($_SERVER['HTTPS']) ) { 2808 if ( 'on' == strtolower($_SERVER['HTTPS']) ) 2809 return true; 2810 if ( '1' == $_SERVER['HTTPS'] ) 2811 return true; 2812 } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { 2813 return true; 2814 } 2815 return false; 2808 2816 } 2809 2817 … … 2898 2906 * @return object The cloned object 2899 2907 */ 2900 function wp_clone($object) { 2901 return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object); 2908 function wp_clone( $object ) { 2909 static $can_clone; 2910 if ( !isset( $can_clone ) ) { 2911 $can_clone = version_compare( phpversion(), '5.0', '>=' ); 2912 } 2913 return $can_clone ? clone( $object ) : $object; 2902 2914 } 2903 2915 -
tags/2.7.1/wp-includes/general-template.php
r10539 r10539 1593 1593 1594 1594 if ( $lang = get_bloginfo('language') ) { 1595 if ( get_option('html_type') == 'text/html' || $doctype == ' xhtml' )1595 if ( get_option('html_type') == 'text/html' || $doctype == 'html' ) 1596 1596 $attributes[] = "lang=\"$lang\""; 1597 1597 -
tags/2.7.1/wp-includes/http.php
r10539 r10539 243 243 244 244 if ( is_null($r['body']) ) { 245 // Some servers fail when sending content without the content-length 246 // header being set. 247 $r['headers']['Content-Length'] = 0; 245 248 $transports = WP_Http::_getTransport($r); 246 249 } else { … … 391 394 * 392 395 * @param string $body Body content 393 * @return bool|string|WP_Error False if not chunked encoded. WP_Error on failure. Chunked decoded body on success.396 * @return string Chunked decoded body on success or raw body on failure. 394 397 */ 395 398 function chunkTransferDecode($body) { … … 402 405 //$parsedHeaders = array(); Unsupported 403 406 404 $done = false; 405 406 do { 407 while ( true ) { 407 408 $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match ); 408 409 409 410 if ( $hasChunk ) { 410 if ( empty($match[1]) ) { 411 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') ); 412 } 411 if ( empty($match[1]) ) 412 return $body; 413 413 414 414 $length = hexdec( $match[1] ); … … 420 420 $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n"); 421 421 422 if( "0" == trim($body) ) { 423 $done = true; 422 if( "0" == trim($body) ) 424 423 return $parsedBody; // Ignore footer headers. 425 break;426 }427 424 } else { 428 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') );425 return $body; 429 426 } 430 } while ( false === $done );427 } 431 428 } 432 429 } … … 645 642 return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); 646 643 647 if ( 'http' != $arrURL['scheme'] ||'https' != $arrURL['scheme'] )644 if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) 648 645 $url = str_replace($arrURL['scheme'], 'http', $url); 649 646 … … 751 748 return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); 752 749 753 if ( 'http' != $arrURL['scheme'] ||'https' != $arrURL['scheme'] )750 if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) 754 751 $url = str_replace($arrURL['scheme'], 'http', $url); 755 752 … … 778 775 $context = stream_context_create($arrContext); 779 776 780 if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )777 if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) 781 778 $handle = @fopen($url, 'r', false, $context); 782 779 else … … 983 980 } 984 981 985 // If timeout is a float less than 1, round it up to 1. 982 // cURL extension will sometimes fail when the timeout is less than 1 as 983 // it may round down to 0, which gives it unlimited timeout. 986 984 if ( $r['timeout'] > 0 && $r['timeout'] < 1 ) 987 985 $r['timeout'] = 1; … … 990 988 curl_setopt( $handle, CURLOPT_URL, $url); 991 989 990 // The cURL extension requires that the option be set for the HEAD to 991 // work properly. 992 992 if ( 'HEAD' === $r['method'] ) { 993 993 curl_setopt( $handle, CURLOPT_NOBODY, true ); … … 1008 1008 curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] ); 1009 1009 1010 // The option doesn't work with safe mode or when open_basedir is set. 1010 1011 if ( !ini_get('safe_mode') && !ini_get('open_basedir') ) 1011 1012 curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true ); … … 1063 1064 */ 1064 1065 function test() { 1065 if ( function_exists('curl_init') )1066 if ( function_exists('curl_init') && function_exists('curl_exec') ) 1066 1067 return true; 1067 1068 -
tags/2.7.1/wp-includes/js/autosave.js
r10539 r10539 115 115 116 116 function autosave_enable_buttons() { 117 jQuery(" #submitpost :button:disabled, #submitpost:submit:disabled").attr('disabled', '');117 jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr('disabled', ''); 118 118 } 119 119 120 120 function autosave_disable_buttons() { 121 jQuery(" #submitpost :button:enabled, #submitpost:submit:enabled").attr('disabled', 'disabled');121 jQuery(".submitbox :button:enabled, .submitbox :submit:enabled").attr('disabled', 'disabled'); 122 122 setTimeout(autosave_enable_buttons, 5000); // Re-enable 5 sec later. Just gives autosave a head start to avoid collisions. 123 123 } -
tags/2.7.1/wp-includes/js/thickbox/thickbox.css
r10539 r10539 34 34 .TB_overlayBG { 35 35 background-color:#000; 36 -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=75)"; 36 37 filter:alpha(opacity=75); 37 38 -moz-opacity: 0.75; -
tags/2.7.1/wp-includes/js/thickbox/thickbox.js
r10539 r10539 282 282 283 283 function tb_position() { 284 var isIE6 = typeof document.body.style.maxHeight === "undefined"; 284 285 jQuery("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); 285 if ( ! (jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6286 if ( ! isIE6 ) { // take away IE6 286 287 jQuery("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); 287 288 } -
tags/2.7.1/wp-includes/js/wp-ajax-response.js
r10539 r10539 1 wpAjax = jQuery.extend( {1 var wpAjax = jQuery.extend( { 2 2 unserialize: function( s ) { 3 3 var r = {}; if ( !s ) { return r; } -
tags/2.7.1/wp-includes/kses.php
r10539 r10539 395 395 */ 396 396 function wp_kses_split($string, $allowed_html, $allowed_protocols) { 397 return preg_replace('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%e', 398 "wp_kses_split2('\\1', \$allowed_html, ".'$allowed_protocols)', $string); 397 global $pass_allowed_html, $pass_allowed_protocols; 398 $pass_allowed_html = $allowed_html; 399 $pass_allowed_protocols = $allowed_protocols; 400 return preg_replace_callback('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', 401 create_function('$match', 'global $pass_allowed_html, $pass_allowed_protocols; return wp_kses_split2($match[1], $pass_allowed_html, $pass_allowed_protocols);'), $string); 399 402 } 400 403 … … 1000 1003 */ 1001 1004 function wp_kses_decode_entities($string) { 1002 $string = preg_replace ('/&#([0-9]+);/e', 'chr("\\1")', $string);1003 $string = preg_replace ('/&#[Xx]([0-9A-Fa-f]+);/e', 'chr(hexdec("\\1"))', $string);1005 $string = preg_replace_callback('/&#([0-9]+);/', create_function('$match', 'return chr($match[1]);'), $string); 1006 $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', create_function('$match', 'return chr(hexdec($match[1]));'), $string); 1004 1007 1005 1008 return $string; -
tags/2.7.1/wp-includes/link-template.php
r10539 r10539 93 93 ); 94 94 95 $post = &get_post($id); 95 if ( is_object($id) && isset($id->filter) && 'sample' == $id->filter ) 96 $post = $id; 97 else 98 $post = &get_post($id); 96 99 97 100 if ( empty($post->ID) ) return false; … … 723 726 } 724 727 725 $link = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>';728 $link = '<a class="post-edit-link" href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>'; 726 729 echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; 727 730 } … … 773 776 } 774 777 775 $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';778 $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 776 779 echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 777 780 } … … 1243 1246 1244 1247 /** 1245 * Displaylink to next comments pages.1246 * 1247 * @since 2.7. 01248 * Return the link to next comments pages. 1249 * 1250 * @since 2.7.1 1248 1251 * 1249 1252 * @param string $label Optional. Label for link text. 1250 1253 * @param int $max_page Optional. Max page. 1251 */ 1252 function next_comments_link($label='', $max_page = 0) { 1254 * @return string|null 1255 */ 1256 function get_next_comments_link( $label = '', $max_page = 0 ) { 1253 1257 global $wp_query; 1254 1258 … … 1258 1262 $page = get_query_var('cpage'); 1259 1263 1260 if ( !$page )1261 $page = 1;1262 1263 1264 $nextpage = intval($page) + 1; 1264 1265 … … 1275 1276 $label = __('Newer Comments »'); 1276 1277 1277 echo '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ); 1278 $attr = apply_filters( 'next_comments_link_attributes', '' ); 1279 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1280 } 1281 1282 /** 1283 * Display the previous comments page link. 1278 return '<a href="' . clean_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1279 } 1280 1281 /** 1282 * Display the link to next comments pages. 1284 1283 * 1285 1284 * @since 2.7.0 1286 1285 * 1286 * @param string $label Optional. Label for link text. 1287 * @param int $max_page Optional. Max page. 1288 */ 1289 function next_comments_link( $label = '', $max_page = 0 ) { 1290 echo get_next_comments_link( $label, $max_page ); 1291 } 1292 1293 /** 1294 * Return the previous comments page link. 1295 * 1296 * @since 2.7.1 1297 * 1287 1298 * @param string $label Optional. Label for comments link text. 1288 * /1289 function previous_comments_link($label='') { 1290 1299 * @return string|null 1300 */ 1301 function get_previous_comments_link( $label = '' ) { 1291 1302 if ( !is_singular() ) 1292 1303 return; … … 1294 1305 $page = get_query_var('cpage'); 1295 1306 1296 if ( !$page ) 1297 $page = 1; 1298 1299 if ( $page <= 1 ) 1307 if ( intval($page) <= 1 ) 1300 1308 return; 1301 1309 … … 1305 1313 $label = __('« Older Comments'); 1306 1314 1307 echo '<a href="' . clean_url(get_comments_pagenum_link($prevpage)); 1308 $attr = apply_filters( 'previous_comments_link_attributes', '' ); 1309 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1315 return '<a href="' . clean_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 1316 } 1317 1318 /** 1319 * Display the previous comments page link. 1320 * 1321 * @since 2.7.0 1322 * 1323 * @param string $label Optional. Label for comments link text. 1324 */ 1325 function previous_comments_link( $label = '' ) { 1326 echo get_previous_comments_link( $label ); 1310 1327 } 1311 1328 … … 1338 1355 ); 1339 1356 if ( $wp_rewrite->using_permalinks() ) 1340 $defaults['base'] = user_trailingslashit( get_permalink() . 'comment-page-%#%', 'commentpaged');1357 $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged'); 1341 1358 1342 1359 $args = wp_parse_args( $args, $defaults ); -
tags/2.7.1/wp-includes/pluggable.php
r10539 r10539 1211 1211 * You must not copy the below example and paste into your wp-config.php. If you 1212 1212 * need an example, then you can have a 1213 * {@link http ://api.wordpress.org/secret-key/1.0/ secret key created} for you.1213 * {@link https://api.wordpress.org/secret-key/1.1/ secret key created} for you. 1214 1214 * 1215 1215 * <code> … … 1222 1222 * 1223 1223 * @since 2.5 1224 * @link http ://api.wordpress.org/secret-key/1.0/ Create a Secret Key for wp-config.php1224 * @link https://api.wordpress.org/secret-key/1.1/ Create a Secret Key for wp-config.php 1225 1225 * 1226 1226 * @return string Salt value from either 'SECRET_KEY' or 'secret' option … … 1395 1395 * @since 2.5 1396 1396 * 1397 * @param int $length The length of password to generate 1398 * @param bool $special_chars Whether to include standard special characters 1397 1399 * @return string The random password 1398 1400 **/ … … 1528 1530 } 1529 1531 1532 if ( is_ssl() ) 1533 $host = 'https://secure.gravatar.com'; 1534 else 1535 $host = 'http://www.gravatar.com'; 1536 1530 1537 if ( 'mystery' == $default ) 1531 $default = " http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')1538 $default = "$host/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') 1532 1539 elseif ( 'blank' == $default ) 1533 1540 $default = includes_url('images/blank.gif'); … … 1535 1542 $default = ''; 1536 1543 elseif ( 'gravatar_default' == $default ) 1537 $default = " http://www.gravatar.com/avatar/s={$size}";1544 $default = "$host/avatar/s={$size}"; 1538 1545 elseif ( empty($email) ) 1539 $default = " http://www.gravatar.com/avatar/?d=$default&s={$size}";1546 $default = "$host/avatar/?d=$default&s={$size}"; 1540 1547 elseif ( strpos($default, 'http://') === 0 ) 1541 1548 $default = add_query_arg( 's', $size, $default ); 1542 1549 1543 1550 if ( !empty($email) ) { 1544 $out = 'http://www.gravatar.com/avatar/';1551 $out = "$host/avatar/"; 1545 1552 $out .= md5( strtolower( $email ) ); 1546 1553 $out .= '?s='.$size; -
tags/2.7.1/wp-includes/post-template.php
r10539 r10539 224 224 } 225 225 if ( $preview ) // preview fix for javascript bug with foreign languages 226 $output = preg_replace ('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output);226 $output = preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output); 227 227 228 228 return $output; … … 608 608 609 609 // sanitize, mostly to keep spaces out 610 $r['exclude'] = preg_replace(' [^0-9,]', '', $r['exclude']);610 $r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']); 611 611 612 612 // Allow plugins to filter an array of excluded pages … … 681 681 if ( is_front_page() && !is_paged() ) 682 682 $class = 'class="current_page_item"'; 683 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $ link_before . $text . $link_after. '</a></li>';683 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>'; 684 684 // If the front page is a page, add it to the exclude list 685 685 if (get_option('show_on_front') == 'page') { … … 1049 1049 $currentf = __( '%s [Current Revision]' ); 1050 1050 1051 $date = date_i18n( $datef, strtotime( $revision->post_modified _gmt . ' +0000') );1051 $date = date_i18n( $datef, strtotime( $revision->post_modified ) ); 1052 1052 if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) ) 1053 1053 $date = "<a href='$link'>$date</a>"; -
tags/2.7.1/wp-includes/post.php
r10539 r10539 216 216 else 217 217 return $null; 218 } elseif ( is_object($post) ) {218 } elseif ( is_object($post) && empty($post->filter) ) { 219 219 _get_post_ancestors($post); 220 220 wp_cache_add($post->ID, $post, 'posts'); 221 221 $_post = &$post; 222 222 } else { 223 if ( is_object($post) ) 224 $post = $post->ID; 223 225 $post = (int) $post; 224 226 if ( ! $_post = wp_cache_get($post, 'posts') ) { … … 740 742 $custom = get_post_custom($post_id); 741 743 742 return $custom[$key];744 return isset($custom[$key]) ? $custom[$key] : null; 743 745 } 744 746 … … 793 795 foreach ( array_keys(get_object_vars($post)) as $field ) 794 796 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 797 $post->filter = $context; 795 798 } else { 796 799 if ( !isset($post['ID']) ) … … 798 801 foreach ( array_keys($post) as $field ) 799 802 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); 800 } 803 $post['filter'] = $context; 804 } 805 801 806 return $post; 802 807 } … … 2536 2541 if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location 2537 2542 $url = str_replace($uploads['basedir'], $uploads['baseurl'], $file); //replace file location with url location 2543 elseif ( false !== strpos($file, 'wp-content/uploads') ) 2544 $url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 ); 2545 else 2546 $url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir. 2538 2547 } 2539 2548 } -
tags/2.7.1/wp-includes/script-loader.php
r10539 r10539 104 104 $scripts->add( 'jquery-hotkeys', '/wp-includes/js/jquery/jquery.hotkeys.js', array('jquery'), '0.0.2' ); 105 105 $scripts->add( 'jquery-table-hotkeys', '/wp-includes/js/jquery/jquery.table-hotkeys.js', array('jquery', 'jquery-hotkeys'), '20081128' ); 106 $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-200 80430');106 $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20090123'); 107 107 $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.2.0-20081031'); 108 108 $scripts->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.2.0-20081031'); -
tags/2.7.1/wp-includes/taxonomy.php
r10539 r10539 535 535 * 'exclude' is ignored. 536 536 * 537 * exclude_tree - A comma- or space-delimited string of term ids to exclude 538 * from the return array, along with all of their descendant terms according to 539 * the primary taxonomy. If 'include' is non-empty, 'exclude_tree' is ignored. 540 * 537 541 * include - Default is an empty string. A comma- or space-delimited string 538 542 * of term ids to include in the return array. … … 605 609 606 610 $defaults = array('orderby' => 'name', 'order' => 'ASC', 607 'hide_empty' => true, 'exclude' => '', ' include' => '',611 'hide_empty' => true, 'exclude' => '', 'exclude_tree' => '', 'include' => '', 608 612 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 609 613 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', … … 669 673 if ( !empty($include) ) { 670 674 $exclude = ''; 675 $exclude_tree = ''; 671 676 $interms = preg_split('/[\s,]+/',$include); 672 677 if ( count($interms) ) { … … 685 690 686 691 $exclusions = ''; 692 if ( ! empty( $exclude_tree ) ) { 693 $excluded_trunks = preg_split('/[\s,]+/',$exclude_tree); 694 foreach( (array) $excluded_trunks as $extrunk ) { 695 $excluded_children = (array) get_terms($taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids')); 696 $excluded_children[] = $extrunk; 697 foreach( (array) $excluded_children as $exterm ) { 698 if ( empty($exclusions) ) 699 $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; 700 else 701 $exclusions .= ' AND t.term_id <> ' . intval($exterm) . ' '; 702 703 } 704 } 705 } 687 706 if ( !empty($exclude) ) { 688 707 $exterms = preg_split('/[\s,]+/',$exclude); 689 708 if ( count($exterms) ) { 690 709 foreach ( (array) $exterms as $exterm ) { 691 if ( empty($exclusions))710 if ( empty($exclusions) ) 692 711 $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; 693 712 else … … 718 737 $where .= ' AND tt.count > 0'; 719 738 720 if ( !empty($number) ) { 739 // don't limit the query results when we have to descend the family tree 740 if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' == $parent ) { 721 741 if( $offset ) 722 $ number= 'LIMIT ' . $offset . ',' . $number;742 $limit = 'LIMIT ' . $offset . ',' . $number; 723 743 else 724 $ number= 'LIMIT ' . $number;744 $limit = 'LIMIT ' . $number; 725 745 726 746 } else 727 $ number= '';747 $limit = ''; 728 748 729 749 if ( !empty($search) ) { … … 740 760 $select_this = 't.term_id, tt.parent, tt.count, t.name'; 741 761 742 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $number"; 743 762 $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $limit"; 763 764 $terms = $wpdb->get_results($query); 744 765 if ( 'all' == $fields ) { 745 $terms = $wpdb->get_results($query);746 766 update_term_cache($terms); 747 } else if ( ('ids' == $fields) || ('names' == $fields) ) {748 $terms = $wpdb->get_results($query);749 767 } 750 768 … … 792 810 $_terms[] = $term->name; 793 811 $terms = $_terms; 812 } 813 814 if ( 0 < $number && intval(@count($terms)) > $number ) { 815 $terms = array_slice($terms, $offset, $number); 794 816 } 795 817 -
tags/2.7.1/wp-includes/theme.php
r10539 r10539 850 850 return; 851 851 852 $_GET['template'] = preg_replace('|[^a-z0-9_.- ]|i', '', $_GET['template']);852 $_GET['template'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['template']); 853 853 854 854 if ( validate_file($_GET['template']) ) … … 858 858 859 859 if ( isset($_GET['stylesheet']) ) { 860 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.- ]|i', '', $_GET['stylesheet']);860 $_GET['stylesheet'] = preg_replace('|[^a-z0-9_.-/]|i', '', $_GET['stylesheet']); 861 861 if ( validate_file($_GET['stylesheet']) ) 862 862 return; -
tags/2.7.1/wp-includes/version.php
r10539 r10539 9 9 * @global string $wp_version 10 10 */ 11 $wp_version = '2.7 ';11 $wp_version = '2.7.1'; 12 12 13 13 /** -
tags/2.7.1/wp-includes/widgets.php
r10539 r10539 549 549 global $wp_registered_widgets, $wp_registered_sidebars; 550 550 551 $sidebars_widgets = get_option('sidebars_widgets' );551 $sidebars_widgets = get_option('sidebars_widgets', array()); 552 552 $_sidebars_widgets = array(); 553 553 … … 619 619 } 620 620 621 unset($sidebars_widgets['array_version']); 621 if ( isset($sidebars_widgets['array_version']) ) 622 unset($sidebars_widgets['array_version']); 622 623 623 624 $sidebars_widgets = apply_filters('sidebars_widgets', $sidebars_widgets); … … 1399 1400 <ul id="recentcomments"><?php 1400 1401 if ( $comments ) : foreach ( (array) $comments as $comment) : 1401 echo '<li class="recentcomments">' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="' . get_comment_link($comment->comment_ID) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';1402 echo '<li class="recentcomments">' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="' . clean_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>'; 1402 1403 endforeach; endif;?></ul> 1403 1404 <?php echo $after_widget; ?> … … 2093 2094 2094 2095 // This is important 2095 add_action( 'widgets_init', 'widget_many_register' ) 2096 add_action( 'widgets_init', 'widget_many_register' ); 2096 2097 2097 2098 */ -
tags/2.7.1/wp-settings.php
r10539 r10539 16 16 @ini_set('memory_limit', WP_MEMORY_LIMIT); 17 17 18 set_magic_quotes_runtime(0); 19 @ini_set('magic_quotes_sybase', 0); 18 20 19 21 /** … … 200 202 error_reporting(E_ALL); 201 203 } else { 202 error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); 204 // Unicode Extension is in PHP 6.0 only or do version check when this changes. 205 if ( function_exists('unicode_decode') ) 206 error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ^ E_STRICT ); 207 else if ( defined( 'E_DEPRECATED' ) ) // Introduced in PHP 5.3 208 error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ); 209 else 210 error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); 203 211 } 204 212 -
tags/2.7.1/xmlrpc.php
r10539 r10539 1259 1259 $logged_in = true; 1260 1260 set_current_user( 0, $username ); 1261 if ( !current_user_can( 'moderate_comments' ) )1262 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this blog.' ) );1263 1261 } 1264 1262 … … 1286 1284 if ( isset($content_struct['author']) ) 1287 1285 $comment['comment_author'] = $content_struct['author']; 1286 1288 1287 $comment['comment_author_email'] = ''; 1289 if ( isset($content_struct['author ']) )1288 if ( isset($content_struct['author_email']) ) 1290 1289 $comment['comment_author_email'] = $content_struct['author_email']; 1290 1291 1291 $comment['comment_author_url'] = ''; 1292 if ( isset($content_struct['author ']) )1292 if ( isset($content_struct['author_url']) ) 1293 1293 $comment['comment_author_url'] = $content_struct['author_url']; 1294 1294 1295 $comment['user_ID'] = 0; 1295 1296 … … 2762 2763 $struct['categoryId'] = $cat->term_id; 2763 2764 $struct['parentId'] = $cat->parent; 2764 $struct['description'] = $cat->description; 2765 $struct['description'] = $cat->name; 2766 $struct['categoryDescription'] = $cat->description; 2765 2767 $struct['categoryName'] = $cat->name; 2766 2768 $struct['htmlUrl'] = wp_specialchars(get_category_link($cat->term_id));
Note: See TracChangeset
for help on using the changeset viewer.