Make WordPress Core


Ignore:
Location:
branches/3.1
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/readme.html

    r18378 r18044  
    99<h1 id="logo">
    1010    <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.4
     11    <br /> Version 3.1.3
    1212</h1>
    1313<p style="text-align: center">Semantic Personal Publishing Platform</p>
  • branches/3.1/wp-admin/custom-header.php

    r18378 r18044  
    597597        'post_mime_type' => $type,
    598598        'guid' => $url,
    599         'context' => 'custom-header'
    600         );
     599        'context' => 'custom-header');
    601600
    602601        // Save the data
  • branches/3.1/wp-admin/includes/deprecated.php

    r18378 r18044  
    455455        _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
    456456
    457         $this->search_term = stripslashes( $search_term );
     457        $this->search_term = $search_term;
    458458        $this->raw_page = ( '' == $page ) ? false : (int) $page;
    459459        $this->page = (int) ( '' == $page ) ? 1 : $page;
     
    486486            $search_sql = 'AND (';
    487487            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%'";
    489489            $search_sql .= implode(' OR ', $searches);
    490490            $search_sql .= ')';
  • branches/3.1/wp-admin/includes/media.php

    r18378 r18044  
    229229    ), $post_data );
    230230
    231     // This should never be set as it would then overwrite an existing attachment.
    232     if ( isset( $attachment['ID'] ) )
    233         unset( $attachment['ID'] );
    234 
    235231    // Save the data
    236232    $id = wp_insert_attachment($attachment, $file, $post_id);
     
    285281        'post_content' => $content,
    286282    ), $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'] );
    291283
    292284    // Save the attachment metadata
     
    428420    if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
    429421        $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 
    435422        if ( isset($attachment['post_content']) )
    436423            $post['post_content'] = $attachment['post_content'];
  • branches/3.1/wp-admin/includes/post.php

    r18378 r18044  
    136136        $post_data = &$_POST;
    137137
    138     // Clear out any data in internal vars.
    139     unset( $post_data['filter'] );
    140 
    141138    $post_ID = (int) $post_data['post_ID'];
    142139    $post = get_post( $post_ID );
     
    345342        }
    346343
    347         $post = get_post( $post_ID );
    348         $tax_names = get_object_taxonomies( $post );
     344        $tax_names = get_object_taxonomies( get_post($post_ID) );
    349345        foreach ( $tax_names as $tax_name ) {
    350346            $taxonomy_obj = get_taxonomy($tax_name);
     
    367363            unset( $post_data['tax_input']['category'] );
    368364        }
    369 
    370         $post_data['post_mime_type'] = $post->post_mime_type;
    371         $post_data['guid'] = $post->guid;
    372365
    373366        $post_data['ID'] = $post_ID;
     
    542535    $_POST['post_mime_type'] = '';
    543536
    544     // Clear out any data in internal vars.
    545     unset( $_POST['filter'] );
    546 
    547537    // Check for autosave collisions
    548538    // Does this need to be updated? ~ Mark
     
    562552            return edit_post();
    563553        }
    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();
    573554    }
    574555
     
    1017998    $q['post_type'] = 'attachment';
    1018999    $post_type = get_post_type_object( 'attachment' );
    1019     $states = 'inherit';
     1000    $states = array( 'inherit' );
    10201001    if ( current_user_can( $post_type->cap->read_private_posts ) )
    1021         $states .= ',private';
     1002        $states[] = 'private';
    10221003
    10231004    $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states;
  • branches/3.1/wp-admin/includes/update-core.php

    r18378 r18044  
    295295    $required_php_version = '4.3';
    296296    $required_mysql_version = '4.1.2';
    297     $wp_version = '3.1.4';
     297    $wp_version = '3.1.3';
    298298    $php_compat     = version_compare( $php_version, $required_php_version, '>=' );
    299299    $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  
    3030    }
    3131
    32     $(document).ready(function() {
     32    $(document).ready( function() {
    3333        $('#pass1').val('').keyup( check_pass_strength );
    3434        $('#pass2').val('').keyup( check_pass_strength );
    3535        $('#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>');
    4960            }
    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');
    6462        });
    65     });
     63    });
    6664
    6765})(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  
    128128if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?>
    129129<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>
    131131</div>
    132132<?php endif; ?>
  • branches/3.1/wp-content/themes/twentyten/languages/twentyten.pot

    r18378 r18044  
    55"Project-Id-Version: Twenty Ten 1.2\n"
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/twentyten\n"
    7 "POT-Creation-Date: 2011-06-13 13:27:47+00:00\n"
     7"POT-Creation-Date: 2011-02-22 08:27:35+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=UTF-8\n"
     
    1717msgstr ""
    1818
    19 #. translators: %s - title of parent post
    2019#: loop-attachment.php:23
    2120msgid "<span class=\"meta-nav\">&larr;</span> %s"
     
    188187msgstr ""
    189188
    190 #. translators: header image description
    191189#: functions.php:140
    192190msgid "Berries"
    193191msgstr ""
    194192
    195 #. translators: header image description
    196193#: functions.php:146
    197194msgid "Cherry Blossoms"
    198195msgstr ""
    199196
    200 #. translators: header image description
    201197#: functions.php:152
    202198msgid "Concave"
    203199msgstr ""
    204200
    205 #. translators: header image description
    206201#: functions.php:158
    207202msgid "Fern"
    208203msgstr ""
    209204
    210 #. translators: header image description
    211205#: functions.php:164
    212206msgid "Forest Floor"
    213207msgstr ""
    214208
    215 #. translators: header image description
    216209#: functions.php:170
    217210msgid "Inkwell"
    218211msgstr ""
    219212
    220 #. translators: header image description
    221213#: functions.php:176
    222214msgid "Path"
    223215msgstr ""
    224216
    225 #. translators: header image description
    226217#: functions.php:182
    227218msgid "Sunset"
     
    236227msgstr ""
    237228
    238 #. translators: 1: date, 2: time
    239229#: functions.php:340
    240230msgid "%1$s at %2$s"
  • branches/3.1/wp-includes/bookmark.php

    r18378 r18044  
    214214    $orderby = strtolower($orderby);
    215215    $length = '';
    216     switch ( $orderby ) {
     216    switch ($orderby) {
    217217        case 'length':
    218218            $length = ", CHAR_LENGTH(link_name) AS length";
     
    221221            $orderby = 'rand()';
    222222            break;
    223         case 'link_id':
    224             $orderby = "$wpdb->links.link_id";
    225             break;
    226223        default:
    227224            $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);
    233227            $orderby = implode(',', $orderparams);
    234228    }
    235229
    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";
    242232
    243233    $visible = '';
  • branches/3.1/wp-includes/formatting.php

    r18378 r18044  
    24412441            }
    24422442            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
    24512444        case 'thumbnail_size_w':
    24522445        case 'thumbnail_size_h':
     
    25422535            }
    25432536            break;
    2544         case 'WPLANG':
    2545             $allowed = get_available_languages();
    2546             if ( ! in_array( $value, $allowed ) && ! empty( $value ) )
    2547                 $value = get_option( $option );
    2548             break;
    25492537
    25502538        default :
     
    29252913 */
    29262914function 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 );
    29282916    return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
    29292917}
  • branches/3.1/wp-includes/post.php

    r18378 r18044  
    24112411
    24122412    $postarr = wp_parse_args($postarr, $defaults);
    2413 
    2414     unset( $postarr[ 'filter' ] );
    2415 
    24162413    $postarr = sanitize_post($postarr, 'db');
    24172414
     
    34253422    $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status );
    34263423
    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 
    34643424    $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where ";
    34653425    $query .= $author_query;
     
    35873547    if ( !empty($parent) )
    35883548        $object['post_parent'] = $parent;
    3589 
    3590     unset( $object[ 'filter' ] );
    35913549
    35923550    $object = sanitize_post($object, 'db');
  • branches/3.1/wp-includes/query.php

    r18378 r18044  
    16261626        }
    16271627
    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']);
    16341630
    16351631        if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) )
     
    23902386        }
    23912387
    2392         if ( ! empty( $q['post_status'] ) ) {
     2388        if ( isset($q['post_status']) && '' != $q['post_status'] ) {
    23932389            $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']);
    23972391            $r_status = array();
    23982392            $p_status = array();
    23992393            $e_status = array();
    2400             if ( in_array('any', $q_status) ) {
     2394            if ( $q['post_status'] == 'any' ) {
    24012395                foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status )
    24022396                    $e_status[] = "$wpdb->posts.post_status <> '$status'";
  • branches/3.1/wp-includes/script-loader.php

    r18378 r18044  
    260260    ) );
    261261
    262     $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110628' );
     262    $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110113' );
    263263    $scripts->add_data( 'user-profile', 'group', 1 );
    264264
  • branches/3.1/wp-includes/taxonomy.php

    r18378 r18044  
    11951195    elseif ( empty($_orderby) || 'id' == $_orderby )
    11961196        $orderby = 't.term_id';
    1197     else
    1198         $orderby = 't.name';
    11991197
    12001198    $orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
     
    12041202    else
    12051203        $order = '';
    1206 
    1207     $order = strtoupper( $order );
    1208     if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
    1209         $order = 'ASC';
    12101204
    12111205    $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
  • branches/3.1/wp-includes/version.php

    r18378 r18044  
    2323 * @global string $wp_version
    2424 */
    25 $wp_version = '3.1.4';
     25$wp_version = '3.1.3';
    2626
    2727/**
  • branches/3.1/wp-includes/wp-db.php

    r18378 r18044  
    645645            if ( null === $blog_id )
    646646                $blog_id = $this->blogid;
    647             $blog_id = (int) $blog_id;
    648647            if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) )
    649648                return $this->base_prefix;
  • branches/3.1/wp-settings.php

    r18378 r18044  
    259259$locale = get_locale();
    260260$locale_file = WP_LANG_DIR . "/$locale.php";
    261 if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) )
     261if ( is_readable( $locale_file ) )
    262262    require( $locale_file );
    263263unset($locale_file);
Note: See TracChangeset for help on using the changeset viewer.