Changes from tags/2.7.1 at r10539 to tags/2.7 at r10539
- Location:
- tags/2.7
- Files:
-
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/2.7/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());436 433 437 434 foreach ( $tags as $key => $tag ) { … … 724 721 725 722 $data = ''; 726 $message = sprintf( __('Draft Saved at %s.'), date _i18n( __('g:i:s a') ) );723 $message = sprintf( __('Draft Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ); 727 724 728 725 $supplemental = array(); -
tags/2.7/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 // 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 ); 64 wp_redirect('tools.php?page=' . $plugin_page); 70 65 exit; 71 66 } -
tags/2.7/wp-admin/css/colors-classic.css
r10539 r10539 614 614 } 615 615 616 .plugins .active, 617 .plugins .active th, 618 .plugins .active td { 616 .plugins .active { 619 617 background-color: #e7f7d3; 620 618 } 621 619 622 #the-comment-list .unapproved, 623 #the-comment-list .unapproved th, 624 #the-comment-list .unapproved td { 620 .plugins .togl { 621 border-right-color: #ccc; 622 } 623 624 #the-comment-list .unapproved { 625 625 background-color: #ffffe0; 626 626 } -
tags/2.7/wp-admin/css/colors-fresh.css
r10539 r10539 614 614 } 615 615 616 .plugins .active, 617 .plugins .active th, 618 .plugins .active td { 616 .plugins .active { 619 617 background-color: #e7f7d3; 620 618 } 621 619 622 #the-comment-list .unapproved, 623 #the-comment-list .unapproved th, 624 #the-comment-list .unapproved td { 620 .plugins .togl { 621 border-right-color: #ccc; 622 } 623 624 #the-comment-list .unapproved { 625 625 background-color: #ffffe0; 626 626 } -
tags/2.7/wp-admin/css/ie.css
r10539 r10539 179 179 } 180 180 /* end Inline Editor */ 181 182 input {183 line-height: 1;184 }185 181 186 182 * html .row-actions { … … 278 274 } 279 275 280 #ed_toolbar input, 281 #ed_reply_toolbar input { 276 #ed_toolbar input { 282 277 overflow: visible; 283 278 padding: 0 4px; -
tags/2.7/wp-admin/css/press-this.css
r10539 r10539 121 121 padding: 7px; 122 122 margin: 0 0 10px; 123 background: #dfdfdf url("../images/gray-grad.png") repeat-x left top; 123 background-image: url(../images/postbox-bg.gif); 124 background-position: left top; 125 background-repeat: repeat-x; 124 126 font-size: 12px; 125 127 font-weight: bold; -
tags/2.7/wp-admin/edit-comments.php
r10539 r10539 19 19 20 20 $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] ); 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 } 21 $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); 22 26 23 $redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam; 27 24 if ( $post_id ) … … 276 273 277 274 if ( 'spam' == $comment_status ) { 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 } ?> 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 } ?> 283 278 <?php do_action('manage_comments_nav', $comment_status); ?> 284 279 </div> … … 330 325 <option value="unapprove"><?php _e('Unapprove'); ?></option> 331 326 <?php endif; ?> 332 <?php if ( empty($comment_status) || 'moderated' == $comment_status || 'spam' == $comment_status): ?>327 <?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?> 333 328 <option value="approve"><?php _e('Approve'); ?></option> 334 329 <?php endif; ?> -
tags/2.7/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 bmit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />121 <input type="button" id="category-add-sumbit" 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/wp-admin/import/blogger.php
r10539 r10539 551 551 552 552 // Clean up content 553 $post_content = preg_replace _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);553 $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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 _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);606 $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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/wp-admin/import/blogware.php
r10539 r10539 90 90 91 91 // Clean up content 92 $post_content = preg_replace _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);92 $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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 _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);132 $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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/wp-admin/import/livejournal.php
r10539 r10539 71 71 72 72 // Clean up content 73 $post_content = preg_replace _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);73 $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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 _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);109 $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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/wp-admin/import/mt.php
r10539 r10539 439 439 } else { 440 440 // Processing multi-line field, check context. 441 442 if( !empty($line) ) 443 $line .= "\n"; 444 441 442 $line .= "\n"; 445 443 if ( 'body' == $context ) { 446 444 $post->post_content .= $line; -
tags/2.7/wp-admin/import/rss.php
r10539 r10539 104 104 105 105 // Clean up content 106 $post_content = preg_replace _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);106 $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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/wp-admin/import/wordpress.php
r10539 r10539 382 382 383 383 $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' ); 384 $post_excerpt = preg_replace _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt);384 $post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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 _callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);389 $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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/wp-admin/includes/bookmark.php
r10539 r10539 143 143 $update = true; 144 144 145 if ( trim( $link_name ) == '' ) { 146 if ( trim( $link_url ) != '' ) { 147 $link_name = $link_url; 148 } else { 149 return 0; 150 } 151 } 145 if ( trim( $link_name ) == '' ) 146 return 0; 152 147 153 148 if ( trim( $link_url ) == '' ) -
tags/2.7/wp-admin/includes/dashboard.php
r10539 r10539 182 182 // Posts 183 183 $num = number_format_i18n( $num_posts->publish ); 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>'; 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>'; 191 190 /* TODO: Show status breakdown on hover 192 191 if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can … … 208 207 // Total Comments 209 208 $num = number_format_i18n($num_comm->total_comments); 210 $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments ); 211 if ( current_user_can( 'moderate_comments' ) ) { 209 if ( current_user_can( 'moderate_comments' ) ) 212 210 $num = "<a href='edit-comments.php'>$num</a>"; 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>'; 211 echo '<td class="b b-comments">'.$num.'</td>'; 212 echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>'; 217 213 218 214 echo '</tr><tr>'; … … 220 216 // Pages 221 217 $num = number_format_i18n( $num_pages->publish ); 222 $text = __ngettext( 'Page', 'Pages', $num_pages->publish ); 223 if ( current_user_can( 'edit_pages' ) ) { 218 if ( current_user_can( 'edit_pages' ) ) 224 219 $num = "<a href='edit-pages.php'>$num</a>"; 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>'; 220 echo '<td class="first b b_pages">'.$num.'</td>'; 221 echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>'; 229 222 230 223 // Approved Comments 231 224 $num = number_format_i18n($num_comm->approved); 232 $text = __ngettext( 'Approved', 'Approved', $num_comm->approved ); 233 if ( current_user_can( 'moderate_comments' ) ) { 225 if ( current_user_can( 'moderate_comments' ) ) 234 226 $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>"; 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>'; 227 echo '<td class="b b_approved">'.$num.'</td>'; 228 echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>'; 239 229 240 230 echo "</tr>\n\t<tr>"; … … 242 232 // Categories 243 233 $num = number_format_i18n( $num_cats ); 244 $text = __ngettext( 'Category', 'Categories', $num_cats ); 245 if ( current_user_can( 'manage_categories' ) ) { 234 if ( current_user_can( 'manage_categories' ) ) 246 235 $num = "<a href='categories.php'>$num</a>"; 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>'; 236 echo '<td class="first b b-cats">'.$num.'</td>'; 237 echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>'; 251 238 252 239 // Pending Comments 253 240 $num = number_format_i18n($num_comm->moderated); 254 $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated ); 255 if ( current_user_can( 'moderate_comments' ) ) { 241 if ( current_user_can( 'moderate_comments' ) ) 256 242 $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>"; 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>'; 243 echo '<td class="b b-waiting">'.$num.'</td>'; 244 echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>'; 261 245 262 246 echo "</tr>\n\t<tr>"; … … 264 248 // Tags 265 249 $num = number_format_i18n( $num_tags ); 266 $text = __ngettext( 'Tag', 'Tags', $num_tags ); 267 if ( current_user_can( 'manage_categories' ) ) { 250 if ( current_user_can( 'manage_categories' ) ) 268 251 $num = "<a href='edit-tags.php'>$num</a>"; 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>'; 252 echo '<td class="first b b-tags">'.$num.'</td>'; 253 echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>'; 273 254 274 255 // Spam Comments 275 256 $num = number_format_i18n($num_comm->spam); 276 $text = __ngettext( 'Spam', 'Spam', $num_comm->spam ); 277 if ( current_user_can( 'moderate_comments' ) ) { 257 if ( current_user_can( 'moderate_comments' ) ) 278 258 $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>"; 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>'; 259 echo '<td class="b b-spam">'.$num.'</td>'; 260 echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>'; 283 261 284 262 echo "</tr>"; … … 304 282 update_right_now_message(); 305 283 306 echo "\n\t".'< br class="clear" /></div>';284 echo "\n\t".'</div>'; 307 285 do_action( 'rightnow_end' ); 308 286 do_action( 'activity_box_end' ); -
tags/2.7/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 off672 673 670 if ( strpos($credentials['hostname'], ':') ) 674 671 list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2); 675 else676 unset($credentials['port']);677 672 678 673 if ( defined('FTP_SSH') || (isset($_POST['connection_type']) && 'ssh' == $_POST['connection_type']) ) … … 685 680 if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { 686 681 $stored_credentials = $credentials; 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']); 682 unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']); 691 683 update_option('ftp_credentials', $stored_credentials); 692 684 return $credentials; -
tags/2.7/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 377 372 if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { 378 373 $post = $_post = get_post($attachment_id, ARRAY_A); … … 385 380 if ( isset($attachment['menu_order']) ) 386 381 $post['menu_order'] = $attachment['menu_order']; 387 if ( isset($send_id) && $attachment_id == $send_id ) { 388 if ( isset($attachment['post_parent']) ) 389 $post['post_parent'] = $attachment['post_parent']; 390 } 382 if ( isset($attachment['post_parent']) ) 383 $post['post_parent'] = $attachment['post_parent']; 391 384 392 385 $post = apply_filters('attachment_fields_to_save', $post, $attachment); … … 416 409 } 417 410 418 if ( isset($send_id) ) { 411 if ( isset($_POST['send']) ) { 412 $keys = array_keys($_POST['send']); 413 $send_id = (int) array_shift($keys); 419 414 $attachment = stripslashes_deep( $_POST['attachments'][$send_id] ); 420 415 $html = $attachment['post_title']; -
tags/2.7/wp-admin/includes/plugin.php
r10539 r10539 122 122 $plugin_data['Title'] = $plugin_data['Name']; 123 123 124 if ( ! empty($plugin_data['AuthorURI']) && ! empty($plugin_data['Author']))124 if ( ! empty($plugin_data['AuthorURI']) ) 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( $plugin_page ) &&isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )865 if ( isset( $_wp_submenu_nopriv[$parent][$pagenow] ) ) 866 866 return false; 867 867 -
tags/2.7/wp-admin/includes/post.php
r10539 r10539 229 229 $post_data = &$_POST; 230 230 231 if ( isset($post_data['post_type']) &&'page' == $post_data['post_type'] ) {231 if ( '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 914 912 $permalink = get_permalink($post, true); 915 913 … … 929 927 $post->post_date = $original_date; 930 928 $post->post_name = $original_name; 931 unset($post->filter);932 933 929 return $permalink; 934 930 } … … 1166 1162 if ( ! empty($mce_external_languages) ) { 1167 1163 foreach ( $mce_external_languages as $name => $path ) { 1168 if ( @is_file($path) && @is_readable($path) ) {1164 if ( is_file($path) && is_readable($path) ) { 1169 1165 include_once($path); 1170 $ext_plugins .= $strings . "\n";1166 $ext_plugins .= $strings; 1171 1167 $loaded_langs[] = $name; 1172 1168 } … … 1189 1185 $path = trailingslashit( realpath($path) ); 1190 1186 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";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'); 1196 1192 1197 1193 if ( 'en' != $mce_locale && empty($strings) ) { 1198 if ( @is_file($path . 'en.js') ) {1194 if ( is_file($path . 'en.js') ) { 1199 1195 $str1 = @file_get_contents($path . 'en.js'); 1200 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n";1196 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ); 1201 1197 } 1202 1198 1203 if ( @is_file($path . 'en_dlg.js') ) {1199 if ( is_file($path . 'en_dlg.js') ) { 1204 1200 $str2 = @file_get_contents($path . 'en_dlg.js'); 1205 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n";1201 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ); 1206 1202 } 1207 1203 } -
tags/2.7/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/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, $walker = null ) { 443 if ( empty($walker) || !is_a($walker, 'Walker') ) 444 $walker = new Walker_Category_Checklist; 445 442 function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) { 443 $walker = new Walker_Category_Checklist; 446 444 $descendants_and_self = (int) $descendants_and_self; 447 445 … … 2400 2398 2401 2399 if ( $for_post ) 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;2400 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 2403 2401 2404 2402 $tab_index_attribute = ''; -
tags/2.7/wp-admin/index.php
r10539 r10539 42 42 </div><!-- wrap --> 43 43 44 <?php require( ABSPATH . 'wp-admin/admin-footer.php'); ?>44 <?php require('./admin-footer.php'); ?> -
tags/2.7/wp-admin/js/common.js
r10539 r10539 1 1 2 varwpCookies = {2 wpCookies = { 3 3 // The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL. 4 4 -
tags/2.7/wp-admin/js/editor.js
r10539 r10539 1 1 2 varswitchEditors = {2 switchEditors = { 3 3 4 4 mode : '', … … 170 170 return pee; 171 171 } 172 } ;172 } -
tags/2.7/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 bmit').click( function() { newCat.focus(); } );14 jQuery('#category-add-sumbit').click( function() { newCat.focus(); } ); 15 15 var noSyncChecks = false; // prophylactic. necessary? 16 16 var syncChecks = function() { -
tags/2.7/wp-admin/js/plugin-install.js
r10539 r10539 30 30 return false; 31 31 }); 32 33 $(window).resize( function() { tb_position() } ); 32 34 }); 33 35 -
tags/2.7/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 = preg_replace('/^www./i', '', $short_url);171 $short_url = str_replace('www.', '', $short_url); 172 172 if ('/' == substr($short_url, -1)) 173 173 $short_url = substr($short_url, 0, -1); -
tags/2.7/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]}") && ('index.php' != $submenu[$item[2]][0][2])) || !empty($menu_hook)) {77 if ( file_exists(WP_PLUGIN_DIR . "/{$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]}") && ('index.php' != $sub_item[2])) || ! empty($menu_hook) ) {118 if ( file_exists(WP_PLUGIN_DIR . "/{$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/wp-admin/menu.php
r10539 r10539 84 84 } 85 85 86 $menu[55] = array( __('Tools'), ' read', 'tools.php', '', 'menu-top', 'menu-tools', 'div' );86 $menu[55] = array( __('Tools'), 'manage_options', '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/wp-admin/theme-editor.php
r10539 r10539 97 97 98 98 $description = get_file_description($file); 99 $desc_header = ( $description != $file_show ) ? " <strong>$description</strong> (%s)" : "%s";99 $desc_header = ( $description != $file_show ) ? "$description</strong> (%s)" : "%s"; 100 100 ?> 101 101 <div class="wrap"> … … 121 121 <div class="tablenav"> 122 122 <div class="alignleft"> 123 <big>< ?php echo sprintf($desc_header, $file_show); ?></big>123 <big><strong><?php echo sprintf($desc_header, $file_show); ?></big> 124 124 </div> 125 125 <br class="clear" /> -
tags/2.7/wp-admin/update-core.php
r10539 r10539 135 135 global $wp_filesystem; 136 136 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'); 137 $url = wp_nonce_url('update-core.php?action=do-core-upgrade', 'upgrade-core'); 142 138 if ( false === ($credentials = request_filesystem_credentials($url)) ) 143 139 return; -
tags/2.7/wp-admin/wp-admin.css
r10539 r10539 16 16 } 17 17 18 .plugins . action-links {19 w hite-space: nowrap;18 .plugins .togl { 19 width: 150px; 20 20 } 21 21 … … 436 436 } 437 437 438 #ed_toolbar input, 439 #ed_reply_toolbar input { 438 #ed_toolbar input { 440 439 margin: 3px 1px 4px; 441 440 line-height: 18px; … … 450 449 -webkit-border-radius: 3px; 451 450 border-radius: 3px; 452 }453 454 #ed_reply_toolbar input {455 margin: 1px 2px 1px 1px;456 451 } 457 452 … … 1649 1644 1650 1645 #edit-slug-box { 1651 height: 1em;1652 1646 margin-top: 8px; 1653 1647 padding: 0 7px; … … 1859 1853 padding: 0; 1860 1854 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;1886 1855 } 1887 1856 … … 2284 2253 } 2285 2254 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 2286 2266 /* show/hide settings */ 2267 2287 2268 #screen-meta { 2288 2269 position: relative; -
tags/2.7/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 s://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}40 * You can generate these using the {@link http://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service} 41 41 * 42 42 * @since 2.6.0 -
tags/2.7/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 0(integer). Whether to show link name if29 * 'show_name' - Default is 1 (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/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']) && preg_match( '|^[0-9]+$|', $_GET['cat'] )) {122 } elseif ( is_category() && !empty($_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/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/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 $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : ''; 401 $output .= "\t<option value='0'$selected>$show_option_all</option>\n"; 400 $output .= "\t<option value='0'>$show_option_all</option>\n"; 402 401 } 403 402 404 403 if ( $show_option_none ) { 405 404 $show_option_none = apply_filters( 'list_cats', $show_option_none ); 406 $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : ''; 407 $output .= "\t<option value='-1'$selected>$show_option_none</option>\n"; 405 $output .= "\t<option value='-1'>$show_option_none</option>\n"; 408 406 } 409 407 … … 446 444 * 'child_of' (int) default is 0 - See {@link get_categories()}. 447 445 * 'exclude' (string) - See {@link get_categories()}. 448 * 'exclude_tree' (string) - See {@link get_categories()}.449 446 * 'echo' (bool|int) default is 1 - Whether to display or retrieve content. 450 447 * 'current_category' (int) - See {@link get_categories()}. … … 465 462 'hide_empty' => 1, 'use_desc_for_title' => 1, 466 463 'child_of' => 0, 'feed' => '', 'feed_type' => '', 467 'feed_image' => '', 'exclude' => '', ' exclude_tree' => '', 'current_category' => 0,464 'feed_image' => '', 'exclude' => '', 'current_category' => 0, 468 465 'hierarchical' => true, 'title_li' => __( 'Categories' ), 469 466 'echo' => 1, 'depth' => 0 … … 478 475 if ( isset( $r['show_date'] ) ) { 479 476 $r['include_last_update_time'] = $r['show_date']; 480 }481 482 if ( true == $r['hierarchical'] ) {483 $r['exclude_tree'] = $r['exclude'];484 $r['exclude'] = '';485 477 } 486 478 … … 545 537 * be to return the top 45 tags in the tag cloud list. 546 538 * 547 539 * The 'topic_count_text_callback' argument is a function, which, given the count 548 540 * of the posts with that tag, returns a text for the tooltip of the tag link. 541 * @see default_topic_count_text 549 542 * 550 543 * The 'exclude' and 'include' arguments are used for the {@link get_tags()} … … 621 614 * The 'topic_count_text_callback' argument is a function, which given the count 622 615 * of the posts with that tag returns a text for the tooltip of the tag link. 616 * @see default_topic_count_text 617 * 623 618 * 624 619 * @todo Complete functionality. … … 655 650 uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') ); 656 651 else 657 uasort( $tags, create_function('$a, $b', 'return ($a->count >$b->count);') );652 uasort( $tags, create_function('$a, $b', 'return ($a->count < $b->count);') ); 658 653 659 654 if ( 'DESC' == $order ) … … 726 721 */ 727 722 function walk_category_tree() { 723 $walker = new Walker_Category; 728 724 $args = func_get_args(); 729 // the user's options are the third parameter730 if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )731 $walker = new Walker_Category;732 else733 $walker = $args[2]['walker'];734 735 725 return call_user_func_array(array( &$walker, 'walk' ), $args ); 736 726 } … … 744 734 */ 745 735 function walk_category_dropdown_tree() { 736 $walker = new Walker_CategoryDropdown; 746 737 $args = func_get_args(); 747 // the user's options are the third parameter748 if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )749 $walker = new Walker_CategoryDropdown;750 else751 $walker = $args[2]['walker'];752 753 738 return call_user_func_array(array( &$walker, 'walk' ), $args ); 754 739 } -
tags/2.7/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/wp-includes/comment-template.php
r10539 r10539 834 834 835 835 $overridden_cpage = FALSE; 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);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() ); 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' 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>";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>"; 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' 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>";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>"; 1041 1041 } 1042 1042 return apply_filters('post_comments_link', $before . $link . $after, $post); -
tags/2.7/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(" /<[Aa][^>]*[Hh][Rr][Ee][Ff]=['\"]([^\"'>]+)[^>]*>/", apply_filters('comment_text',$comment), $out) >= get_option('comment_max_links') )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') ) 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_ approved = '1' 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_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 ular() || !get_option('close_comments_for_old_posts') )1583 if ( empty($posts) || !is_single() || !get_option('close_comments_for_old_posts') ) 1584 1584 return $posts; 1585 1585 -
tags/2.7/wp-includes/compat.php
r10539 r10539 97 97 } 98 98 99 if ( !function_exists( 'htmlspecialchars_decode' ) ) {100 // Added in PHP 5.1.0101 // Error checks from PEAR::PHP_Compat102 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 118 99 ?> -
tags/2.7/wp-includes/cron.php
r10539 r10539 17 17 * 18 18 * @param int $timestamp Timestamp for when to run the event. 19 * @param string $hook Action hook to executewhen cron is run.20 * @param array $args Optional. Arguments to pass to the hook 's callbackfunction.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. 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 string $hook Action hook to executewhen cron is run.47 * @param array $args Optional. Arguments to pass to the hook 's callbackfunction.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. 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 string $hook Action hook to executewhen cron is run.69 * @param array $args Optional. Arguments to pass to the hook 's callbackfunction.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. 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 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. 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. 108 105 */ 109 106 function wp_unschedule_event( $timestamp, $hook, $args = array() ) { … … 123 120 * @since 2.1.0 124 121 * 125 * @param string $hook Action hook, the execution of which will be unscheduled.122 * @param callback $hook Function or method to call, when cron is run. 126 123 * @param mixed $args,... Optional. Event arguments. 127 124 */ … … 138 135 * @since 2.1.0 139 136 * 140 * @param string $hook Action hook to executewhen cron is run.141 * @param array $args Optional. Arguments to pass to the hook 's callbackfunction.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. 142 139 * @return bool|int The UNIX timestamp of the next time the scheduled event will occur. 143 140 */ … … 284 281 * @since 2.1.0 285 282 * 286 * @param string $hook Action hook to executewhen cron is run.287 * @param array $args Optional. Arguments to pass to the hook 's callbackfunction.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. 288 285 * @return string|bool False, if no schedule. Schedule on success. 289 286 */ -
tags/2.7/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"15 14 <?php do_action('atom_ns'); ?> 16 15 > … … 65 64 </author> 66 65 67 <id><?php comment_ guid(); ?></id>66 <id><?php comment_link(); ?></id> 68 67 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated> 69 68 <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published> … … 80 79 // 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 81 80 ?> 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'); ?>" />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'); ?>" /> 83 82 <?php endif; 84 83 do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); -
tags/2.7/wp-includes/feed.php
r10539 r10539 224 224 * @subpackage Feed 225 225 * @since unknown 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); 226 */ 227 function comment_guid() { 228 echo get_comment_guid(); 231 229 } 232 230 … … 238 236 * @since unknown 239 237 * 240 * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.241 238 * @return bool|string false on failure or guid for comment on success. 242 239 */ 243 function get_comment_guid( $comment_id = null) {244 $comment = get_comment($comment_id);240 function get_comment_guid() { 241 global $comment; 245 242 246 243 if ( !is_object($comment) ) … … 256 253 */ 257 254 function comment_link() { 258 echo clean_url( get_comment_link());255 echo get_comment_link(); 259 256 } 260 257 -
tags/2.7/wp-includes/formatting.php
r10539 r10539 187 187 * Converts a number of special characters into their HTML entities. 188 188 * 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. 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. 193 194 * 194 195 * @since 1.2.2 195 196 * 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. 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. 200 199 * @return string The encoded text with HTML entities. 201 200 */ 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 ''; 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; 375 217 } 376 218 … … 1306 1148 } else { 1307 1149 $subject = str_replace('_', ' ', $matches[2]); 1308 $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject); 1150 /** @todo use preg_replace_callback() */ 1151 $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject); 1309 1152 return $subject; 1310 1153 } … … 1315 1158 * 1316 1159 * Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the 1317 * value of the 'gmt_offset' option.1160 * value of gmt_offset. 1318 1161 * 1319 1162 * @since 1.2.0 1320 1163 * 1321 * @uses get_option() to retrieve the the value of 'gmt_offset'.1322 1164 * @param string $string The date to be converted. 1323 1165 * @return string GMT version of the date provided. … … 1901 1743 */ 1902 1744 function js_escape($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 ); 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); 1908 1749 } 1909 1750 … … 1916 1757 * @return string 1917 1758 */ 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 ); 1759 function attribute_escape($text) { 1760 $safe_text = wp_specialchars($text, true); 1761 return apply_filters('attribute_escape', $safe_text, $text); 1922 1762 } 1923 1763 … … 1931 1771 */ 1932 1772 function tag_escape($tag_name) { 1933 $safe_tag = strtolower( preg_replace(' /[^a-zA-Z_:]/', '', $tag_name) );1773 $safe_tag = strtolower( preg_replace('[^a-zA-Z_:]', '', $tag_name) ); 1934 1774 return apply_filters('tag_escape', $safe_tag, $tag_name); 1935 1775 } -
tags/2.7/wp-includes/functions.php
r10539 r10539 80 80 * The 'timestamp' type will return the current timestamp. 81 81 * 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.82 * If the $gmt is set to either '1' or 'true', then both types will use the 83 * GMT offset in the WordPress option to add the GMT offset to the time. 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 timezone. Default is false.88 * @param int|bool $gmt Optional. Whether to use $gmt offset. 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 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; 2807 return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; 2816 2808 } 2817 2809 … … 2906 2898 * @return object The cloned object 2907 2899 */ 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; 2900 function wp_clone($object) { 2901 return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object); 2914 2902 } 2915 2903 -
tags/2.7/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 == ' html' )1595 if ( get_option('html_type') == 'text/html' || $doctype == 'xhtml' ) 1596 1596 $attributes[] = "lang=\"$lang\""; 1597 1597 -
tags/2.7/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-length246 // header being set.247 $r['headers']['Content-Length'] = 0;248 245 $transports = WP_Http::_getTransport($r); 249 246 } else { … … 394 391 * 395 392 * @param string $body Body content 396 * @return string Chunked decoded body on success or raw body on failure.393 * @return bool|string|WP_Error False if not chunked encoded. WP_Error on failure. Chunked decoded body on success. 397 394 */ 398 395 function chunkTransferDecode($body) { … … 405 402 //$parsedHeaders = array(); Unsupported 406 403 407 while ( true ) { 404 $done = false; 405 406 do { 408 407 $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match ); 409 408 410 409 if ( $hasChunk ) { 411 if ( empty($match[1]) ) 412 return $body; 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 } 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) ) 422 if( "0" == trim($body) ) { 423 $done = true; 423 424 return $parsedBody; // Ignore footer headers. 425 break; 426 } 424 427 } else { 425 return $body;428 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') ); 426 429 } 427 } 430 } while ( false === $done ); 428 431 } 429 432 } … … 642 645 return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); 643 646 644 if ( 'http' != $arrURL['scheme'] &&'https' != $arrURL['scheme'] )647 if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] ) 645 648 $url = str_replace($arrURL['scheme'], 'http', $url); 646 649 … … 748 751 return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); 749 752 750 if ( 'http' != $arrURL['scheme'] &&'https' != $arrURL['scheme'] )753 if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] ) 751 754 $url = str_replace($arrURL['scheme'], 'http', $url); 752 755 … … 775 778 $context = stream_context_create($arrContext); 776 779 777 if ( ! 780 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) 778 781 $handle = @fopen($url, 'r', false, $context); 779 782 else … … 980 983 } 981 984 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. 985 // If timeout is a float less than 1, round it up to 1. 984 986 if ( $r['timeout'] > 0 && $r['timeout'] < 1 ) 985 987 $r['timeout'] = 1; … … 988 990 curl_setopt( $handle, CURLOPT_URL, $url); 989 991 990 // The cURL extension requires that the option be set for the HEAD to991 // 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.1011 1010 if ( !ini_get('safe_mode') && !ini_get('open_basedir') ) 1012 1011 curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true ); … … 1064 1063 */ 1065 1064 function test() { 1066 if ( function_exists('curl_init') && function_exists('curl_exec'))1065 if ( function_exists('curl_init') ) 1067 1066 return true; 1068 1067 -
tags/2.7/wp-includes/js/autosave.js
r10539 r10539 115 115 116 116 function autosave_enable_buttons() { 117 jQuery(" .submitbox :button:disabled, .submitbox:submit:disabled").attr('disabled', '');117 jQuery("#submitpost :button:disabled, #submitpost :submit:disabled").attr('disabled', ''); 118 118 } 119 119 120 120 function autosave_disable_buttons() { 121 jQuery(" .submitbox :button:enabled, .submitbox:submit:enabled").attr('disabled', 'disabled');121 jQuery("#submitpost :button:enabled, #submitpost :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/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)";37 36 filter:alpha(opacity=75); 38 37 -moz-opacity: 0.75; -
tags/2.7/wp-includes/js/thickbox/thickbox.js
r10539 r10539 282 282 283 283 function tb_position() { 284 var isIE6 = typeof document.body.style.maxHeight === "undefined";285 284 jQuery("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); 286 if ( ! isIE6) { // take away IE6285 if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6 287 286 jQuery("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); 288 287 } -
tags/2.7/wp-includes/js/wp-ajax-response.js
r10539 r10539 1 varwpAjax = jQuery.extend( {1 wpAjax = jQuery.extend( { 2 2 unserialize: function( s ) { 3 3 var r = {}; if ( !s ) { return r; } -
tags/2.7/wp-includes/kses.php
r10539 r10539 395 395 */ 396 396 function wp_kses_split($string, $allowed_html, $allowed_protocols) { 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); 397 return preg_replace('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%e', 398 "wp_kses_split2('\\1', \$allowed_html, ".'$allowed_protocols)', $string); 402 399 } 403 400 … … 1003 1000 */ 1004 1001 function wp_kses_decode_entities($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);1002 $string = preg_replace('/&#([0-9]+);/e', 'chr("\\1")', $string); 1003 $string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', 'chr(hexdec("\\1"))', $string); 1007 1004 1008 1005 return $string; -
tags/2.7/wp-includes/link-template.php
r10539 r10539 93 93 ); 94 94 95 if ( is_object($id) && isset($id->filter) && 'sample' == $id->filter ) 96 $post = $id; 97 else 98 $post = &get_post($id); 95 $post = &get_post($id); 99 96 100 97 if ( empty($post->ID) ) return false; … … 726 723 } 727 724 728 $link = '<a class="post-edit-link"href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>';725 $link = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . attribute_escape( __( 'Edit post' ) ) . '">' . $link . '</a>'; 729 726 echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after; 730 727 } … … 776 773 } 777 774 778 $link = '<a class="comment-edit-link"href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';775 $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 779 776 echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 780 777 } … … 1246 1243 1247 1244 /** 1248 * Return thelink to next comments pages.1249 * 1250 * @since 2.7. 11245 * Display link to next comments pages. 1246 * 1247 * @since 2.7.0 1251 1248 * 1252 1249 * @param string $label Optional. Label for link text. 1253 1250 * @param int $max_page Optional. Max page. 1254 * @return string|null 1255 */ 1256 function get_next_comments_link( $label = '', $max_page = 0 ) { 1251 */ 1252 function next_comments_link($label='', $max_page = 0) { 1257 1253 global $wp_query; 1258 1254 … … 1262 1258 $page = get_query_var('cpage'); 1263 1259 1260 if ( !$page ) 1261 $page = 1; 1262 1264 1263 $nextpage = intval($page) + 1; 1265 1264 … … 1276 1275 $label = __('Newer Comments »'); 1277 1276 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. 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. 1283 1284 * 1284 1285 * @since 2.7.0 1285 1286 * 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.11297 *1298 1287 * @param string $label Optional. Label for comments link text. 1299 * @return string|null1300 */ 1301 function get_previous_comments_link( $label = '' ) { 1288 */ 1289 function previous_comments_link($label='') { 1290 1302 1291 if ( !is_singular() ) 1303 1292 return; … … 1305 1294 $page = get_query_var('cpage'); 1306 1295 1307 if ( intval($page) <= 1 ) 1296 if ( !$page ) 1297 $page = 1; 1298 1299 if ( $page <= 1 ) 1308 1300 return; 1309 1301 … … 1313 1305 $label = __('« Older Comments'); 1314 1306 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 ); 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>'; 1327 1310 } 1328 1311 … … 1355 1338 ); 1356 1339 if ( $wp_rewrite->using_permalinks() ) 1357 $defaults['base'] = user_trailingslashit( trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged');1340 $defaults['base'] = user_trailingslashit(get_permalink() . 'comment-page-%#%', 'commentpaged'); 1358 1341 1359 1342 $args = wp_parse_args( $args, $defaults ); -
tags/2.7/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 s://api.wordpress.org/secret-key/1.1/ secret key created} for you.1213 * {@link http://api.wordpress.org/secret-key/1.0/ secret key created} for you. 1214 1214 * 1215 1215 * <code> … … 1222 1222 * 1223 1223 * @since 2.5 1224 * @link http s://api.wordpress.org/secret-key/1.1/ Create a Secret Key for wp-config.php1224 * @link http://api.wordpress.org/secret-key/1.0/ 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 generate1398 * @param bool $special_chars Whether to include standard special characters1399 1397 * @return string The random password 1400 1398 **/ … … 1530 1528 } 1531 1529 1532 if ( is_ssl() )1533 $host = 'https://secure.gravatar.com';1534 else1535 $host = 'http://www.gravatar.com';1536 1537 1530 if ( 'mystery' == $default ) 1538 $default = " $host/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')1531 $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') 1539 1532 elseif ( 'blank' == $default ) 1540 1533 $default = includes_url('images/blank.gif'); … … 1542 1535 $default = ''; 1543 1536 elseif ( 'gravatar_default' == $default ) 1544 $default = " $host/avatar/s={$size}";1537 $default = "http://www.gravatar.com/avatar/s={$size}"; 1545 1538 elseif ( empty($email) ) 1546 $default = " $host/avatar/?d=$default&s={$size}";1539 $default = "http://www.gravatar.com/avatar/?d=$default&s={$size}"; 1547 1540 elseif ( strpos($default, 'http://') === 0 ) 1548 1541 $default = add_query_arg( 's', $size, $default ); 1549 1542 1550 1543 if ( !empty($email) ) { 1551 $out = "$host/avatar/";1544 $out = 'http://www.gravatar.com/avatar/'; 1552 1545 $out .= md5( strtolower( $email ) ); 1553 1546 $out .= '?s='.$size; -
tags/2.7/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 _callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output);226 $output = preg_replace('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\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') . '">' . $ args['link_before'] . $text . $args['link_after']. '</a></li>';683 $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $link_before . $text . $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 ) );1051 $date = date_i18n( $datef, strtotime( $revision->post_modified_gmt . ' +0000' ) ); 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/wp-includes/post.php
r10539 r10539 216 216 else 217 217 return $null; 218 } elseif ( is_object($post) && empty($post->filter)) {218 } elseif ( is_object($post) ) { 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;225 223 $post = (int) $post; 226 224 if ( ! $_post = wp_cache_get($post, 'posts') ) { … … 742 740 $custom = get_post_custom($post_id); 743 741 744 return isset($custom[$key]) ? $custom[$key] : null;742 return $custom[$key]; 745 743 } 746 744 … … 795 793 foreach ( array_keys(get_object_vars($post)) as $field ) 796 794 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 797 $post->filter = $context;798 795 } else { 799 796 if ( !isset($post['ID']) ) … … 801 798 foreach ( array_keys($post) as $field ) 802 799 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); 803 $post['filter'] = $context; 804 } 805 800 } 806 801 return $post; 807 802 } … … 2541 2536 if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location 2542 2537 $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 else2546 $url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.2547 2538 } 2548 2539 } -
tags/2.7/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 90123');106 $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430'); 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/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 exclude538 * from the return array, along with all of their descendant terms according to539 * the primary taxonomy. If 'include' is non-empty, 'exclude_tree' is ignored.540 *541 537 * include - Default is an empty string. A comma- or space-delimited string 542 538 * of term ids to include in the return array. … … 609 605 610 606 $defaults = array('orderby' => 'name', 'order' => 'ASC', 611 'hide_empty' => true, 'exclude' => '', ' exclude_tree' => '', 'include' => '',607 'hide_empty' => true, 'exclude' => '', 'include' => '', 612 608 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 613 609 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', … … 673 669 if ( !empty($include) ) { 674 670 $exclude = ''; 675 $exclude_tree = '';676 671 $interms = preg_split('/[\s,]+/',$include); 677 672 if ( count($interms) ) { … … 690 685 691 686 $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 else701 $exclusions .= ' AND t.term_id <> ' . intval($exterm) . ' ';702 703 }704 }705 }706 687 if ( !empty($exclude) ) { 707 688 $exterms = preg_split('/[\s,]+/',$exclude); 708 689 if ( count($exterms) ) { 709 690 foreach ( (array) $exterms as $exterm ) { 710 if ( empty($exclusions))691 if (empty($exclusions)) 711 692 $exclusions = ' AND ( t.term_id <> ' . intval($exterm) . ' '; 712 693 else … … 737 718 $where .= ' AND tt.count > 0'; 738 719 739 // don't limit the query results when we have to descend the family tree 740 if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' == $parent ) { 720 if ( !empty($number) ) { 741 721 if( $offset ) 742 $ limit= 'LIMIT ' . $offset . ',' . $number;722 $number = 'LIMIT ' . $offset . ',' . $number; 743 723 else 744 $ limit= 'LIMIT ' . $number;724 $number = 'LIMIT ' . $number; 745 725 746 726 } else 747 $ limit= '';727 $number = ''; 748 728 749 729 if ( !empty($search) ) { … … 760 740 $select_this = 't.term_id, tt.parent, tt.count, t.name'; 761 741 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); 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 765 744 if ( 'all' == $fields ) { 745 $terms = $wpdb->get_results($query); 766 746 update_term_cache($terms); 747 } else if ( ('ids' == $fields) || ('names' == $fields) ) { 748 $terms = $wpdb->get_results($query); 767 749 } 768 750 … … 810 792 $_terms[] = $term->name; 811 793 $terms = $_terms; 812 }813 814 if ( 0 < $number && intval(@count($terms)) > $number ) {815 $terms = array_slice($terms, $offset, $number);816 794 } 817 795 -
tags/2.7/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/wp-includes/version.php
r10539 r10539 9 9 * @global string $wp_version 10 10 */ 11 $wp_version = '2.7 .1';11 $wp_version = '2.7'; 12 12 13 13 /** -
tags/2.7/wp-includes/widgets.php
r10539 r10539 549 549 global $wp_registered_widgets, $wp_registered_sidebars; 550 550 551 $sidebars_widgets = get_option('sidebars_widgets' , array());551 $sidebars_widgets = get_option('sidebars_widgets'); 552 552 $_sidebars_widgets = array(); 553 553 … … 619 619 } 620 620 621 if ( isset($sidebars_widgets['array_version']) ) 622 unset($sidebars_widgets['array_version']); 621 unset($sidebars_widgets['array_version']); 623 622 624 623 $sidebars_widgets = apply_filters('sidebars_widgets', $sidebars_widgets); … … 1400 1399 <ul id="recentcomments"><?php 1401 1400 if ( $comments ) : foreach ( (array) $comments as $comment) : 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>';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>'; 1403 1402 endforeach; endif;?></ul> 1404 1403 <?php echo $after_widget; ?> … … 2094 2093 2095 2094 // This is important 2096 add_action( 'widgets_init', 'widget_many_register' ) ;2095 add_action( 'widgets_init', 'widget_many_register' ) 2097 2096 2098 2097 */ -
tags/2.7/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);20 18 21 19 /** … … 202 200 error_reporting(E_ALL); 203 201 } else { 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); 202 error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); 211 203 } 212 204 -
tags/2.7/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.' ) ); 1261 1263 } 1262 1264 … … 1284 1286 if ( isset($content_struct['author']) ) 1285 1287 $comment['comment_author'] = $content_struct['author']; 1286 1287 1288 $comment['comment_author_email'] = ''; 1288 if ( isset($content_struct['author _email']) )1289 if ( isset($content_struct['author']) ) 1289 1290 $comment['comment_author_email'] = $content_struct['author_email']; 1290 1291 1291 $comment['comment_author_url'] = ''; 1292 if ( isset($content_struct['author _url']) )1292 if ( isset($content_struct['author']) ) 1293 1293 $comment['comment_author_url'] = $content_struct['author_url']; 1294 1295 1294 $comment['user_ID'] = 0; 1296 1295 … … 2763 2762 $struct['categoryId'] = $cat->term_id; 2764 2763 $struct['parentId'] = $cat->parent; 2765 $struct['description'] = $cat->name; 2766 $struct['categoryDescription'] = $cat->description; 2764 $struct['description'] = $cat->description; 2767 2765 $struct['categoryName'] = $cat->name; 2768 2766 $struct['htmlUrl'] = wp_specialchars(get_category_link($cat->term_id));
Note: See TracChangeset
for help on using the changeset viewer.