Make WordPress Core

Changes from tags/2.6.1 at r8849 to tags/2.6.2 at r8849


Ignore:
Location:
tags/2.6.2
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • tags/2.6.2/wp-admin/css/press-this-ie.css

    • Property svn:eol-style set to native
    r8849 r8849  
    1 
    21#posting {
    32    position: static !important;
  • tags/2.6.2/wp-admin/import/textpattern.php

    r8849 r8849  
    334334                $category1 = $category1->term_id;
    335335                $category2 = get_category_by_slug($Category2);
    336                 $category2 = $category1->term_id;
     336                $category2 = $category2->term_id;
    337337                if($cat1 = $category1) { $cats[1] = $cat1; }
    338338                if($cat2 = $category2) { $cats[2] = $cat2; }
  • tags/2.6.2/wp-admin/includes/image.php

    r8849 r8849  
    220220            $iptc = iptcparse($info['APP13']);
    221221            if ( !empty($iptc['2#110'][0]) ) // credit
    222                 $meta['credit'] = trim( $iptc['2#110'][0] );
     222                $meta['credit'] = utf8_encode(trim($iptc['2#110'][0]));
    223223            elseif ( !empty($iptc['2#080'][0]) ) // byline
    224                 $meta['credit'] = trim( $iptc['2#080'][0] );
     224                $meta['credit'] = utf8_encode(trim($iptc['2#080'][0]));
    225225            if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created datee and time
    226226                $meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]);
    227227            if ( !empty($iptc['2#120'][0]) ) // caption
    228                 $meta['caption'] = trim( $iptc['2#120'][0] );
     228                $meta['caption'] = utf8_encode(trim($iptc['2#120'][0]));
    229229            if ( !empty($iptc['2#116'][0]) ) // copyright
    230                 $meta['copyright'] = trim( $iptc['2#116'][0] );
     230                $meta['copyright'] = utf8_encode(trim($iptc['2#116'][0]));
    231231            if ( !empty($iptc['2#005'][0]) ) // title
    232                 $meta['title'] = trim( $iptc['2#005'][0] );
     232                $meta['title'] = utf8_encode(trim($iptc['2#005'][0]));
    233233         }
    234234    }
  • tags/2.6.2/wp-admin/includes/template.php

    r8849 r8849  
    716716            ORDER BY comment_date_gmt DESC LIMIT $start, $num");
    717717    } else {
    718         $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
     718        $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
    719719    }
    720720
  • tags/2.6.2/wp-includes/formatting.php

    r8849 r8849  
    332332    if ( $strict )
    333333        $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username);
     334
     335    // Consolidate contiguous whitespace
     336    $username = preg_replace('|\s+|', ' ', $username);
    334337
    335338    return apply_filters('sanitize_user', $username, $raw_username, $strict);
  • tags/2.6.2/wp-includes/pluggable.php

    r8849 r8849  
    12901290    $password = '';
    12911291    for ( $i = 0; $i < $length; $i++ )
    1292         $password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
     1292        $password .= substr($chars, wp_rand(0, strlen($chars) - 1), 1);
    12931293    return $password;
     1294}
     1295endif;
     1296
     1297if ( !function_exists('wp_rand') ) :
     1298 /**
     1299 * Generates a random number
     1300 *
     1301 * @since 2.6.2
     1302 *
     1303 * @param int $min Lower limit for the generated number (optional, default is 0)
     1304 * @param int $max Upper limit for the generated number (optional, default is 4294967295)
     1305 * @return int A random number between min and max
     1306 */
     1307function wp_rand( $min = 0, $max = 0 ) {
     1308    global $rnd_value;
     1309
     1310    $seed = get_option('random_seed');
     1311
     1312    // Reset $rnd_value after 14 uses
     1313    // 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
     1314    if ( strlen($rnd_value) < 8 ) {
     1315        $rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );
     1316        $rnd_value .= sha1($rnd_value);
     1317        $rnd_value .= sha1($rnd_value . $seed);
     1318        $seed = md5($seed . $rnd_value);
     1319        update_option('random_seed', $seed);
     1320    }
     1321
     1322    // Take the first 8 digits for our value
     1323    $value = substr($rnd_value, 0, 8);
     1324
     1325    // Strip the first eight, leaving the remainder for the next call to wp_rand().
     1326    $rnd_value = substr($rnd_value, 8);
     1327
     1328    $value = abs(hexdec($value));
     1329
     1330    // Reduce the value to be within the min - max range
     1331    // 4294967295 = 0xffffffff = max random number
     1332    if ( $max != 0 )
     1333        $value = $min + (($max - $min + 1) * ($value / (4294967295 + 1)));
     1334
     1335    return abs(intval($value));
    12941336}
    12951337endif;
  • tags/2.6.2/wp-includes/post.php

    r8849 r8849  
    466466        'exclude' => '', 'meta_key' => '',
    467467        'meta_value' =>'', 'post_type' => 'post',
    468         'post_parent' => 0
     468        'post_parent' => 0, 'suppress_filters' => true
    469469    );
    470470
     
    595595    $meta_cache = wp_cache_get($post_id, 'post_meta');
    596596
     597    if ( !$meta_cache ) {
     598        update_postmeta_cache($post_id);
     599        $meta_cache = wp_cache_get($post_id, 'post_meta');
     600    }
     601
    597602    if ( isset($meta_cache[$key]) ) {
    598603        if ( $single ) {
    599604            return maybe_unserialize( $meta_cache[$key][0] );
    600605        } else {
    601             return maybe_unserialize( $meta_cache[$key] );
    602         }
    603     }
    604 
    605     if ( !$meta_cache ) {
    606         update_postmeta_cache($post_id);
    607         $meta_cache = wp_cache_get($post_id, 'post_meta');
    608     }
    609 
    610     if ( $single ) {
    611         if ( isset($meta_cache[$key][0]) )
    612             return maybe_unserialize($meta_cache[$key][0]);
    613         else
    614             return '';
    615     } else {
    616         return maybe_unserialize($meta_cache[$key]);
    617     }
     606            return array_map('maybe_unserialize', $meta_cache[$key]);
     607        }
     608    }
     609
     610    return '';
    618611}
    619612
     
    32983291        return;
    32993292
    3300     if ( isset($post['post_type']) && 'revision' == $post_post['type'] )
     3293    if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
    33013294        return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
    33023295
  • tags/2.6.2/wp-includes/query.php

    r8849 r8849  
    776776            $qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
    777777
    778         if ( $this->is_posts_page && !$qv['withcomments'] )
     778        if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) )
    779779            $this->is_comment_feed = false;
    780780
     
    830830        $search = '';
    831831        $groupby = '';
     832        $fields = "$wpdb->posts.*";
    832833        $post_status_join = false;
     834        $page = 1;
     835
     836        if ( !isset($q['suppress_filters']) )
     837            $q['suppress_filters'] = false;
    833838
    834839        if ( !isset($q['post_type']) ) {
     
    13621367        // Apply filters on where and join prior to paging so that any
    13631368        // manipulations to them are reflected in the paging by day queries.
    1364         $where = apply_filters('posts_where', $where);
    1365         $join = apply_filters('posts_join', $join);
     1369        if ( !$q['suppress_filters'] ) {
     1370            $where = apply_filters('posts_where', $where);
     1371            $join = apply_filters('posts_join', $join);
     1372        }
    13661373
    13671374        // Paging
     
    13951402            }
    13961403
    1397             $cjoin = apply_filters('comment_feed_join', $cjoin);
    1398             $cwhere = apply_filters('comment_feed_where', $cwhere);
    1399             $cgroupby = apply_filters('comment_feed_groupby', $cgroupby);
     1404            if ( !$q['suppress_filters'] ) {
     1405                $cjoin = apply_filters('comment_feed_join', $cjoin);
     1406                $cwhere = apply_filters('comment_feed_where', $cwhere);
     1407                $cgroupby = apply_filters('comment_feed_groupby', $cgroupby);
     1408            }
    14001409
    14011410            $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss'));
     
    14151424        }
    14161425
     1426        $orderby = $q['orderby'];
     1427
    14171428        // Apply post-paging filters on where and join.  Only plugins that
    14181429        // manipulate paging queries should use these hooks.
    1419 
    1420         $where = apply_filters('posts_where_paged', $where);
    1421         $groupby = apply_filters('posts_groupby', $groupby);
    1422         $join = apply_filters('posts_join_paged', $join);
    1423         $orderby = apply_filters('posts_orderby', $q['orderby']);
    1424         $distinct = apply_filters('posts_distinct', $distinct);
    1425         $fields = apply_filters('posts_fields', "$wpdb->posts.*");
    1426         $limits = apply_filters( 'post_limits', $limits );
     1430        if ( !$q['suppress_filters'] ) {
     1431            $where = apply_filters('posts_where_paged', $where);
     1432            $groupby = apply_filters('posts_groupby', $groupby);
     1433            $join = apply_filters('posts_join_paged', $join);
     1434            $orderby = apply_filters('posts_orderby', $orderby);
     1435            $distinct = apply_filters('posts_distinct', $distinct);
     1436            $fields = apply_filters('posts_fields', $fields);
     1437            $limits = apply_filters( 'post_limits', $limits );
     1438        }
    14271439
    14281440        // Announce current selection parameters.  For use by caching plugins.
     
    14301442
    14311443        // Filter again for the benefit of caching plugins.  Regular plugins should use the hooks above.
    1432         $where = apply_filters('posts_where_request', $where);
    1433         $groupby = apply_filters('posts_groupby_request', $groupby);
    1434         $join = apply_filters('posts_join_request', $join);
    1435         $orderby = apply_filters('posts_orderby_request', $orderby);
    1436         $distinct = apply_filters('posts_distinct_request', $distinct);
    1437         $fields = apply_filters('posts_fields_request', $fields);
    1438         $limits = apply_filters( 'post_limits_request', $limits );
     1444        if ( !$q['suppress_filters'] ) {
     1445            $where = apply_filters('posts_where_request', $where);
     1446            $groupby = apply_filters('posts_groupby_request', $groupby);
     1447            $join = apply_filters('posts_join_request', $join);
     1448            $orderby = apply_filters('posts_orderby_request', $orderby);
     1449            $distinct = apply_filters('posts_distinct_request', $distinct);
     1450            $fields = apply_filters('posts_fields_request', $fields);
     1451            $limits = apply_filters( 'post_limits_request', $limits );
     1452        }
    14391453
    14401454        if ( ! empty($groupby) )
     
    14461460            $found_rows = 'SQL_CALC_FOUND_ROWS';
    14471461
    1448         $request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    1449         $this->request = apply_filters('posts_request', $request);
     1462        $this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
     1463        if ( !$q['suppress_filters'] )
     1464            $this->request = apply_filters('posts_request', $this->request);
    14501465
    14511466        $this->posts = $wpdb->get_results($this->request);
    14521467        // Raw results filter.  Prior to status checks.
    1453         $this->posts = apply_filters('posts_results', $this->posts);
     1468        if ( !$q['suppress_filters'] )
     1469            $this->posts = apply_filters('posts_results', $this->posts);
    14541470
    14551471        if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
     
    14981514        }
    14991515
    1500         $this->posts = apply_filters('the_posts', $this->posts);
     1516        if ( !$q['suppress_filters'] )
     1517            $this->posts = apply_filters('the_posts', $this->posts);
    15011518
    15021519        update_post_caches($this->posts);
  • tags/2.6.2/wp-includes/version.php

    r8849 r8849  
    99 * @global string $wp_version
    1010 */
    11 $wp_version = '2.6.1';
     11$wp_version = '2.6.2';
    1212
    1313/**
  • tags/2.6.2/wp-includes/widgets.php

    r8849 r8849  
    11631163            }
    11641164
    1165             echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>";
    1166         }
     1165            if ( $link == '' ) {
     1166                echo "<li>$title{$date}{$summary}{$author}</li>";
     1167            } else {
     1168                echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>";
     1169            }
     1170}
    11671171        echo '</ul>';
    11681172    } else {
  • tags/2.6.2/wp-login.php

    r8849 r8849  
    424424
    425425    $user = wp_signon('', $secure_cookie);
     426
     427    $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
    426428
    427429    if ( !is_wp_error($user) ) {
  • tags/2.6.2/wp-settings.php

    r8849 r8849  
    102102
    103103if ( version_compare( '4.3', phpversion(), '>' ) ) {
    104     die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, php_version() ) );
     104    die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) );
    105105}
    106106
Note: See TracChangeset for help on using the changeset viewer.