Changes in branches/3.1 [18378:18044]
- Location:
- branches/3.1
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/readme.html
r18378 r18044 9 9 <h1 id="logo"> 10 10 <a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" width="250" height="68" /></a> 11 <br /> Version 3.1. 411 <br /> Version 3.1.3 12 12 </h1> 13 13 <p style="text-align: center">Semantic Personal Publishing Platform</p> -
branches/3.1/wp-admin/custom-header.php
r18378 r18044 597 597 'post_mime_type' => $type, 598 598 'guid' => $url, 599 'context' => 'custom-header' 600 ); 599 'context' => 'custom-header'); 601 600 602 601 // Save the data -
branches/3.1/wp-admin/includes/deprecated.php
r18378 r18044 455 455 _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' ); 456 456 457 $this->search_term = stripslashes( $search_term );457 $this->search_term = $search_term; 458 458 $this->raw_page = ( '' == $page ) ? false : (int) $page; 459 459 $this->page = (int) ( '' == $page ) ? 1 : $page; … … 486 486 $search_sql = 'AND ('; 487 487 foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col ) 488 $searches[] = $ wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );488 $searches[] = $col . " LIKE '%$this->search_term%'"; 489 489 $search_sql .= implode(' OR ', $searches); 490 490 $search_sql .= ')'; -
branches/3.1/wp-admin/includes/media.php
r18378 r18044 229 229 ), $post_data ); 230 230 231 // This should never be set as it would then overwrite an existing attachment.232 if ( isset( $attachment['ID'] ) )233 unset( $attachment['ID'] );234 235 231 // Save the data 236 232 $id = wp_insert_attachment($attachment, $file, $post_id); … … 285 281 'post_content' => $content, 286 282 ), $post_data ); 287 288 // This should never be set as it would then overwrite an existing attachment.289 if ( isset( $attachment['ID'] ) )290 unset( $attachment['ID'] );291 283 292 284 // Save the attachment metadata … … 428 420 if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { 429 421 $post = $_post = get_post($attachment_id, ARRAY_A); 430 $post_type_object = get_post_type_object( $post[ 'post_type' ] );431 432 if ( !current_user_can( $post_type_object->cap->edit_post, $attachment_id ) )433 continue;434 435 422 if ( isset($attachment['post_content']) ) 436 423 $post['post_content'] = $attachment['post_content']; -
branches/3.1/wp-admin/includes/post.php
r18378 r18044 136 136 $post_data = &$_POST; 137 137 138 // Clear out any data in internal vars.139 unset( $post_data['filter'] );140 141 138 $post_ID = (int) $post_data['post_ID']; 142 139 $post = get_post( $post_ID ); … … 345 342 } 346 343 347 $post = get_post( $post_ID ); 348 $tax_names = get_object_taxonomies( $post ); 344 $tax_names = get_object_taxonomies( get_post($post_ID) ); 349 345 foreach ( $tax_names as $tax_name ) { 350 346 $taxonomy_obj = get_taxonomy($tax_name); … … 367 363 unset( $post_data['tax_input']['category'] ); 368 364 } 369 370 $post_data['post_mime_type'] = $post->post_mime_type;371 $post_data['guid'] = $post->guid;372 365 373 366 $post_data['ID'] = $post_ID; … … 542 535 $_POST['post_mime_type'] = ''; 543 536 544 // Clear out any data in internal vars.545 unset( $_POST['filter'] );546 547 537 // Check for autosave collisions 548 538 // Does this need to be updated? ~ Mark … … 562 552 return edit_post(); 563 553 } 564 }565 566 // Edit don't write if we have a post id.567 if ( isset( $_POST['ID'] ) ) {568 $_POST['post_ID'] = $_POST['ID'];569 unset ( $_POST['ID'] );570 }571 if ( isset( $_POST['post_ID'] ) ) {572 return edit_post();573 554 } 574 555 … … 1017 998 $q['post_type'] = 'attachment'; 1018 999 $post_type = get_post_type_object( 'attachment' ); 1019 $states = 'inherit';1000 $states = array( 'inherit' ); 1020 1001 if ( current_user_can( $post_type->cap->read_private_posts ) ) 1021 $states .= ',private';1002 $states[] = 'private'; 1022 1003 1023 1004 $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states; -
branches/3.1/wp-admin/includes/update-core.php
r18378 r18044 295 295 $required_php_version = '4.3'; 296 296 $required_mysql_version = '4.1.2'; 297 $wp_version = '3.1. 4';297 $wp_version = '3.1.3'; 298 298 $php_compat = version_compare( $php_version, $required_php_version, '>=' ); 299 299 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); -
branches/3.1/wp-admin/js/user-profile.dev.js
r18378 r18044 30 30 } 31 31 32 $(document).ready( function() {32 $(document).ready( function() { 33 33 $('#pass1').val('').keyup( check_pass_strength ); 34 34 $('#pass2').val('').keyup( check_pass_strength ); 35 35 $('#pass-strength-result').show(); 36 $('.color-palette').click(function(){$(this).siblings('input[name="admin_color"]').prop('checked', true)}); 37 $('#first_name, #last_name, #nickname').blur(function(){ 38 var select = $('#display_name'), current = select.find('option:selected').attr('id'), dub = [], 39 inputs = { 40 display_nickname : $('#nickname').val(), 41 display_username : $('#user_login').val(), 42 display_firstname : $('#first_name').val(), 43 display_lastname : $('#last_name').val() 44 }; 45 46 if ( inputs.display_firstname && inputs.display_lastname ) { 47 inputs['display_firstlast'] = inputs.display_firstname + ' ' + inputs.display_lastname; 48 inputs['display_lastfirst'] = inputs.display_lastname + ' ' + inputs.display_firstname; 36 $('.color-palette').click(function(){$(this).siblings('input[name=admin_color]').attr('checked', 'checked')}); 37 $('#nickname').blur(function(){ 38 var str = $(this).val() || $('#user_login').val(); 39 var select = $('#display_name'); 40 var sel = select.children('option:selected').attr('id'); 41 select.children('#display_nickname').remove(); 42 if ( ! select.children('option[value=' + str + ']').length ) 43 select.append('<option id="display_nickname" value="' + str + '">' + str + '</option>'); 44 $('#'+sel).attr('selected', 'selected'); 45 }); 46 $('#first_name, #last_name').blur(function(){ 47 var select = $('#display_name'); 48 var first = $('#first_name').val(), last = $('#last_name').val(); 49 var sel = select.children('option:selected').attr('id'); 50 $('#display_firstname, #display_lastname, #display_firstlast, #display_lastfirst').remove(); 51 if ( first && ! select.children('option[value=' + first + ']').length ) 52 select.append('<option id="display_firstname" value="' + first + '">' + first + '</option>'); 53 if ( last && ! select.children('option[value=' + last + ']').length ) 54 select.append('<option id="display_lastname" value="' + last + '">' + last + '</option>'); 55 if ( first && last ) { 56 if ( ! select.children('option[value=' + first + ' ' + last + ']').length ) 57 select.append('<option id="display_firstlast" value="' + first + ' ' + last + '">' + first + ' ' + last + '</option>'); 58 if ( ! select.children('option[value=' + last + ' ' + first + ']').length ) 59 select.append('<option id="display_lastfirst" value="' + last + ' ' + first + '">' + last + ' ' + first + '</option>'); 49 60 } 50 51 $('option', select).remove(); 52 $.each(inputs, function( id, value ) { 53 var val = value.replace(/<\/?[a-z][^>]*>/gi, ''); 54 55 if ( inputs[id].length && $.inArray( val, dub ) == -1 ) { 56 dub.push(val); 57 $('<option />', { 58 'id': id, 59 'text': val, 60 'selected': (id == current) 61 }).appendTo( select ); 62 } 63 }); 61 $('#'+sel).attr('selected', 'selected'); 64 62 }); 65 63 }); 66 64 67 65 })(jQuery); -
branches/3.1/wp-admin/js/user-profile.js
r18378 r18044 1 (function(a){function b(){var e=a("#pass1").val(),d=a("#user_login").val(),c=a("#pass2").val(),f;a("#pass-strength-result").removeClass("short bad good strong");if(!e){a("#pass-strength-result").html(pwsL10n.empty);return}f=passwordStrength(e,d,c);switch(f){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}a(document).ready(function(){a("#pass1").val("").keyup(b);a("#pass2").val("").keyup(b);a("#pass-strength-result").show();a(".color-palette").click(function(){a(this).siblings( 'input[name="admin_color"]').prop("checked",true)});a("#first_name, #last_name, #nickname").blur(function(){var c=a("#display_name"),e=c.find("option:selected").attr("id"),f=[],d={display_nickname:a("#nickname").val(),display_username:a("#user_login").val(),display_firstname:a("#first_name").val(),display_lastname:a("#last_name").val()};if(d.display_firstname&&d.display_lastname){d.display_firstlast=d.display_firstname+" "+d.display_lastname;d.display_lastfirst=d.display_lastname+" "+d.display_firstname}a("option",c).remove();a.each(d,function(i,g){var h=g.replace(/<\/?[a-z][^>]*>/gi,"");if(d[i].length&&a.inArray(h,f)==-1){f.push(h);a("<option />",{id:i,text:h,selected:(i==e)}).appendTo(c)}})})})})(jQuery);1 (function(a){function b(){var e=a("#pass1").val(),d=a("#user_login").val(),c=a("#pass2").val(),f;a("#pass-strength-result").removeClass("short bad good strong");if(!e){a("#pass-strength-result").html(pwsL10n.empty);return}f=passwordStrength(e,d,c);switch(f){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}a(document).ready(function(){a("#pass1").val("").keyup(b);a("#pass2").val("").keyup(b);a("#pass-strength-result").show();a(".color-palette").click(function(){a(this).siblings("input[name=admin_color]").attr("checked","checked")});a("#nickname").blur(function(){var e=a(this).val()||a("#user_login").val();var c=a("#display_name");var d=c.children("option:selected").attr("id");c.children("#display_nickname").remove();if(!c.children("option[value="+e+"]").length){c.append('<option id="display_nickname" value="'+e+'">'+e+"</option>")}a("#"+d).attr("selected","selected")});a("#first_name, #last_name").blur(function(){var c=a("#display_name");var f=a("#first_name").val(),d=a("#last_name").val();var e=c.children("option:selected").attr("id");a("#display_firstname, #display_lastname, #display_firstlast, #display_lastfirst").remove();if(f&&!c.children("option[value="+f+"]").length){c.append('<option id="display_firstname" value="'+f+'">'+f+"</option>")}if(d&&!c.children("option[value="+d+"]").length){c.append('<option id="display_lastname" value="'+d+'">'+d+"</option>")}if(f&&d){if(!c.children("option[value="+f+" "+d+"]").length){c.append('<option id="display_firstlast" value="'+f+" "+d+'">'+f+" "+d+"</option>")}if(!c.children("option[value="+d+" "+f+"]").length){c.append('<option id="display_lastfirst" value="'+d+" "+f+'">'+d+" "+f+"</option>")}}a("#"+e).attr("selected","selected")})})})(jQuery); -
branches/3.1/wp-admin/options-general.php
r18378 r18044 128 128 if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?> 129 129 <div class="updated inline"> 130 <p><?php printf( __('There is a pending change of the admin e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), esc_html( $new_admin_email ), esc_url( admin_url( 'options.php?dismiss=new_admin_email' ) ) ); ?></p>130 <p><?php printf( __('There is a pending change of the admin e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_admin_email, esc_url( admin_url( 'options.php?dismiss=new_admin_email' ) ) ); ?></p> 131 131 </div> 132 132 <?php endif; ?> -
branches/3.1/wp-content/themes/twentyten/languages/twentyten.pot
r18378 r18044 5 5 "Project-Id-Version: Twenty Ten 1.2\n" 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/tag/twentyten\n" 7 "POT-Creation-Date: 2011-0 6-13 13:27:47+00:00\n"7 "POT-Creation-Date: 2011-02-22 08:27:35+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=UTF-8\n" … … 17 17 msgstr "" 18 18 19 #. translators: %s - title of parent post20 19 #: loop-attachment.php:23 21 20 msgid "<span class=\"meta-nav\">←</span> %s" … … 188 187 msgstr "" 189 188 190 #. translators: header image description191 189 #: functions.php:140 192 190 msgid "Berries" 193 191 msgstr "" 194 192 195 #. translators: header image description196 193 #: functions.php:146 197 194 msgid "Cherry Blossoms" 198 195 msgstr "" 199 196 200 #. translators: header image description201 197 #: functions.php:152 202 198 msgid "Concave" 203 199 msgstr "" 204 200 205 #. translators: header image description206 201 #: functions.php:158 207 202 msgid "Fern" 208 203 msgstr "" 209 204 210 #. translators: header image description211 205 #: functions.php:164 212 206 msgid "Forest Floor" 213 207 msgstr "" 214 208 215 #. translators: header image description216 209 #: functions.php:170 217 210 msgid "Inkwell" 218 211 msgstr "" 219 212 220 #. translators: header image description221 213 #: functions.php:176 222 214 msgid "Path" 223 215 msgstr "" 224 216 225 #. translators: header image description226 217 #: functions.php:182 227 218 msgid "Sunset" … … 236 227 msgstr "" 237 228 238 #. translators: 1: date, 2: time239 229 #: functions.php:340 240 230 msgid "%1$s at %2$s" -
branches/3.1/wp-includes/bookmark.php
r18378 r18044 214 214 $orderby = strtolower($orderby); 215 215 $length = ''; 216 switch ( $orderby) {216 switch ($orderby) { 217 217 case 'length': 218 218 $length = ", CHAR_LENGTH(link_name) AS length"; … … 221 221 $orderby = 'rand()'; 222 222 break; 223 case 'link_id':224 $orderby = "$wpdb->links.link_id";225 break;226 223 default: 227 224 $orderparams = array(); 228 foreach ( explode(',', $orderby) as $ordparam ) { 229 $ordparam = trim($ordparam); 230 if ( in_array( $ordparam, array( 'name', 'url', 'visible', 'rating', 'owner', 'updated' ) ) ) 231 $orderparams[] = 'link_' . $ordparam; 232 } 225 foreach ( explode(',', $orderby) as $ordparam ) 226 $orderparams[] = 'link_' . trim($ordparam); 233 227 $orderby = implode(',', $orderparams); 234 228 } 235 229 236 if ( empty( $orderby ) ) 237 $orderby = 'link_name'; 238 239 $order = strtoupper( $order ); 240 if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) ) 241 $order = 'ASC'; 230 if ( 'link_id' == $orderby ) 231 $orderby = "$wpdb->links.link_id"; 242 232 243 233 $visible = ''; -
branches/3.1/wp-includes/formatting.php
r18378 r18044 2441 2441 } 2442 2442 break; 2443 case 'new_admin_email': 2444 $value = sanitize_email($value); 2445 if ( !is_email($value) ) { 2446 $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization 2447 if ( function_exists('add_settings_error') ) 2448 add_settings_error('new_admin_email', 'invalid_admin_email', __('The email address entered did not appear to be a valid email address. Please enter a valid email address.')); 2449 } 2450 break; 2443 2451 2444 case 'thumbnail_size_w': 2452 2445 case 'thumbnail_size_h': … … 2542 2535 } 2543 2536 break; 2544 case 'WPLANG':2545 $allowed = get_available_languages();2546 if ( ! in_array( $value, $allowed ) && ! empty( $value ) )2547 $value = get_option( $option );2548 break;2549 2537 2550 2538 default : … … 2925 2913 */ 2926 2914 function sanitize_mime_type( $mime_type ) { 2927 $sani_mime_type = preg_replace( '/[^- +*.a-zA-Z0-9\/]/', '', $mime_type );2915 $sani_mime_type = preg_replace( '/[^-*.a-zA-Z0-9\/]/', '', $mime_type ); 2928 2916 return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type ); 2929 2917 } -
branches/3.1/wp-includes/post.php
r18378 r18044 2411 2411 2412 2412 $postarr = wp_parse_args($postarr, $defaults); 2413 2414 unset( $postarr[ 'filter' ] );2415 2416 2413 $postarr = sanitize_post($postarr, 'db'); 2417 2414 … … 3425 3422 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3426 3423 3427 $orderby_array = array();3428 $allowed_keys = array('author', 'post_author', 'date', 'post_date', 'title', 'post_title', 'modified',3429 'post_modified', 'modified_gmt', 'post_modified_gmt', 'menu_order', 'parent', 'post_parent',3430 'ID', 'rand', 'comment_count');3431 foreach ( explode( ',', $sort_column ) as $orderby ) {3432 $orderby = trim( $orderby );3433 if ( !in_array( $orderby, $allowed_keys ) )3434 continue;3435 3436 switch ( $orderby ) {3437 case 'menu_order':3438 break;3439 case 'ID':3440 $orderby = "$wpdb->posts.ID";3441 break;3442 case 'rand':3443 $orderby = 'RAND()';3444 break;3445 case 'comment_count':3446 $orderby = "$wpdb->posts.comment_count";3447 break;3448 default:3449 if ( 0 === strpos( $orderby, 'post_' ) )3450 $orderby = "$wpdb->posts." . $orderby;3451 else3452 $orderby = "$wpdb->posts.post_" . $orderby;3453 }3454 3455 $orderby_array[] = $orderby;3456 3457 }3458 $sort_column = ! empty( $orderby_array ) ? implode( ',', $orderby_array ) : "$wpdb->posts.post_title";3459 3460 $sort_order = strtoupper( $sort_order );3461 if ( '' !== $sort_order && !in_array( $sort_order, array( 'ASC', 'DESC' ) ) )3462 $sort_order = 'ASC';3463 3464 3424 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3465 3425 $query .= $author_query; … … 3587 3547 if ( !empty($parent) ) 3588 3548 $object['post_parent'] = $parent; 3589 3590 unset( $object[ 'filter' ] );3591 3549 3592 3550 $object = sanitize_post($object, 'db'); -
branches/3.1/wp-includes/query.php
r18378 r18044 1626 1626 } 1627 1627 1628 if ( ! empty( $qv['post_status'] ) ) { 1629 if ( is_array( $qv['post_status'] ) ) 1630 $qv['post_status'] = array_map('sanitize_key', $qv['post_status']); 1631 else 1632 $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']); 1633 } 1628 if ( !empty($qv['post_status']) ) 1629 $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']); 1634 1630 1635 1631 if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) ) … … 2390 2386 } 2391 2387 2392 if ( ! empty( $q['post_status'] )) {2388 if ( isset($q['post_status']) && '' != $q['post_status'] ) { 2393 2389 $statuswheres = array(); 2394 $q_status = $q['post_status']; 2395 if ( ! is_array( $q_status ) ) 2396 $q_status = explode(',', $q_status); 2390 $q_status = explode(',', $q['post_status']); 2397 2391 $r_status = array(); 2398 2392 $p_status = array(); 2399 2393 $e_status = array(); 2400 if ( in_array('any', $q_status)) {2394 if ( $q['post_status'] == 'any' ) { 2401 2395 foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status ) 2402 2396 $e_status[] = "$wpdb->posts.post_status <> '$status'"; -
branches/3.1/wp-includes/script-loader.php
r18378 r18044 260 260 ) ); 261 261 262 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110 628' );262 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110113' ); 263 263 $scripts->add_data( 'user-profile', 'group', 1 ); 264 264 -
branches/3.1/wp-includes/taxonomy.php
r18378 r18044 1195 1195 elseif ( empty($_orderby) || 'id' == $_orderby ) 1196 1196 $orderby = 't.term_id'; 1197 else1198 $orderby = 't.name';1199 1197 1200 1198 $orderby = apply_filters( 'get_terms_orderby', $orderby, $args ); … … 1204 1202 else 1205 1203 $order = ''; 1206 1207 $order = strtoupper( $order );1208 if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )1209 $order = 'ASC';1210 1204 1211 1205 $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')"; -
branches/3.1/wp-includes/version.php
r18378 r18044 23 23 * @global string $wp_version 24 24 */ 25 $wp_version = '3.1. 4';25 $wp_version = '3.1.3'; 26 26 27 27 /** -
branches/3.1/wp-includes/wp-db.php
r18378 r18044 645 645 if ( null === $blog_id ) 646 646 $blog_id = $this->blogid; 647 $blog_id = (int) $blog_id;648 647 if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) ) 649 648 return $this->base_prefix; -
branches/3.1/wp-settings.php
r18378 r18044 259 259 $locale = get_locale(); 260 260 $locale_file = WP_LANG_DIR . "/$locale.php"; 261 if ( ( 0 === validate_file( $locale ) ) &&is_readable( $locale_file ) )261 if ( is_readable( $locale_file ) ) 262 262 require( $locale_file ); 263 263 unset($locale_file);
Note: See TracChangeset
for help on using the changeset viewer.