WordPress.org

Make WordPress Core


Ignore:
Location:
branches/2.2
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-admin/import/wordpress.php

    r5414 r5464  
    6666            $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user
    6767            if (!$user_id) { //banging my head against the desk now.
    68                 if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
     68                if ($this->newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
    6969                    $user_id = wp_create_user($author, $pass);
    7070                    $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank.
     
    8585    function get_entries() {
    8686        set_magic_quotes_runtime(0);
    87         $importdata = file($this->file); // Read the file into an array
    88         $importdata = implode('', $importdata); // squish it
    89         $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
    90         preg_match_all('|<item>(.*?)</item>|is', $importdata, $this->posts);
    91         $this->posts = $this->posts[1];
     87        $importdata = array_map('rtrim', file($this->file)); // Read the file into an array
     88
     89        $this->posts = array();
     90        $this->categories = array();
     91        $num = 0;
     92        $doing_entry = false;
     93        foreach ($importdata as $importline) {
     94            if ( false !== strpos($importline, '<wp:category>') ) {
     95                preg_match('|<wp:category>(.*?)</wp:category>|is', $importline, $category);
     96                $this->categories[] = $category[1];
     97                continue;
     98            }
     99            if ( false !== strpos($importline, '<item>') ) {
     100                $this->posts[$num] = '';
     101                $doing_entry = true;
     102                continue;   
     103            }
     104            if ( false !== strpos($importline, '</item>') ) {
     105                $num++;
     106                $doing_entry = false;
     107                continue;   
     108            }
     109            if ( $doing_entry ) {
     110                $this->posts[$num] .= $importline . "\n";
     111            }
     112        }
     113
    92114        foreach ($this->posts as $post) {
    93115            $post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
    94             if ($post_ID)
     116            if ($post_ID) {
    95117                $this->posts_processed[$post_ID][0] = &$post;
    96118                $this->posts_processed[$post_ID][1] = 0;
    97         }
    98         preg_match_all('|<wp:category>(.*?)</wp:category>|is', $importdata, $this->categories);
    99         $this->categories = $this->categories[1];
     119            }
     120        }
    100121    }
    101122
  • branches/2.2/wp-admin/link-import.php

    r5414 r5464  
    9494
    9595        if ( isset($opml_url) && $opml_url != '' ) {
    96             $opml = wp_remote_fopen($opml_url);
     96            if ( $blogrolling === true ) {
     97                $opml = wp_remote_fopen($opml_url);
     98            } else {
     99                $opml = file_get_contents($opml_url);
     100            }
     101           
    97102            include_once('link-parse-opml.php');
    98103
     
    119124
    120125if ( ! $blogrolling )
     126    apply_filters( 'wp_delete_file', $opml_url);
    121127    @unlink($opml_url);
    122128?>
  • branches/2.2/wp-admin/link-manager.php

    r5414 r5464  
    181181                default:
    182182                    ?>
    183                     <td><?php do_action('manage_link_custom_column', $column_name, $id); ?></td>
     183                    <td><?php do_action('manage_link_custom_column', $column_name, $link->link_id); ?></td>
    184184                    <?php
    185185                    break;
  • branches/2.2/wp-admin/upgrade-functions.php

    r5414 r5464  
    11131113    $plugins = __get_option( 'active_plugins' );
    11141114   
    1115     foreach ( $plugins as $plugin ) {
     1115    foreach ( (array) $plugins as $plugin ) {
    11161116        if ( basename( $plugin ) == 'widgets.php' ) {
    11171117            array_splice( $plugins, array_search( $plugin, $plugins ), 1 );
  • branches/2.2/wp-admin/widgets.php

    r5414 r5464  
    9797        var right = p[0];
    9898        var top = p[1];
    99         var left = $('shadow').offsetWidth - (el.offsetWidth + left);
     99        var left = $('shadow').offsetWidth - (el.offsetWidth + right);
    100100        var bottom = $('shadow').offsetHeight - (el.offsetHeight + top);
    101101        if ( right < 1 ) el.style.left = 0;
  • branches/2.2/wp-blog-header.php

    r5414 r5464  
    88    require_once( dirname(__FILE__) . '/wp-includes/classes.php');
    99    require_once( dirname(__FILE__) . '/wp-includes/functions.php');
     10    require_once( dirname(__FILE__) . '/wp-includes/plugin.php');
    1011    wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can <a href='{$path}setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress &rsaquo; Error");
    1112}
  • branches/2.2/wp-config-sample.php

    • Property svn:eol-style changed from native to CRLF
  • branches/2.2/wp-includes/default-filters.php

    r5414 r5464  
    174174add_action('mce_options', '_mce_set_direction');
    175175add_action('init', 'smilies_init', 5);
    176 
    177176add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
     177add_action( 'shutdown', 'wp_ob_end_flush_all', 1);
    178178
    179179?>
  • branches/2.2/wp-includes/functions.php

    r5414 r5464  
    916916        $text = 'Gone';
    917917
    918     if ( version_compare(phpversion(), '4.3.0', '>=') )
    919         @header("HTTP/1.1 $header $text", true, $header);
    920     else
    921         @header("HTTP/1.1 $header $text");
     918    $protocol = $_SERVER["SERVER_PROTOCOL"];
     919    if ( ('HTTP/1.1' != $protocol) && ('HTTP/1.0' != $protocol) )
     920        $protocol = 'HTTP/1.0';
     921    $status_header = "$protocol $header $text";
     922    $status_header = apply_filters('status_header', $status_header, $header, $text, $protocol);
     923
     924    if ( version_compare( phpversion(), '4.3.0', '>=' ) ) {
     925        return @header( $status_header, true, $header );
     926    } else {
     927        return @header( $status_header );
     928    }
    922929}
    923930
     
    15051512}
    15061513
     1514// For PHP 5.2, make sure all output buffers are flushed
     1515// before our singletons our destroyed.
     1516function wp_ob_end_flush_all()
     1517{
     1518    while ( @ob_end_flush() );
     1519}
     1520
    15071521?>
  • branches/2.2/wp-includes/general-template.php

    r5414 r5464  
    810810function user_can_richedit() {
    811811    global $wp_rich_edit, $pagenow;
    812 
    813     if ( !isset($wp_rich_edit) )
    814         $wp_rich_edit = ( 'true' == get_user_option('rich_editing') && !preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) && 'comment.php' != $pagenow && rich_edit_exists() ) ? true : false;
     812   
     813    if ( !isset( $wp_rich_edit) ) {
     814        if ( get_user_option( 'rich_editing' ) == 'true' &&
     815            ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) ||
     816                !preg_match( '!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT'] ) ) ) {
     817            $wp_rich_edit = true;
     818        } else {
     819            $wp_rich_edit = false;
     820        }
     821    }
    815822
    816823    return apply_filters('user_can_richedit', $wp_rich_edit);
  • branches/2.2/wp-includes/pluggable.php

    r5414 r5464  
    121121    if ( $userdata )
    122122        return $userdata;
     123
     124    $user_login = $wpdb->escape($user_login);
    123125
    124126    if ( !$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$user_login'") )
  • branches/2.2/wp-includes/post.php

    r5414 r5464  
    225225    if (!empty($exclusions))
    226226        $exclusions .= ')';
    227 
    228     $query ="SELECT DISTINCT * FROM $wpdb->posts " ;
    229     $query .= ( empty( $category ) ? "" : ", $wpdb->post2cat " );
    230     $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " );
    231     $query .= " WHERE (post_type = 'post' AND post_status = 'publish') $exclusions $inclusions ";
    232     $query .= ( empty( $category ) ? "" : "AND ($wpdb->posts.ID = $wpdb->post2cat.post_id AND $wpdb->post2cat.category_id = " . $category. ") " );
    233     $query .= ( empty( $meta_key ) | empty($meta_value)  ? "" : " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )" );
    234     $query .= " GROUP BY $wpdb->posts.ID ORDER BY " . $orderby . " " . $order . " LIMIT " . $offset . ',' . $numberposts;
    235227
    236228    $query  = "SELECT DISTINCT * FROM $wpdb->posts ";
  • branches/2.2/wp-includes/version.php

    r5414 r5464  
    33// This holds the version number in a separate file so we can bump it without cluttering the SVN
    44
    5 $wp_version = '2.2-RC1';
     5$wp_version = '2.2-RC2';
    66$wp_db_version = 5183;
    77
  • branches/2.2/wp-includes/widgets.php

    r5414 r5464  
    387387    if($d) {
    388388?>
    389         <select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(__('Select Month')); ?></option> <?php wp_get_archives('type=monthly&format=option'); ?> </select>
     389        <select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(__('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>
    390390<?php   
    391391    } else {
  • branches/2.2/xmlrpc.php

    r5414 r5464  
    55// Some browser-embedded clients send cookies. We don't want them.
    66$_COOKIE = array();
     7
     8// A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,
     9// but we can do it ourself.
     10if ( !isset( $HTTP_RAW_POST_DATA ) ) {
     11    $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
     12}
    713
    814# fix for mozBlog and other cases where '<?xml' isn't on the very first line
Note: See TracChangeset for help on using the changeset viewer.