Changes in branches/3.1 [18047:18377]
- Location:
- branches/3.1
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/readme.html
r18047 r18377 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. 311 <br /> Version 3.1.4 12 12 </h1> 13 13 <p style="text-align: center">Semantic Personal Publishing Platform</p> -
branches/3.1/wp-admin/custom-header.php
r18047 r18377 597 597 'post_mime_type' => $type, 598 598 'guid' => $url, 599 'context' => 'custom-header'); 599 'context' => 'custom-header' 600 ); 600 601 601 602 // Save the data -
branches/3.1/wp-admin/includes/deprecated.php
r18047 r18377 455 455 _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' ); 456 456 457 $this->search_term = $search_term;457 $this->search_term = stripslashes( $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[] = $ col . " LIKE '%$this->search_term%'";488 $searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' ); 489 489 $search_sql .= implode(' OR ', $searches); 490 490 $search_sql .= ')'; -
branches/3.1/wp-admin/includes/media.php
r18047 r18377 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 231 235 // Save the data 232 236 $id = wp_insert_attachment($attachment, $file, $post_id); … … 281 285 'post_content' => $content, 282 286 ), $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'] ); 283 291 284 292 // Save the attachment metadata … … 420 428 if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { 421 429 $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 422 435 if ( isset($attachment['post_content']) ) 423 436 $post['post_content'] = $attachment['post_content']; -
branches/3.1/wp-admin/includes/post.php
r18047 r18377 136 136 $post_data = &$_POST; 137 137 138 // Clear out any data in internal vars. 139 unset( $post_data['filter'] ); 140 138 141 $post_ID = (int) $post_data['post_ID']; 139 142 $post = get_post( $post_ID ); … … 342 345 } 343 346 344 $tax_names = get_object_taxonomies( get_post($post_ID) ); 347 $post = get_post( $post_ID ); 348 $tax_names = get_object_taxonomies( $post ); 345 349 foreach ( $tax_names as $tax_name ) { 346 350 $taxonomy_obj = get_taxonomy($tax_name); … … 363 367 unset( $post_data['tax_input']['category'] ); 364 368 } 369 370 $post_data['post_mime_type'] = $post->post_mime_type; 371 $post_data['guid'] = $post->guid; 365 372 366 373 $post_data['ID'] = $post_ID; … … 535 542 $_POST['post_mime_type'] = ''; 536 543 544 // Clear out any data in internal vars. 545 unset( $_POST['filter'] ); 546 537 547 // Check for autosave collisions 538 548 // Does this need to be updated? ~ Mark … … 552 562 return edit_post(); 553 563 } 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(); 554 573 } 555 574 … … 998 1017 $q['post_type'] = 'attachment'; 999 1018 $post_type = get_post_type_object( 'attachment' ); 1000 $states = array( 'inherit' );1019 $states = 'inherit'; 1001 1020 if ( current_user_can( $post_type->cap->read_private_posts ) ) 1002 $states [] = 'private';1021 $states .= ',private'; 1003 1022 1004 1023 $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states; -
branches/3.1/wp-admin/includes/update-core.php
r18047 r18377 295 295 $required_php_version = '4.3'; 296 296 $required_mysql_version = '4.1.2'; 297 $wp_version = '3.1. 3';297 $wp_version = '3.1.4'; 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
r18047 r18377 30 30 } 31 31 32 $(document).ready( 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]').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'); 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; 49 } 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 }); 45 64 }); 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>'); 60 } 61 $('#'+sel).attr('selected', 'selected'); 62 }); 63 }); 65 }); 64 66 65 67 })(jQuery); -
branches/3.1/wp-admin/js/user-profile.js
r18047 r18377 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);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); -
branches/3.1/wp-admin/options-general.php
r18047 r18377 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>'), $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>'), esc_html( $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
r18047 r18377 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 2-22 08:27:35+00:00\n"7 "POT-Creation-Date: 2011-06-13 13:27:47+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 post 19 20 #: loop-attachment.php:23 20 21 msgid "<span class=\"meta-nav\">←</span> %s" … … 187 188 msgstr "" 188 189 190 #. translators: header image description 189 191 #: functions.php:140 190 192 msgid "Berries" 191 193 msgstr "" 192 194 195 #. translators: header image description 193 196 #: functions.php:146 194 197 msgid "Cherry Blossoms" 195 198 msgstr "" 196 199 200 #. translators: header image description 197 201 #: functions.php:152 198 202 msgid "Concave" 199 203 msgstr "" 200 204 205 #. translators: header image description 201 206 #: functions.php:158 202 207 msgid "Fern" 203 208 msgstr "" 204 209 210 #. translators: header image description 205 211 #: functions.php:164 206 212 msgid "Forest Floor" 207 213 msgstr "" 208 214 215 #. translators: header image description 209 216 #: functions.php:170 210 217 msgid "Inkwell" 211 218 msgstr "" 212 219 220 #. translators: header image description 213 221 #: functions.php:176 214 222 msgid "Path" 215 223 msgstr "" 216 224 225 #. translators: header image description 217 226 #: functions.php:182 218 227 msgid "Sunset" … … 227 236 msgstr "" 228 237 238 #. translators: 1: date, 2: time 229 239 #: functions.php:340 230 240 msgid "%1$s at %2$s" -
branches/3.1/wp-includes/bookmark.php
r18047 r18377 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; 223 226 default: 224 227 $orderparams = array(); 225 foreach ( explode(',', $orderby) as $ordparam ) 226 $orderparams[] = 'link_' . trim($ordparam); 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 } 227 233 $orderby = implode(',', $orderparams); 228 234 } 229 235 230 if ( 'link_id' == $orderby ) 231 $orderby = "$wpdb->links.link_id"; 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'; 232 242 233 243 $visible = ''; -
branches/3.1/wp-includes/formatting.php
r18047 r18377 2441 2441 } 2442 2442 break; 2443 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; 2444 2451 case 'thumbnail_size_w': 2445 2452 case 'thumbnail_size_h': … … 2535 2542 } 2536 2543 break; 2544 case 'WPLANG': 2545 $allowed = get_available_languages(); 2546 if ( ! in_array( $value, $allowed ) && ! empty( $value ) ) 2547 $value = get_option( $option ); 2548 break; 2537 2549 2538 2550 default : … … 2913 2925 */ 2914 2926 function sanitize_mime_type( $mime_type ) { 2915 $sani_mime_type = preg_replace( '/[^- *.a-zA-Z0-9\/]/', '', $mime_type );2927 $sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type ); 2916 2928 return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type ); 2917 2929 } -
branches/3.1/wp-includes/post.php
r18047 r18377 2411 2411 2412 2412 $postarr = wp_parse_args($postarr, $defaults); 2413 2414 unset( $postarr[ 'filter' ] ); 2415 2413 2416 $postarr = sanitize_post($postarr, 'db'); 2414 2417 … … 3422 3425 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3423 3426 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 else 3452 $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 3424 3464 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3425 3465 $query .= $author_query; … … 3547 3587 if ( !empty($parent) ) 3548 3588 $object['post_parent'] = $parent; 3589 3590 unset( $object[ 'filter' ] ); 3549 3591 3550 3592 $object = sanitize_post($object, 'db'); -
branches/3.1/wp-includes/script-loader.php
r18047 r18377 260 260 ) ); 261 261 262 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110 113' );262 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110628' ); 263 263 $scripts->add_data( 'user-profile', 'group', 1 ); 264 264 -
branches/3.1/wp-includes/taxonomy.php
r18047 r18377 1195 1195 elseif ( empty($_orderby) || 'id' == $_orderby ) 1196 1196 $orderby = 't.term_id'; 1197 else 1198 $orderby = 't.name'; 1197 1199 1198 1200 $orderby = apply_filters( 'get_terms_orderby', $orderby, $args ); … … 1202 1204 else 1203 1205 $order = ''; 1206 1207 $order = strtoupper( $order ); 1208 if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) ) 1209 $order = 'ASC'; 1204 1210 1205 1211 $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')"; -
branches/3.1/wp-includes/version.php
r18047 r18377 23 23 * @global string $wp_version 24 24 */ 25 $wp_version = '3.1. 3';25 $wp_version = '3.1.4'; 26 26 27 27 /** -
branches/3.1/wp-includes/wp-db.php
r18047 r18377 645 645 if ( null === $blog_id ) 646 646 $blog_id = $this->blogid; 647 $blog_id = (int) $blog_id; 647 648 if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) ) 648 649 return $this->base_prefix; -
branches/3.1/wp-settings.php
r18047 r18377 259 259 $locale = get_locale(); 260 260 $locale_file = WP_LANG_DIR . "/$locale.php"; 261 if ( is_readable( $locale_file ) )261 if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) 262 262 require( $locale_file ); 263 263 unset($locale_file);
Note: See TracChangeset
for help on using the changeset viewer.