Make WordPress Core


Ignore:
Location:
branches/2.8
Files:
72 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8/readme.html

    r11698 r11553  
    99<h1 id="logo" style="text-align: center">
    1010    <img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
    11     <br /> Version 2.8.1
     11    <br /> Version 2.8
    1212</h1>
    1313<p style="text-align: center">Semantic Personal Publishing Platform</p>
     
    3030<h1>Upgrading</h1>
    3131<p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p>
    32 <h2>Upgrading from any previous WordPress to 2.8.1:</h2>
     32<h2>Upgrading from any previous WordPress to 2.8:</h2>
    3333<ol>
    3434    <li>Delete your old WP files, saving ones you've modified.</li>
  • branches/2.8/wp-admin/admin-ajax.php

    r11698 r11553  
    603603        die('-1');
    604604    $search = isset($_POST['s']) ? $_POST['s'] : false;
    605     $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all';
    606     $per_page = isset($_POST['per_page']) ?  (int) $_POST['per_page'] + 8 : 28;
    607     $start = isset($_POST['page']) ? ( intval($_POST['page']) * $per_page ) -1 : $per_page - 1;
    608     if ( 1 > $start )
    609         $start = 27;
    610 
     605    $start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24;
     606    $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false;
    611607    $mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
    612608    $p = isset($_POST['p']) ? $_POST['p'] : 0;
     
    819815        if ( !current_user_can( 'edit_post', $meta->post_id ) )
    820816            die('-1');
    821         if ( $meta->meta_value != stripslashes($value) ) {
    822             if ( !$u = update_meta( $mid, $key, $value ) )
    823                 die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
    824         }
     817        if ( !$u = update_meta( $mid, $key, $value ) )
     818            die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
    825819
    826820        $key = stripslashes($key);
  • branches/2.8/wp-admin/admin.php

    r11698 r11553  
    147147    // Make sure rules are flushed
    148148    global $wp_rewrite;
    149     $wp_rewrite->flush_rules(false);
     149    $wp_rewrite->flush_rules();
    150150
    151151    exit();
  • branches/2.8/wp-admin/css/colors-classic.css

    r11698 r11553  
    268268}
    269269
    270 .side-info h5 {
     270.side-info h5, .bordertitle {
    271271    border-bottom-color: #dadada;
    272272}
  • branches/2.8/wp-admin/css/colors-fresh.css

    r11698 r11553  
    268268}
    269269
    270 .side-info h5 {
     270.side-info h5, .bordertitle {
    271271    border-bottom-color: #dadada;
    272272}
  • branches/2.8/wp-admin/css/global.css

    r11698 r11553  
    376376    border-width: 1px;
    377377    border-style: solid;
     378    border-collapse: separate;
    378379    border-spacing: 0;
    379380    width: 100%;
  • branches/2.8/wp-admin/css/ie.css

    r11698 r11553  
    247247#col-container,
    248248#col-left,
    249 #col-right,
    250 .fileedit-sub {
     249#col-right {
    251250    display: block;
    252251    zoom: 100%;
     
    339338}
    340339
    341 .widefat {
    342     empty-cells: show;
    343     border-collapse: collapse;
    344 }
    345 
    346340.tablenav a.button-secondary {
    347341    display: inline-block;
  • branches/2.8/wp-admin/css/theme-editor-rtl.css

    r11698 r11553  
    22    float: left;
    33}
     4#themeselector {
     5    padding-right: 0;
     6    padding-left: 5px;
     7    float: left;
     8}
     9div.tablenav {
     10    margin-right: 0;
     11    margin-left: 210px;
     12}
  • branches/2.8/wp-admin/css/theme-editor.css

    r11698 r11553  
    1212    float: right;
    1313    width: 190px;
    14     word-wrap: break-word;
    1514}
    1615
    17 #templateside h3,
    18 #postcustomstuff p.submit {
     16#templateside h3, #postcustomstuff p.submit {
    1917    margin: 0;
    2018}
    2119
    22 #templateside h4 {
    23     margin: 1em 0 0;
     20h3#bordertitle {
     21    margin-bottom: 10px;
    2422}
    2523
    26 #templateside ol,
    27 #templateside ul {
     24#templateside h4 {
     25    margin-bottom: 0;
     26}
     27
     28#templateside ol, #templateside ul {
     29    list-style: none;
    2830    margin: .5em;
    2931    padding: 0;
    3032}
    3133
    32 #templateside li {
    33     margin: 4px 0;
     34#templateside ol li, #templateside ul li {
     35    margin: 1px 0;
     36}
     37
     38#themeselector {
     39    padding-right: 5px;
     40    float: right;
     41    position: relative;
     42    bottom: 25px;
     43    top:20px;
     44}
     45
     46#themeselector select {
     47    margin: 0;
     48    padding: 0;
    3449}
    3550
     
    4055.highlight {
    4156    padding: 1px;
     57}
     58
     59div.bordertitle h2 {
     60    border: none;
     61    padding-bottom: 0;
    4262}
    4363
     
    5474    font-weight: bold;
    5575}
    56 
    57 .fileedit-sub {
    58     padding: 10px 0 8px;
    59     line-height: 180%;
    60 }
  • branches/2.8/wp-admin/edit-category-form.php

    r11698 r11553  
    7070            <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
    7171        </tr>
    72         <?php do_action('edit_category_form_fields', $category); ?>
    7372    </table>
    7473<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Category'); ?>" /></p>
  • branches/2.8/wp-admin/edit-comments.php

    r11698 r11553  
    194194$start = $offset = ( $page - 1 ) * $comments_per_page;
    195195
    196 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 8, $post_id, $comment_type ); // Grab a few extra
     196list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra
    197197
    198198$_comment_post_ids = array();
     
    359359    <input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
    360360    <input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
    361     <input type="hidden" name="page" value="<?php echo esc_attr($page); ?>" />
    362     <input type="hidden" name="per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
     361    <input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" />
    363362    <input type="hidden" name="p" value="<?php echo esc_attr( $post_id ); ?>" />
    364363    <input type="hidden" name="comment_type" value="<?php echo esc_attr( $comment_type ); ?>" />
  • branches/2.8/wp-admin/edit-link-category-form.php

    r11698 r11553  
    7575            <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
    7676        </tr>
    77         <?php do_action('edit_link_category_form_fields', $category); ?>
    7877    </table>
    7978<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr($submit_text) ?>" /></p>
  • branches/2.8/wp-admin/edit-tag-form.php

    r11698 r11553  
    4040            <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
    4141        </tr>
    42         <?php do_action('edit_tag_form_fields', $tag); ?>
    4342    </table>
    4443<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Tag'); ?>" /></p>
  • branches/2.8/wp-admin/includes/class-wp-filesystem-direct.php

    r11698 r11553  
    2121        $this->method = 'direct';
    2222        $this->errors = new WP_Error();
     23        $this->permission = umask();
    2324    }
    2425    function connect() {
     
    6465    }
    6566    function chmod($file, $mode = false, $recursive = false) {
     67        if ( ! $mode )
     68            $mode = $this->permission;
    6669        if ( ! $this->exists($file) )
    6770            return false;
    68 
    69         if ( ! $mode ) {
    70             if ( $this->permission )
    71                 $mode = $this->permission;
    72             elseif ( $this->is_file($file) )
    73                 $mode = FS_CHMOD_FILE;
    74             elseif ( $this->is_dir($file) )
    75                 $mode = FS_CHMOD_DIR;
    76             else
    77                 return false;   
    78         }
    79 
    80         if ( ! $recursive )
    81             return @chmod($file, $mode);
     71        if ( ! $recursive )
     72            return @chmod($file,$mode);
    8273        if ( ! $this->is_dir($file) )
    8374            return @chmod($file, $mode);
     
    207198
    208199    function mkdir($path, $chmod = false, $chown = false, $chgrp = false){
    209         if ( ! @mkdir($path) )
    210             return false;
    211         $this->chmod($path, $chmod);
     200        if ( ! $chmod)
     201            $chmod = $this->permission;
     202
     203        if ( ! @mkdir($path, $chmod) )
     204            return false;
    212205        if ( $chown )
    213206            $this->chown($path, $chown);
  • branches/2.8/wp-admin/includes/class-wp-filesystem-ssh2.php

    r11698 r11553  
    1414 * @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes
    1515 *
    16  * Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work)
     16 * Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now.)
    1717 *
    1818 * cd /usr/src
     
    2323 * make all install
    2424 *
    25  * Note: Do not leave the directory yet!
     25 * Note: No not leave the directory yet!
    2626 *
    2727 * Enter: pecl install -f ssh2
     
    3434 * Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp  exist.
    3535 *
    36  * Note: as of WordPress 2.8, This utilises the PHP5+ function 'stream_get_contents'
    3736 *
    3837 * @since 2.7
     
    4746    var $keys = false;
    4847    /*
    49      * This is the timeout value for ssh results.
     48     * This is the timeout value for ssh results to comeback.
    5049     * Slower servers might need this incressed, but this number otherwise should not change.
    5150     *
     
    6867            return false;
    6968        }
    70         if ( !function_exists('stream_get_contents') ) {
    71             $this->errors->add('ssh2_php_requirement', __('The ssh2 PHP extension is available, however, we require the PHP5 function <code>stream_get_contents()</code>'));
     69        if ( ! version_compare(phpversion(), '5', '>=') ) {
     70            $this->errors->add('ssh2_php_requirement', __('The ssh2 PHP extension is available, however requires PHP 5+'));
    7271            return false;
    7372        }
     
    103102
    104103        if ( empty ($opt['password']) ) {
    105             if ( !$this->keys ) //password can be blank if we are using keys
     104            if ( !$this->keys ) //   password can be blank if we are using keys
    106105                $this->errors->add('empty_password', __('SSH2 password is required'));
    107106        } else {
     
    130129        } else {
    131130            if ( ! @ssh2_auth_pubkey_file($this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) {
    132                 $this->errors->add('auth', sprintf(__('Public and Private keys incorrect for %s'), $this->options['username']));
     131                $this->errors->add('auth', sprintf(__('Public and Private keys incorrent for %s'), $this->options['username']));
    133132                return false;
    134133            }
     
    150149            stream_set_blocking( $stream, true );
    151150            stream_set_timeout( $stream, $this->timeout );
    152             $data = stream_get_contents( $stream );
    153             fclose( $stream );
     151            $data = stream_get_contents($stream);
    154152
    155153            if ( $returnbool )
    156                 return ( $data === false ) ? false : '' != trim($data);
     154                return '' != trim($data);
    157155            else
    158156                return $data;
     
    169167    function get_contents($file, $type = '', $resumepos = 0 ) {
    170168        $file = ltrim($file, '/');
    171         return file_get_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     169        return file_get_contents('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    172170    }
    173171
    174172    function get_contents_array($file) {
    175173        $file = ltrim($file, '/');
    176         return file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     174        return file('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    177175    }
    178176
    179177    function put_contents($file, $contents, $type = '' ) {
    180178        $file = ltrim($file, '/');
    181         return file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
     179        return file_put_contents('ssh2.sftp://' . $this->sftp_link .'/' . $file, $contents);
    182180    }
    183181
     
    273271
    274272    function exists($file) {
    275         $file = ltrim($file, '/');
    276         return file_exists('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     273        //return $this->run_command(sprintf('ls -lad %s', escapeshellarg($file)), true);
     274        $file = ltrim($file, '/');
     275        return file_exists('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    277276    }
    278277
    279278    function is_file($file) {
    280279        $file = ltrim($file, '/');
    281         return is_file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     280        return is_file('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    282281    }
    283282
    284283    function is_dir($path) {
    285284        $path = ltrim($path, '/');
    286         return is_dir('ssh2.sftp://' . $this->sftp_link . '/' . $path);
     285        return is_dir('ssh2.sftp://' . $this->sftp_link .'/' . $path);
    287286    }
    288287
    289288    function is_readable($file) {
    290289        $file = ltrim($file, '/');
    291         return is_readable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     290        return is_readable('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    292291    }
    293292
    294293    function is_writable($file) {
    295294        $file = ltrim($file, '/');
    296         return is_writable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     295        return is_writable('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    297296    }
    298297
    299298    function atime($file) {
    300299        $file = ltrim($file, '/');
    301         return fileatime('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     300        return fileatime('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    302301    }
    303302
    304303    function mtime($file) {
    305304        $file = ltrim($file, '/');
    306         return filemtime('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     305        return filemtime('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    307306    }
    308307
    309308    function size($file) {
    310309        $file = ltrim($file, '/');
    311         return filesize('ssh2.sftp://' . $this->sftp_link . '/' . $file);
     310        return filesize('ssh2.sftp://' . $this->sftp_link .'/' . $file);
    312311    }
    313312
  • branches/2.8/wp-admin/includes/dashboard.php

    r11698 r11553  
    606606
    607607function wp_dashboard_incoming_links() {
    608     echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
     608    wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' );
    609609}
    610610
     
    635635    echo "<ul>\n";
    636636
    637     if ( !isset($items) )
    638         $items = 10;
    639 
    640     foreach ( $rss->get_items(0, $items) as $item ) {
     637    $count = 0;
     638    foreach ( $rss->get_items() as $item ) {
    641639        $publisher = '';
    642640        $site_link = '';
     
    647645
    648646        $author = $item->get_author();
    649         if ( $author ) {
    650             $site_link = esc_url( strip_tags( $author->get_link() ) );
    651 
    652             if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) )
    653                 $publisher = __( 'Somebody' );
    654         } else {
    655           $publisher = __( 'Somebody' );
    656         }
     647        $site_link = esc_url( strip_tags( $author->get_link() ) );
     648
     649        if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) )
     650            $publisher = __( 'Somebody' );
    657651        if ( $site_link )
    658652            $publisher = "<a href='$site_link'>$publisher</a>";
     
    691685
    692686function wp_dashboard_primary() {
    693     echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
     687    wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );
    694688}
    695689
     
    713707
    714708function wp_dashboard_secondary() {
    715     echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
     709    wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );
    716710}
    717711
     
    748742
    749743function wp_dashboard_plugins() {
    750     echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
     744    wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
     745        'http://wordpress.org/extend/plugins/rss/browse/popular/',
     746        'http://wordpress.org/extend/plugins/rss/browse/new/',
     747        'http://wordpress.org/extend/plugins/rss/browse/updated/'
     748    ) );
    751749}
    752750
  • branches/2.8/wp-admin/includes/file.php

    r11698 r11553  
    446446        return new WP_Error('http_no_file', __('Could not create Temporary file'));
    447447
    448     $response = wp_remote_get($url, array('timeout' => 60));
     448    $response = wp_remote_get($url, array('timeout' => 30));
    449449
    450450    if ( is_wp_error($response) ) {
     
    646646    }
    647647
    648     if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && function_exists('stream_get_contents') ) $method = 'ssh2';
     648    if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && extension_loaded('sockets') ) $method = 'ssh2';
    649649    if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
    650650    if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
     
    762762</tr>
    763763
    764 <?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents') ) : ?>
     764<?php if ( extension_loaded('ssh2') ) : ?>
    765765<tr id="ssh_keys" valign="top" style="<?php if ( 'ssh' != $connection_type ) echo 'display:none' ?>">
    766766<th scope="row"><?php _e('Authentication Keys') ?>
     
    782782<br /><label><input id="ftps" name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"';  ?>/> <?php _e('FTPS (SSL)') ?></label>
    783783<?php endif; ?>
    784 <?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents') ) : ?>
     784<?php if ( extension_loaded('ssh2') ) : ?>
    785785<br /><label><input id="ssh" name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type);  if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('SSH') ?></label>
    786786<?php endif; ?>
  • branches/2.8/wp-admin/includes/manifest.php

    r11698 r11553  
    9393    if ( @is_file('../wp-includes/js/tinymce/tiny_mce.js') ) :
    9494    $mce = array(
    95         array('../wp-includes/js/tinymce/wp-tinymce.php', $mce_ver, true),
     95        array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=1&' . $mce_ver, true),
     96        array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=0&' . $mce_ver, true),
    9697
    9798        array('../wp-includes/js/tinymce/tiny_mce.js', $mce_ver, true),
  • branches/2.8/wp-admin/includes/media.php

    r11698 r11553  
    370370}
    371371add_action( 'media_buttons', 'media_buttons' );
     372add_action('media_upload_media', 'media_upload_handler');
    372373
    373374/**
     
    381382    check_admin_referer('media-form');
    382383
    383     $errors = null;
     384    $errors = array();
    384385
    385386    if ( isset($_POST['send']) ) {
     
    13121313    var settings = {
    13131314            button_text: '<span class="button"><?php _e('Select Files'); ?></span>',
    1314             button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; }',
     1315            button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; }',
    13151316            button_height: "24",
    13161317            button_width: "132",
    1317             button_text_top_padding: 2,
     1318            button_text_top_padding: 1,
    13181319            button_image_url: '<?php echo includes_url('images/upload.png'); ?>',
    13191320            button_placeholder_id: "flash-browse-button",
  • branches/2.8/wp-admin/includes/misc.php

    r11698 r11553  
    7373        }
    7474
    75         if ( !$f = @fopen( $filename, 'w' ) )
    76             return false;
    77 
     75        $f = fopen( $filename, 'w' );
    7876        $foundit = false;
    7977        if ( $markerdata ) {
     
    273271        return array();
    274272
    275     if ( !function_exists('token_get_all') )
    276         return array();
    277 
    278273    $tokens = token_get_all( $content );
    279274    $functions = array();
  • branches/2.8/wp-admin/includes/plugin-install.php

    r11698 r11553  
    4747                $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']);
    4848        }
    49     } elseif ( !is_wp_error($res) ) {
    50         $res->external = true;
    5149    }
    5250
     
    444442            $type = 'install';
    445443            //Check to see if this plugin is known to be installed, and has an update awaiting it.
    446             $update_plugins = get_transient('update_plugins');
     444            $update_plugins = get_option('update_plugins');
    447445            if ( is_object( $update_plugins ) ) {
    448446                foreach ( (array)$update_plugins->response as $file => $plugin ) {
     
    465463                    } else {
    466464                        //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh
    467                         delete_transient('update_plugins');
     465                        delete_option('update_plugins');
    468466                        $update_file = $api->slug . '/' . $key; //This code branch only deals with a plugin which is in a folder the same name as its slug, Doesnt support plugins which have 'non-standard' names
    469467                        $type = 'update_available';
     
    512510<?php endif; if ( ! empty($api->downloaded) ) : ?>
    513511            <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
    514 <?php endif; if ( ! empty($api->slug) && empty($api->external) ) : ?>
     512<?php endif; if ( ! empty($api->slug) ) : ?>
    515513            <li><a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page &#187;') ?></a></li>
    516514<?php endif; if ( ! empty($api->homepage) ) : ?>
     
    518516<?php endif; ?>
    519517        </ul>
    520         <?php if ( ! empty($api->rating) ) : ?>
    521518        <h2><?php _e('Average Rating') ?></h2>
    522519        <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
     
    529526        </div>
    530527        <small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small>
    531         <?php endif; ?>
    532528    </div>
    533529    <div id="section-holder" class="wrap">
  • branches/2.8/wp-admin/includes/plugin.php

    r11698 r11553  
    586586
    587587function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
    588     global $menu, $admin_page_hooks, $_registered_pages;
     588    global $menu, $admin_page_hooks;
    589589
    590590    $file = plugin_basename( $file );
     
    603603    $menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    604604
    605     $_registered_pages[$hookname] = true;
    606 
    607605    return $hookname;
    608606}
    609607
    610608function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
    611     global $menu, $admin_page_hooks, $_wp_last_object_menu, $_registered_pages;
     609    global $menu, $admin_page_hooks, $_wp_last_object_menu;
    612610
    613611    $file = plugin_basename( $file );
     
    626624    $menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    627625
    628     $_registered_pages[$hookname] = true;
    629 
    630626    return $hookname;
    631627}
    632628
    633629function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
    634     global $menu, $admin_page_hooks, $_wp_last_utility_menu, $_registered_pages;
     630    global $menu, $admin_page_hooks, $_wp_last_utility_menu;
    635631
    636632    $file = plugin_basename( $file );
     
    650646
    651647    $menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    652 
    653     $_registered_pages[$hookname] = true;
    654648
    655649    return $hookname;
     
    661655    global $_wp_real_parent_file;
    662656    global $_wp_submenu_nopriv;
    663     global $_registered_pages;
    664657
    665658    $file = plugin_basename( $file );
     
    690683    if (!empty ( $function ) && !empty ( $hookname ))
    691684        add_action( $hookname, $function );
    692 
    693     $_registered_pages[$hookname] = true;
    694     // backwards-compatibility for plugins using add_management page.  See wp-admin/admin.php for redirect from edit.php to tools.php
    695     if ( 'tools.php' == $parent )
    696         $_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true;
    697685
    698686    return $hookname;
     
    932920    global $_wp_submenu_nopriv;
    933921    global $plugin_page;
    934     global $_registered_pages;
    935922
    936923    $parent = get_admin_page_parent();
     
    939926        return false;
    940927
    941     if ( isset( $plugin_page ) ) {
    942         if ( isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
    943             return false;
    944 
    945         $hookname = get_plugin_page_hookname($plugin_page, $parent);
    946         if ( !isset($_registered_pages[$hookname]) )
    947             return false;
    948     }
     928    if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
     929        return false;
    949930
    950931    if ( empty( $parent) ) {
     
    955936        if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) )
    956937            return false;
    957         if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
    958             return false;
    959938        foreach (array_keys( $_wp_submenu_nopriv ) as $key ) {
    960939            if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) )
     
    965944        return true;
    966945    }
    967 
    968     if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
    969         return false;
    970946
    971947    if ( isset( $submenu[$parent] ) ) {
  • branches/2.8/wp-admin/includes/template.php

    r11698 r11553  
    14481448                $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
    14491449                $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick&nbsp;Edit') . '</a>';
    1450             }
    1451             if ( current_user_can('delete_post', $post->ID) ) {
    14521450                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    14531451            }
     
    16631661            $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
    16641662            $actions['inline'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
    1665         }
    1666         if ( current_user_can('delete_page', $page->ID) ) {
    16671663            $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
    16681664        }
     
    34763472            }
    34773473            break;
     3474        case 'theme-editor':
     3475        case 'plugin-editor':
     3476            $settings = '<p><a id="codepress-on" href="' . $screen . '.php?codepress=on">' . __('Enable syntax highlighting') . '</a><a id="codepress-off" href="' . $screen . '.php?codepress=off">' . __('Disable syntax highlighting') . "</a></p>\n";
     3477            $show_screen = true;
     3478            break;
    34783479        case 'widgets':
    34793480            if ( !isset($_wp_contextual_help['widgets']) ) {
  • branches/2.8/wp-admin/includes/update-core.php

    r11698 r11553  
    230230    if ( is_wp_error($result) ) {
    231231        $wp_filesystem->delete($maintenance_file);
    232         $wp_filesystem->delete($from, true);
     232        $wp_filesystem->delete($working_dir, true);
    233233        return $result;
    234234    }
  • branches/2.8/wp-admin/includes/user.php

    r11698 r11553  
    254254            return array($user->id);
    255255        else
    256             return array();
     256            return false;
    257257    }
    258258
  • branches/2.8/wp-admin/includes/widgets.php

    r11698 r11553  
    9898function next_widget_id_number($id_base) {
    9999    global $wp_registered_widgets;
    100     $number = 1;
    101 
    102     foreach ( $wp_registered_widgets as $widget_id => $widget ) {
    103         if ( preg_match( '/' . $id_base . '-([0-9]+)$/', $widget_id, $matches ) )
    104             $number = max($number, $matches[1]);
    105     }
    106     $number++;
     100    $number = 2;
     101
     102    while ( isset($wp_registered_widgets["$id_base-$number"]) )
     103        $number++;
    107104
    108105    return $number;
  • branches/2.8/wp-admin/js/dashboard.dev.js

    r11698 r11553  
    1 var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
    21
    32jQuery(document).ready( function($) {
     3    var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
    44    // These widgets are sometimes populated via ajax
    55    ajaxWidgets = [
     
    1010    ];
    1111
    12     ajaxPopulateWidgets = function(el) {
    13         show = function(id, i) {
    14             var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
    15             if ( e.length ) {
    16                 p = e.parent();
    17                 setTimeout( function(){
    18                     p.load('index-extra.php?jax=' + id, '', function() {
    19                         p.hide().slideDown('normal', function(){
    20                             $(this).css('display', '');
    21                             if ( 'dashboard_plugins' == id && $.isFunction(tb_init) )
    22                                 tb_init('#dashboard_plugins a.thickbox');
    23                         });
    24                     });
    25                 }, i * 500 );
    26             }
    27         }
    28         if ( el ) {
    29             el = el.toString();
    30             if ( $.inArray(el, ajaxWidgets) != -1 )
    31                 show(el, 0);
    32         } else {
    33             $.each( ajaxWidgets, function(i) {
    34                 show(this, i);
    35             });
    36         }
     12    ajaxPopulateWidgets = function() {
     13        $.each( ajaxWidgets, function() {
     14            var e = jQuery('#' + this + ':visible div.inside').find('.widget-loading');
     15            if ( e.size() ) { e.parent().load('index-extra.php?jax=' + this); }
     16        } );
    3717    };
    3818    ajaxPopulateWidgets();
    3919
    40     postboxes.add_postbox_toggles('dashboard', { pbshow: ajaxPopulateWidgets } );
     20    postboxes.add_postbox_toggles('dashboard', { onShow: ajaxPopulateWidgets } );
    4121
    4222    /* QuickPress */
  • branches/2.8/wp-admin/js/dashboard.js

    r11698 r11553  
    1 var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load("index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles("dashboard",{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press h3").append('<img src="images/wpspin_light.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press h3 img").remove();a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()});
     1jQuery(document).ready(function(c){var a,b,d;a=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];b=function(){c.each(a,function(){var f=jQuery("#"+this+":visible div.inside").find(".widget-loading");if(f.size()){f.parent().load("index-extra.php?jax="+this)}})};b();postboxes.add_postbox_toggles("dashboard",{onShow:b});d=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press h3").append('<img src="images/wpspin_light.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press h3 img").remove();c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");d()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};d()});
  • branches/2.8/wp-admin/js/edit-comments.dev.js

    r11698 r11553  
    2424            n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
    2525            if ( n < 0 ) { n = 0; }
    26             a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
     26            $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
    2727            n = n.toString();
    2828            if ( n.length > 3 )
     
    7878            }
    7979            if ( n < 0 ) { n = 0; }
    80             a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
     80            $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
    8181            n = n.toString();
    8282            if ( n.length > 3 )
  • branches/2.8/wp-admin/js/edit-comments.js

    r11698 r11553  
    1 var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('#comments-form .tablenav :input[name="_total"]');i=a('#comments-form .tablenav :input[name="_per_page"]');h=a('#comments-form .tablenav :input[name="_page"]');c=function(k,j){var l=a("#"+j.element);if(l.is(".unapproved")){l.find("div.comment_status").html("0")}else{l.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}o=o+(a("#"+j.element).is("."+j.dimClass)?1:-1);if(o<0){o=0}m.parents("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};e=function(j){j.data._total=g.val();j.data._per_page=i.val();j.data._page=h.val();j.data._url=document.location.href;if("undefined"!=showNotice&&j.data.action&&j.data.action=="delete-comment"&&!j.data.spam){return showNotice.warn()?j:false}return j};d=function(j,k,l){if(k<f){return}g.val(j.toString());if(l){f=k}a("span.total-type-count").each(function(){var m=a(this),o;o=g.val().toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};b=function(l,j){a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a("#"+j.element).is(".unapproved")){o=o-1}else{if(a(j.target).parents("span.unapprove").size()){o=o+1}}if(o<0){o=0}m.parents("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});a("span.spam-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents("span.spam").size()){o=o+1}else{if(a("#"+j.element).is(".spam")){o=o-1}}if(o<0){o=0}o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});if(("object"==typeof l)&&f<j.parsed.responses[0].supplemental.time){d(j.parsed.responses[0].supplemental.total,j.parsed.responses[0].supplemental.time,true);if(a.trim(j.parsed.responses[0].supplemental.pageLinks)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks))}else{if("undefined"!=typeof j.parsed.responses[0].supplemental.pageLinks){a(".tablenav-pages").find(".page-numbers").remove()}}}else{var k=parseInt(g.val(),10);if(k--<0){k=0}d(k,l,false)}if(theExtraList.size()==0||theExtraList.children().size()==0){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:e,dimAfter:c,delAfter:b,addColor:"none"})};commentReply={init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn("fast").css("backgroundColor","");a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("#edithead input").val("");a("#replysubmit .error").html("").hide();a("#replysubmit .waiting").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o="#comment-"+i;a("#replyrow td").attr("colspan",a(".widefat thead th:visible").length);d=a("#replyrow"),rowData=a("#inline-"+i);b=e.act=(c=="edit")?"edit-comment":"replyto-comment";a("#action",d).val(b);a("#comment_post_ID",d).val(g);a("#comment_ID",d).val(i);if(c=="edit"){a("#author",d).val(a("div.author",rowData).text());a("#author-email",d).val(a("div.author-email",rowData).text());a("#author-url",d).val(a("div.author-url",rowData).text());a("#status",d).val(a("div.comment_status",rowData).text());a("#replycontent",d).val(a("textarea.comment",rowData).val());a("#edithead, #savebtn",d).show();a("#replyhead, #replybtn",d).hide();f=a(e.o).height();if(f>220){if(a.browser.msie){a("#replycontainer, #replycontent",d).height(f-105)}else{a("#replycontainer",d).height(f-105)}}a(e.o).after(d.hide()).fadeOut("fast",function(){a("#replyrow").fadeIn("fast")})}else{a("#edithead, #savebtn",d).hide();a("#replyhead, #replybtn",d).show();a(e.o).after(d);a("#replyrow").hide().fadeIn("fast")}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var l,j,m,h,k;l=a("#replyrow").offset().top;j=l+a("#replyrow").height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20<j){window.scroll(0,j-h+35)}else{if(l-20<m){window.scroll(0,l-35)}}a("#replycontent").focus().keyup(function(n){if(n.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:wpListL10n.url,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}if("edit-comment"==this.act){a(this.o).remove()}e=e.responses[0];g=e.data;a(g).hide();a("#replyrow").after(g);this.o=f="#comment-"+e.id;this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("#comments-form thead #cb input:checkbox").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(h,g){a("option[value="+f+"]").attr("selected","selected");a("form#comments-form")[0].submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q",["e",b],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+x",c],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
     1var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('#comments-form .tablenav :input[name="_total"]');i=a('#comments-form .tablenav :input[name="_per_page"]');h=a('#comments-form .tablenav :input[name="_page"]');c=function(k,j){var l=a("#"+j.element);if(l.is(".unapproved")){l.find("div.comment_status").html("0")}else{l.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}o=o+(a("#"+j.element).is("."+j.dimClass)?1:-1);if(o<0){o=0}a("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};e=function(j){j.data._total=g.val();j.data._per_page=i.val();j.data._page=h.val();j.data._url=document.location.href;if("undefined"!=showNotice&&j.data.action&&j.data.action=="delete-comment"&&!j.data.spam){return showNotice.warn()?j:false}return j};d=function(j,k,l){if(k<f){return}g.val(j.toString());if(l){f=k}a("span.total-type-count").each(function(){var m=a(this),o;o=g.val().toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};b=function(l,j){a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a("#"+j.element).is(".unapproved")){o=o-1}else{if(a(j.target).parents("span.unapprove").size()){o=o+1}}if(o<0){o=0}a("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});a("span.spam-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents("span.spam").size()){o=o+1}else{if(a("#"+j.element).is(".spam")){o=o-1}}if(o<0){o=0}o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});if(("object"==typeof l)&&f<j.parsed.responses[0].supplemental.time){d(j.parsed.responses[0].supplemental.total,j.parsed.responses[0].supplemental.time,true);if(a.trim(j.parsed.responses[0].supplemental.pageLinks)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks))}else{if("undefined"!=typeof j.parsed.responses[0].supplemental.pageLinks){a(".tablenav-pages").find(".page-numbers").remove()}}}else{var k=parseInt(g.val(),10);if(k--<0){k=0}d(k,l,false)}if(theExtraList.size()==0||theExtraList.children().size()==0){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:e,dimAfter:c,delAfter:b,addColor:"none"})};commentReply={init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn("fast").css("backgroundColor","");a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("#edithead input").val("");a("#replysubmit .error").html("").hide();a("#replysubmit .waiting").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o="#comment-"+i;a("#replyrow td").attr("colspan",a(".widefat thead th:visible").length);d=a("#replyrow"),rowData=a("#inline-"+i);b=e.act=(c=="edit")?"edit-comment":"replyto-comment";a("#action",d).val(b);a("#comment_post_ID",d).val(g);a("#comment_ID",d).val(i);if(c=="edit"){a("#author",d).val(a("div.author",rowData).text());a("#author-email",d).val(a("div.author-email",rowData).text());a("#author-url",d).val(a("div.author-url",rowData).text());a("#status",d).val(a("div.comment_status",rowData).text());a("#replycontent",d).val(a("textarea.comment",rowData).val());a("#edithead, #savebtn",d).show();a("#replyhead, #replybtn",d).hide();f=a(e.o).height();if(f>220){if(a.browser.msie){a("#replycontainer, #replycontent",d).height(f-105)}else{a("#replycontainer",d).height(f-105)}}a(e.o).after(d.hide()).fadeOut("fast",function(){a("#replyrow").fadeIn("fast")})}else{a("#edithead, #savebtn",d).hide();a("#replyhead, #replybtn",d).show();a(e.o).after(d);a("#replyrow").hide().fadeIn("fast")}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var l,j,m,h,k;l=a("#replyrow").offset().top;j=l+a("#replyrow").height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20<j){window.scroll(0,j-h+35)}else{if(l-20<m){window.scroll(0,l-35)}}a("#replycontent").focus().keyup(function(n){if(n.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:wpListL10n.url,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}if("edit-comment"==this.act){a(this.o).remove()}e=e.responses[0];g=e.data;a(g).hide();a("#replyrow").after(g);this.o=f="#comment-"+e.id;this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("#comments-form thead #cb input:checkbox").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(h,g){a("option[value="+f+"]").attr("selected","selected");a("form#comments-form")[0].submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q",["e",b],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+x",c],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
  • branches/2.8/wp-admin/js/post.dev.js

    r11698 r11553  
    213213    var noSyncChecks = false, syncChecks, catAddAfter, stamp = $('#timestamp').html(), visibility = $('#post-visibility-display').html(), sticky = '';
    214214
     215    // for Press This
     216    if ( typeof autosave != 'function' )
     217        autosave = function(){};
     218
    215219    // postboxes
    216220    postboxes.add_postbox_toggles('post');
     
    222226    tag_init();
    223227
    224     $('#title').blur( function() {
    225         if ( ($("#post_ID").val() > 0) || ($("#title").val().length == 0) )
    226             return;
    227 
    228         if ( typeof(autosave) != 'undefined' )
    229             autosave();
    230     });
     228    $('#title').blur( function() { if ( ($("#post_ID").val() > 0) || ($("#title").val().length == 0) ) return; autosave(); } );
    231229
    232230    // auto-suggest stuff
     
    480478    $('#the-list').wpList( { addAfter: function( xml, s ) {
    481479        $('table#list-table').show();
    482         if ( typeof( autosave_update_post_ID ) != 'undefined' ) {
     480        if ( $.isFunction( autosave_update_post_ID ) ) {
    483481            autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
    484482        }
  • branches/2.8/wp-admin/js/post.js

    r11698 r11553  
    1 function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}function new_tag_remove_tag(){var e=jQuery(this).attr("id"),a=e.split("-check-num-")[1],c=jQuery(this).parents(".tagsdiv"),b=c.find(".the-tags").val().split(","),d=[];delete b[a];jQuery.each(b,function(f,g){g=jQuery.trim(g);if(g){d.push(g)}});c.find(".the-tags").val(d.join(",").replace(/\s*,+\s*/,",").replace(/,+/,",").replace(/,+\s+,+/,",").replace(/,+\s*$/,"").replace(/^\s*,+/,""));tag_update_quickclicks(c);return false}function tag_update_quickclicks(b){if(jQuery(b).find(".the-tags").length==0){return}var a=jQuery(b).find(".the-tags").val().split(",");jQuery(b).find(".tagchecklist").empty();shown=false;jQuery.each(a,function(e,f){var c,d;f=jQuery.trim(f);if(!f.match(/^\s+$/)&&""!=f){d=jQuery(b).attr("id")+"-check-num-"+e;c='<span><a id="'+d+'" class="ntdelbutton">X</a>&nbsp;'+f+"</span> ";jQuery(b).find(".tagchecklist").append(c);jQuery("#"+d).click(new_tag_remove_tag)}});if(shown){jQuery(b).find(".tagchecklist").prepend("<strong>"+postL10n.tagsUsed+"</strong><br />")}}function tag_flush_to_text(g,b){b=b||false;var e,f,c,d;e=jQuery("#"+g);f=b?jQuery(b).text():e.find("input.newtag").val();if(e.find("input.newtag").hasClass("form-input-tip")&&!b){return false}c=e.find(".the-tags").val();d=c?c+","+f:f;d=d.replace(/\s+,+\s*/g,",").replace(/,+/g,",").replace(/,+\s+,+/g,",").replace(/,+\s*$/g,"").replace(/^\s*,+/g,"");d=array_unique_noempty(d.split(",")).join(",");e.find(".the-tags").val(d);tag_update_quickclicks(e);if(!b){e.find("input.newtag").val("").focus()}return false}function tag_save_on_publish(){jQuery(".tagsdiv").each(function(a){if(!jQuery(this).find("input.newtag").hasClass("form-input-tip")){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))}})}function tag_press_key(a){if(13==a.which){tag_flush_to_text(jQuery(a.target).parents(".tagsdiv").attr("id"));return false}}function tag_init(){jQuery(".ajaxtag").show();jQuery(".tagsdiv").each(function(a){tag_update_quickclicks(this)});jQuery(".ajaxtag input.tagadd").click(function(){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))});jQuery(".ajaxtag input.newtag").focus(function(){if(!this.cleared){this.cleared=true;jQuery(this).val("").removeClass("form-input-tip")}});jQuery(".ajaxtag input.newtag").blur(function(){if(this.value==""){this.cleared=false;jQuery(this).val(postL10n.addTag).addClass("form-input-tip")}});jQuery("#publish").click(tag_save_on_publish);jQuery("#save-post").click(tag_save_on_publish);jQuery(".ajaxtag input.newtag").keypress(tag_press_key)}var commentsBox,tagCloud;(function(a){commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="5">'+wpAjax.broken+"</td></tr>")});return false}};tagCloud={init:function(){a(".tagcloud-link").click(function(){tagCloud.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){var f=a(this).parents("p").attr("id");tag_flush_to_text(f.substr(f.indexOf("-")+1),this);return false});a("#"+c).after(e)})}};a(document).ready(function(){tagCloud.init()})})(jQuery);jQuery(document).ready(function(g){var d=false,i,e,a=g("#timestamp").html(),b=g("#post-visibility-display").html(),h="";postboxes.add_postbox_toggles("post");make_slugedit_clickable();tag_init();g("#title").blur(function(){if((g("#post_ID").val()>0)||(g("#title").val().length==0)){return}if(typeof(autosave)!="undefined"){autosave()}});g(".newtag").each(function(){var j=g(this).parents("div.tagsdiv").attr("id");g(this).suggest("admin-ajax.php?action=ajax-tag-search&tax="+j,{delay:500,minchars:2,multiple:true,multipleSep:", "})});g("#category-tabs a").click(function(){var j=g(this).attr("href");g(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g(".tabs-panel").hide();g(j).show();if("#categories-all"==j){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){g('#category-tabs a[href="#categories-pop"]').click()}g("#newcat").one("focus",function(){g(this).val("").removeClass("form-input-tip")});g("#category-add-sumbit").click(function(){g("#newcat").focus()});i=function(){if(d){return}d=true;var j=jQuery(this),l=j.is(":checked"),k=j.val().toString();g("#in-category-"+k+", #in-popular-category-"+k).attr("checked",l);d=false};popularCats=g("#categorychecklist-pop :checkbox").map(function(){return parseInt(jQuery(this).val(),10)}).get().join(",");catAddBefore=function(j){if(!g("#newcat").val()){return false}j.data+="&popular_ids="+popularCats+"&"+jQuery("#categorychecklist :checked").serialize();return j};e=function(m,k){var j=jQuery("#newcat_parent"),l=j.find('option[value="-1"]');g(k.what+" response_data",m).each(function(){var n=g(g(this).text());n.find("label").each(function(){var q=g(this),s=q.find("input").val(),t=q.find("input")[0].id,p,r;g("#"+t).change(i).change();if(j.find('option[value="'+s+'"]').size()){return}p=g.trim(q.text());r=g('<option value="'+parseInt(s,10)+'"></option>').text(p);j.prepend(r)});l.attr("selected","selected")})};g("#categorychecklist").wpList({alt:"",response:"category-ajax-response",addBefore:catAddBefore,addAfter:e});g("#category-add-toggle").click(function(){g("#category-adder").toggleClass("wp-hidden-children");g('#category-tabs a[href="#categories-all"]').click();return false});g(".categorychecklist .popular-category :checkbox").change(i).filter(":checked").change(),h="";function f(){if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false);g("#sticky-span").hide()}else{g("#sticky-span").show()}if(g("#post-visibility-select input:radio:checked").val()!="password"){g("#password-span").hide()}else{g("#password-span").show()}}function c(){var j,l,k,m;j=new Date(g("#aa").val(),g("#mm").val()-1,g("#jj").val(),g("#hh").val(),g("#mn").val());l=new Date(g("#hidden_aa").val(),g("#hidden_mm").val()-1,g("#hidden_jj").val(),g("#hidden_hh").val(),g("#hidden_mn").val());k=new Date(g("#cur_aa").val(),g("#cur_mm").val()-1,g("#cur_jj").val(),g("#cur_hh").val(),g("#cur_mn").val());if(j>k&&g("#original_post_status").val()!="future"){m=postL10n.publishOnFuture;g("#publish").val(postL10n.schedule)}else{if(j<=k&&g("#original_post_status").val()!="publish"){m=postL10n.publishOn;g("#publish").val(postL10n.publish)}else{m=postL10n.publishOnPast;g("#publish").val(postL10n.update)}}if(l.toUTCString()==j.toUTCString()){g("#timestamp").html(a)}else{g("#timestamp").html(m+" <b>"+g("#mm option[value="+g("#mm").val()+"]").text()+" "+g("#jj").val()+", "+g("#aa").val()+" @ "+g("#hh").val()+":"+g("#mn").val()+"</b> ")}if(g("#post-visibility-select input:radio:checked").val()=="private"){g("#publish").val(postL10n.update);if(g("#post_status option[value=publish]").length==0){g("#post_status").append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}g("#post_status option[value=publish]").html(postL10n.privatelyPublished);g("#post_status option[value=publish]").attr("selected",true);g(".edit-post-status").hide()}else{if(g("#original_post_status").val()=="future"||g("#original_post_status").val()=="draft"){if(g("#post_status option[value=publish]").length!=0){g("#post_status option[value=publish]").remove();g("#post_status").val(g("#hidden_post_status").val())}}else{g("#post_status option[value=publish]").html(postL10n.published)}g(".edit-post-status").show()}g("#post-status-display").html(g("#post_status :selected").text());if(g("#post_status :selected").val()=="private"||g("#post_status :selected").val()=="publish"){g("#save-post").hide()}else{g("#save-post").show();if(g("#post_status :selected").val()=="pending"){g("#save-post").show().val(postL10n.savePending)}else{g("#save-post").show().val(postL10n.saveDraft)}}}g(".edit-visibility").click(function(){if(g("#post-visibility-select").is(":hidden")){f();g("#post-visibility-select").slideDown("normal");g(".edit-visibility").hide()}return false});g(".cancel-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g("#visibility-radio-"+g("#hidden-post-visibility").val()).attr("checked",true);g("#post_password").val(g("#hidden_post_password").val());g("#sticky").attr("checked",g("#hidden-post-sticky").attr("checked"));g("#post-visibility-display").html(b);g(".edit-visibility").show();c();return false});g(".save-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g(".edit-visibility").show();c();if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false)}if(true==g("#sticky").attr("checked")){h="Sticky"}else{h=""}g("#post-visibility-display").html(postL10n[g("#post-visibility-select input:radio:checked").val()+h]);return false});g("#post-visibility-select input:radio").change(function(){f()});g(".edit-timestamp").click(function(){if(g("#timestampdiv").is(":hidden")){g("#timestampdiv").slideDown("normal");g(".edit-timestamp").hide()}return false});g(".cancel-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g("#mm").val(g("#hidden_mm").val());g("#jj").val(g("#hidden_jj").val());g("#aa").val(g("#hidden_aa").val());g("#hh").val(g("#hidden_hh").val());g("#mn").val(g("#hidden_mn").val());g(".edit-timestamp").show();c();return false});g(".save-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g(".edit-timestamp").show();c();return false});g(".edit-post-status").click(function(){if(g("#post-status-select").is(":hidden")){g("#post-status-select").slideDown("normal");g(this).hide()}return false});g(".save-post-status").click(function(){g("#post-status-select").slideUp("normal");g(".edit-post-status").show();c();return false});g(".cancel-post-status").click(function(){g("#post-status-select").slideUp("normal");g("#post_status").val(g("#hidden_post_status").val());g(".edit-post-status").show();c();return false});g("#the-list").wpList({addAfter:function(j,k){g("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+="&post_id="+g("#post_ID").val();return j}})});
     1function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}function new_tag_remove_tag(){var e=jQuery(this).attr("id"),a=e.split("-check-num-")[1],c=jQuery(this).parents(".tagsdiv"),b=c.find(".the-tags").val().split(","),d=[];delete b[a];jQuery.each(b,function(f,g){g=jQuery.trim(g);if(g){d.push(g)}});c.find(".the-tags").val(d.join(",").replace(/\s*,+\s*/,",").replace(/,+/,",").replace(/,+\s+,+/,",").replace(/,+\s*$/,"").replace(/^\s*,+/,""));tag_update_quickclicks(c);return false}function tag_update_quickclicks(b){if(jQuery(b).find(".the-tags").length==0){return}var a=jQuery(b).find(".the-tags").val().split(",");jQuery(b).find(".tagchecklist").empty();shown=false;jQuery.each(a,function(e,f){var c,d;f=jQuery.trim(f);if(!f.match(/^\s+$/)&&""!=f){d=jQuery(b).attr("id")+"-check-num-"+e;c='<span><a id="'+d+'" class="ntdelbutton">X</a>&nbsp;'+f+"</span> ";jQuery(b).find(".tagchecklist").append(c);jQuery("#"+d).click(new_tag_remove_tag)}});if(shown){jQuery(b).find(".tagchecklist").prepend("<strong>"+postL10n.tagsUsed+"</strong><br />")}}function tag_flush_to_text(g,b){b=b||false;var e,f,c,d;e=jQuery("#"+g);f=b?jQuery(b).text():e.find("input.newtag").val();if(e.find("input.newtag").hasClass("form-input-tip")&&!b){return false}c=e.find(".the-tags").val();d=c?c+","+f:f;d=d.replace(/\s+,+\s*/g,",").replace(/,+/g,",").replace(/,+\s+,+/g,",").replace(/,+\s*$/g,"").replace(/^\s*,+/g,"");d=array_unique_noempty(d.split(",")).join(",");e.find(".the-tags").val(d);tag_update_quickclicks(e);if(!b){e.find("input.newtag").val("").focus()}return false}function tag_save_on_publish(){jQuery(".tagsdiv").each(function(a){if(!jQuery(this).find("input.newtag").hasClass("form-input-tip")){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))}})}function tag_press_key(a){if(13==a.which){tag_flush_to_text(jQuery(a.target).parents(".tagsdiv").attr("id"));return false}}function tag_init(){jQuery(".ajaxtag").show();jQuery(".tagsdiv").each(function(a){tag_update_quickclicks(this)});jQuery(".ajaxtag input.tagadd").click(function(){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))});jQuery(".ajaxtag input.newtag").focus(function(){if(!this.cleared){this.cleared=true;jQuery(this).val("").removeClass("form-input-tip")}});jQuery(".ajaxtag input.newtag").blur(function(){if(this.value==""){this.cleared=false;jQuery(this).val(postL10n.addTag).addClass("form-input-tip")}});jQuery("#publish").click(tag_save_on_publish);jQuery("#save-post").click(tag_save_on_publish);jQuery(".ajaxtag input.newtag").keypress(tag_press_key)}var commentsBox,tagCloud;(function(a){commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="5">'+wpAjax.broken+"</td></tr>")});return false}};tagCloud={init:function(){a(".tagcloud-link").click(function(){tagCloud.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){var f=a(this).parents("p").attr("id");tag_flush_to_text(f.substr(f.indexOf("-")+1),this);return false});a("#"+c).after(e)})}};a(document).ready(function(){tagCloud.init()})})(jQuery);jQuery(document).ready(function(g){var d=false,i,e,a=g("#timestamp").html(),b=g("#post-visibility-display").html(),h="";if(typeof autosave!="function"){autosave=function(){}}postboxes.add_postbox_toggles("post");make_slugedit_clickable();tag_init();g("#title").blur(function(){if((g("#post_ID").val()>0)||(g("#title").val().length==0)){return}autosave()});g(".newtag").each(function(){var j=g(this).parents("div.tagsdiv").attr("id");g(this).suggest("admin-ajax.php?action=ajax-tag-search&tax="+j,{delay:500,minchars:2,multiple:true,multipleSep:", "})});g("#category-tabs a").click(function(){var j=g(this).attr("href");g(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g(".tabs-panel").hide();g(j).show();if("#categories-all"==j){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){g('#category-tabs a[href="#categories-pop"]').click()}g("#newcat").one("focus",function(){g(this).val("").removeClass("form-input-tip")});g("#category-add-sumbit").click(function(){g("#newcat").focus()});i=function(){if(d){return}d=true;var j=jQuery(this),l=j.is(":checked"),k=j.val().toString();g("#in-category-"+k+", #in-popular-category-"+k).attr("checked",l);d=false};popularCats=g("#categorychecklist-pop :checkbox").map(function(){return parseInt(jQuery(this).val(),10)}).get().join(",");catAddBefore=function(j){if(!g("#newcat").val()){return false}j.data+="&popular_ids="+popularCats+"&"+jQuery("#categorychecklist :checked").serialize();return j};e=function(m,k){var j=jQuery("#newcat_parent"),l=j.find('option[value="-1"]');g(k.what+" response_data",m).each(function(){var n=g(g(this).text());n.find("label").each(function(){var q=g(this),s=q.find("input").val(),t=q.find("input")[0].id,p,r;g("#"+t).change(i).change();if(j.find('option[value="'+s+'"]').size()){return}p=g.trim(q.text());r=g('<option value="'+parseInt(s,10)+'"></option>').text(p);j.prepend(r)});l.attr("selected","selected")})};g("#categorychecklist").wpList({alt:"",response:"category-ajax-response",addBefore:catAddBefore,addAfter:e});g("#category-add-toggle").click(function(){g("#category-adder").toggleClass("wp-hidden-children");g('#category-tabs a[href="#categories-all"]').click();return false});g(".categorychecklist .popular-category :checkbox").change(i).filter(":checked").change(),h="";function f(){if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false);g("#sticky-span").hide()}else{g("#sticky-span").show()}if(g("#post-visibility-select input:radio:checked").val()!="password"){g("#password-span").hide()}else{g("#password-span").show()}}function c(){var j,l,k,m;j=new Date(g("#aa").val(),g("#mm").val()-1,g("#jj").val(),g("#hh").val(),g("#mn").val());l=new Date(g("#hidden_aa").val(),g("#hidden_mm").val()-1,g("#hidden_jj").val(),g("#hidden_hh").val(),g("#hidden_mn").val());k=new Date(g("#cur_aa").val(),g("#cur_mm").val()-1,g("#cur_jj").val(),g("#cur_hh").val(),g("#cur_mn").val());if(j>k&&g("#original_post_status").val()!="future"){m=postL10n.publishOnFuture;g("#publish").val(postL10n.schedule)}else{if(j<=k&&g("#original_post_status").val()!="publish"){m=postL10n.publishOn;g("#publish").val(postL10n.publish)}else{m=postL10n.publishOnPast;g("#publish").val(postL10n.update)}}if(l.toUTCString()==j.toUTCString()){g("#timestamp").html(a)}else{g("#timestamp").html(m+" <b>"+g("#mm option[value="+g("#mm").val()+"]").text()+" "+g("#jj").val()+", "+g("#aa").val()+" @ "+g("#hh").val()+":"+g("#mn").val()+"</b> ")}if(g("#post-visibility-select input:radio:checked").val()=="private"){g("#publish").val(postL10n.update);if(g("#post_status option[value=publish]").length==0){g("#post_status").append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}g("#post_status option[value=publish]").html(postL10n.privatelyPublished);g("#post_status option[value=publish]").attr("selected",true);g(".edit-post-status").hide()}else{if(g("#original_post_status").val()=="future"||g("#original_post_status").val()=="draft"){if(g("#post_status option[value=publish]").length!=0){g("#post_status option[value=publish]").remove();g("#post_status").val(g("#hidden_post_status").val())}}else{g("#post_status option[value=publish]").html(postL10n.published)}g(".edit-post-status").show()}g("#post-status-display").html(g("#post_status :selected").text());if(g("#post_status :selected").val()=="private"||g("#post_status :selected").val()=="publish"){g("#save-post").hide()}else{g("#save-post").show();if(g("#post_status :selected").val()=="pending"){g("#save-post").show().val(postL10n.savePending)}else{g("#save-post").show().val(postL10n.saveDraft)}}}g(".edit-visibility").click(function(){if(g("#post-visibility-select").is(":hidden")){f();g("#post-visibility-select").slideDown("normal");g(".edit-visibility").hide()}return false});g(".cancel-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g("#visibility-radio-"+g("#hidden-post-visibility").val()).attr("checked",true);g("#post_password").val(g("#hidden_post_password").val());g("#sticky").attr("checked",g("#hidden-post-sticky").attr("checked"));g("#post-visibility-display").html(b);g(".edit-visibility").show();c();return false});g(".save-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g(".edit-visibility").show();c();if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false)}if(true==g("#sticky").attr("checked")){h="Sticky"}else{h=""}g("#post-visibility-display").html(postL10n[g("#post-visibility-select input:radio:checked").val()+h]);return false});g("#post-visibility-select input:radio").change(function(){f()});g(".edit-timestamp").click(function(){if(g("#timestampdiv").is(":hidden")){g("#timestampdiv").slideDown("normal");g(".edit-timestamp").hide()}return false});g(".cancel-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g("#mm").val(g("#hidden_mm").val());g("#jj").val(g("#hidden_jj").val());g("#aa").val(g("#hidden_aa").val());g("#hh").val(g("#hidden_hh").val());g("#mn").val(g("#hidden_mn").val());g(".edit-timestamp").show();c();return false});g(".save-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g(".edit-timestamp").show();c();return false});g(".edit-post-status").click(function(){if(g("#post-status-select").is(":hidden")){g("#post-status-select").slideDown("normal");g(this).hide()}return false});g(".save-post-status").click(function(){g("#post-status-select").slideUp("normal");g(".edit-post-status").show();c();return false});g(".cancel-post-status").click(function(){g("#post-status-select").slideUp("normal");g("#post_status").val(g("#hidden_post_status").val());g(".edit-post-status").show();c();return false});g("#the-list").wpList({addAfter:function(j,k){g("table#list-table").show();if(g.isFunction(autosave_update_post_ID)){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+="&post_id="+g("#post_ID").val();return j}})});
  • branches/2.8/wp-admin/js/postbox.dev.js

    r11698 r11553  
    55            this.init(page,args);
    66            $('.postbox h3, .postbox .handlediv').click( function() {
    7                 var p = $(this).parent('.postbox'), id = p.attr('id');
     7                var p = $(this).parent('.postbox');
     8                /*
     9                if ( p.hasClass('noclick') ) {
     10                    p.removeClass('noclick');
     11                    return false;
     12                }
     13                */
    814                p.toggleClass('closed');
    915                postboxes.save_state(page);
    10                 if ( id ) {
    11                     if ( !p.hasClass('closed') && $.isFunction(postboxes.pbshow) )
    12                         postboxes.pbshow(id);
    13                     else if ( p.hasClass('closed') && $.isFunction(postboxes.pbhide) )
    14                         postboxes.pbhide(id);
    15                 }
    1616            } );
    1717            $('.postbox h3 a').click( function(e) {
  • branches/2.8/wp-admin/js/postbox.js

    r11698 r11553  
    1 var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox"),f=e.attr("id");e.toggleClass("closed");postboxes.save_state(c);if(f){if(!e.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(f)}else{if(e.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(f)}}}});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(postboxL10n.requestFile,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(postboxL10n.requestFile,b)},pbshow:false,pbhide:false}}(jQuery));
     1var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox");e.toggleClass("closed");postboxes.save_state(c)});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(postboxL10n.requestFile,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(postboxL10n.requestFile,b)},pbshow:false,pbhide:false}}(jQuery));
  • branches/2.8/wp-admin/link-parse-opml.php

    r11698 r11553  
    77 */
    88
    9 if ( ! defined('ABSPATH') )
    10     die();
     9/** Load WordPress Bootstrap */
     10require_once('../wp-load.php');
    1111
    1212global $opml, $map;
  • branches/2.8/wp-admin/media-upload.php

    r11698 r11553  
    3030
    3131if ( isset($_GET['inline']) ) {
    32     $errors = array();
     32
     33    if ( isset($_GET['upload-page-form']) ) {
     34        $errors = media_upload_form_handler();
     35
     36        $location = 'upload.php';
     37        if ( $errors )
     38            $location .= '?message=3';
     39
     40        wp_redirect( admin_url($location) );
     41    }
    3342
    3443    if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
     
    4049            $id = false;
    4150        }
    42     }
    43 
    44     if ( isset($_GET['upload-page-form']) ) {
    45         $errors = array_merge($errors, (array) media_upload_form_handler());
    46 
    47         $location = 'upload.php';
    48         if ( $errors )
    49             $location .= '?message=3';
    50 
    51         wp_redirect( admin_url($location) );
    5251    }
    5352
  • branches/2.8/wp-admin/menu-header.php

    r11698 r11553  
    7575            $submenu[$item[2]] = array_values($submenu[$item[2]]);  // Re-index.
    7676            $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
    77             $menu_file = $submenu[$item[2]][0][2];
    78             if ( false !== $pos = strpos($menu_file, '?') )
    79                 $menu_file = substr($menu_file, 0, $pos);
    80             if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") ) || !empty($menu_hook)) {
     77            if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") ) || !empty($menu_hook)) {
    8178                $admin_is_parent = true;
    8279                echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu[$item[2]][0][2]}'>$img</a></div>$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>{$item[0]}</a>";
     
    8683        } else if ( current_user_can($item[1]) ) {
    8784            $menu_hook = get_plugin_page_hook($item[2], 'admin.php');
    88             $menu_file = $item[2];
    89             if ( false !== $pos = strpos($menu_file, '?') )
    90                 $menu_file = substr($menu_file, 0, $pos);
    91             if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") || !empty($menu_hook) ) {
     85            if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) {
    9286                $admin_is_parent = true;
    9387                echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}'>$img</a></div>$toggle<a href='admin.php?page={$item[2]}'$class$tabindex>{$item[0]}</a>";
     
    109103                    $first = false;
    110104                }
    111 
    112                 $menu_file = $item[2];
    113                 if ( false !== $pos = strpos($menu_file, '?') )
    114                     $menu_file = substr($menu_file, 0, $pos);
    115 
    116105                if ( isset($submenu_file) ) {
    117106                    if ( $submenu_file == $sub_item[2] )
     
    119108                // If plugin_page is set the parent must either match the current page or not physically exist.
    120109                // This allows plugin pages with the same hook to exist under different parents.
    121                 } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2] && (!file_exists($menu_file) || ($item[2] == $self))) || (!isset($plugin_page) && $self == $sub_item[2]) ) {
     110                } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2] && (!file_exists($item[2]) || ($item[2] == $self))) || (!isset($plugin_page) && $self == $sub_item[2]) ) {
    122111                    $class[] = 'current';
    123112                }
     
    126115
    127116                $menu_hook = get_plugin_page_hook($sub_item[2], $item[2]);
    128                 $sub_file = $sub_item[2];
    129                 if ( false !== $pos = strpos($sub_file, '?') )
    130                     $sub_file = substr($sub_file, 0, $pos);
    131117
    132                 if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/$sub_file") ) || ! empty($menu_hook) ) {
     118                if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") ) || ! empty($menu_hook) ) {
    133119                    // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
    134                    
    135                     $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file);
     120                    $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]);
    136121                    if ( $parent_exists )
    137122                        echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";
  • branches/2.8/wp-admin/options-general.php

    r11698 r11553  
    158158<br />
    159159<span>
    160 <?php if ($tzstring) : ?>
     160<?php if (get_option('timezone_string')) : ?>
    161161    <?php
    162162    $now = localtime(time(),true);
     
    166166    <br />
    167167    <?php
    168     if (function_exists('timezone_transitions_get')) {
     168    if (function_exists('timezone_transitions_get') && $tzstring) {
    169169        $dateTimeZoneSelected = new DateTimeZone($tzstring);
    170170        foreach (timezone_transitions_get($dateTimeZoneSelected) as $tr) {
    171171            if ($tr['ts'] > time()) {
    172                 $found = true;
     172                    $found = true;
    173173                break;
    174174            }
     
    180180                __('Daylight savings time begins on: <code>%s</code>.') :
    181181                __('Standard time begins  on: <code>%s</code>.');
    182             printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $tr['ts'] ) );
     182            $tz = new DateTimeZone($tzstring);
     183            $d = new DateTime( "@{$tr['ts']}" );
     184            $d->setTimezone($tz);
     185            printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $d->format('U') ) );
    183186        } else {
    184187            _e('This timezone does not observe daylight savings time.');
  • branches/2.8/wp-admin/plugin-editor.php

    r11698 r11553  
    8484    }
    8585
     86    if ( use_codepress() )
     87        wp_enqueue_script( 'codepress' );
     88
    8689    // List of allowable extensions
    8790    $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include');
     
    109112        $functions = wp_doc_link_parse( $content );
    110113
    111         if ( !empty($functions) ) {
    112             $docs_select = '<select name="docs-list" id="docs-list">';
    113             $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
    114             foreach ( $functions as $function) {
    115                 $docs_select .= '<option value="' . esc_attr( $function ) . '">' . htmlspecialchars( $function ) . '()</option>';
    116             }
    117             $docs_select .= '</select>';
     114        $docs_select = '<select name="docs-list" id="docs-list">';
     115        $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
     116        foreach ( $functions as $function) {
     117            $docs_select .= '<option value="' . esc_attr( $function ) . '">' . htmlspecialchars( $function ) . '()</option>';
    118118        }
     119        $docs_select .= '</select>';
    119120    }
    120121
     
    136137<?php screen_icon(); ?>
    137138<h2><?php echo esc_html( $title ); ?></h2>
    138 
    139 <div class="fileedit-sub">
     139<div class="bordertitle">
     140    <form id="themeselector" action="plugin-editor.php" method="post">
     141        <strong><label for="plugin"><?php _e('Select plugin to edit:'); ?> </label></strong>
     142        <select name="plugin" id="plugin">
     143<?php
     144    foreach ( $plugins as $plugin_key => $a_plugin ) {
     145        $plugin_name = $a_plugin['Name'];
     146        if ( $plugin_key == $plugin )
     147            $selected = " selected='selected'";
     148        else
     149            $selected = '';
     150        $plugin_name = esc_attr($plugin_name);
     151        $plugin_key = esc_attr($plugin_key);
     152        echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>";
     153    }
     154?>
     155        </select>
     156        <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />
     157    </form>
     158</div>
     159<div class="tablenav">
    140160<div class="alignleft">
    141161<big><?php
     
    153173    ?></big>
    154174</div>
    155 <div class="alignright">
    156     <form action="plugin-editor.php" method="post">
    157         <strong><label for="plugin"><?php _e('Select plugin to edit:'); ?> </label></strong>
    158         <select name="plugin" id="plugin">
    159 <?php
    160     foreach ( $plugins as $plugin_key => $a_plugin ) {
    161         $plugin_name = $a_plugin['Name'];
    162         if ( $plugin_key == $plugin )
    163             $selected = " selected='selected'";
    164         else
    165             $selected = '';
    166         $plugin_name = esc_attr($plugin_name);
    167         $plugin_key = esc_attr($plugin_key);
    168         echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>";
    169     }
    170 ?>
    171         </select>
    172         <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />
    173     </form>
    174 </div>
    175175<br class="clear" />
    176176</div>
    177 
    178 <div id="templateside">
    179     <h3><?php _e('Plugin Files'); ?></h3>
     177<br class="clear" />
     178    <div id="templateside">
     179    <h3 id="bordertitle"><?php _e('Plugin Files'); ?></h3>
    180180
    181181    <ul>
     
    196196<?php endforeach; ?>
    197197    </ul>
    198 </div>
    199 <form name="template" id="template" action="plugin-editor.php" method="post">
     198    </div>
     199    <form name="template" id="template" action="plugin-editor.php" method="post">
    200200    <?php wp_nonce_field('edit-plugin_' . $file) ?>
    201201        <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>
     
    204204        <input type="hidden" name="plugin" value="<?php echo esc_attr($plugin) ?>" />
    205205        </div>
    206         <?php if ( !empty( $docs_select ) ) : ?>
     206        <?php if ( isset( $functions ) ) : ?>
    207207        <div id="documentation"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" /></div>
    208208        <?php endif; ?>
     
    222222    <p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p>
    223223<?php endif; ?>
    224 </form>
    225 <br class="clear" />
     224 </form>
     225<div class="clear"> &nbsp; </div>
    226226</div>
    227227<?php
    228228    break;
    229229}
    230 include("admin-footer.php");
     230include("admin-footer.php") ?>
  • branches/2.8/wp-admin/rtl.css

    r11698 r11553  
    138138.folded #adminmenu img.wp-menu-image {
    139139    padding: 7px 6px 0 0;
    140 }
    141 #adminmenu a.separator {
    142     cursor: e-resize;
    143 }
    144 .folded #adminmenu a.separator {
    145     cursor: w-resize;
    146140}
    147141#adminmenu .wp-submenu .wp-submenu-head {
  • branches/2.8/wp-admin/theme-editor.php

    r11698 r11553  
    2323} else {
    2424    $theme = stripslashes($theme);
    25 }
     25 }
     26
    2627
    2728if ( ! isset($themes[$theme]) )
     
    6566
    6667    $location = wp_kses_no_null($location);
    67     $strip = array('%0d', '%0a', '%0D', '%0A');
    68     $location = _deep_replace($strip, $location);
     68    $strip = array('%0d', '%0a');
     69    $location = str_replace($strip, '', $location);
    6970    header("Location: $location");
    7071    exit();
     
    7677    if ( !current_user_can('edit_themes') )
    7778        wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>');
     79
     80    if ( use_codepress() )
     81        wp_enqueue_script( 'codepress' );
    7882
    7983    require_once('admin-header.php');
     
    114118<?php screen_icon(); ?>
    115119<h2><?php echo esc_html( $title ); ?></h2>
    116 
    117 <div class="fileedit-sub">
    118 <div class="alignleft">
    119 <big><?php echo sprintf($desc_header, $file_show); ?></big>
    120 </div>
    121 <div class="alignright">
    122     <form action="theme-editor.php" method="post">
     120<div class="bordertitle">
     121    <form id="themeselector" action="theme-editor.php" method="post">
    123122        <strong><label for="theme"><?php _e('Select theme to edit:'); ?> </label></strong>
    124123        <select name="theme" id="theme">
     
    136135    </form>
    137136</div>
     137<div class="tablenav">
     138<div class="alignleft">
     139<big><?php echo sprintf($desc_header, $file_show); ?></big>
     140</div>
    138141<br class="clear" />
    139142</div>
    140 
    141 <div id="templateside">
    142     <h3><?php _e("Theme Files"); ?></h3>
     143<br class="clear" />
     144    <div id="templateside">
     145    <h3 id="bordertitle"><?php _e("Theme Files"); ?></h3>
    143146
    144147<?php
     
    191194<?php endif; ?>
    192195</div>
    193 
    194 <?php if (!$error) { ?>
    195 <form name="template" id="template" action="theme-editor.php" method="post">
     196    <?php
     197    if (!$error) {
     198    ?>
     199    <form name="template" id="template" action="theme-editor.php" method="post">
    196200    <?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
    197201         <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>
     
    219223<?php endif; ?>
    220224        </div>
    221 </form>
    222 <?php
     225    </form>
     226    <?php
    223227    } else {
    224228        echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>';
    225229    }
    226 ?>
    227 <br class="clear" />
     230    ?>
     231<div class="clear"> &nbsp; </div>
    228232</div>
    229233<?php
     
    231235}
    232236
    233 include("admin-footer.php");
     237include("admin-footer.php") ?>
  • branches/2.8/wp-admin/update-core.php

    r11698 r11553  
    1515function list_core_update( $update ) {
    1616    global $wp_local_package;
    17     $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
     17    $version_string = 'en_US' == $update->locale ?
    1818            $update->current : sprintf("%s&ndash;<strong>%s</strong>", $update->current, $update->locale);
    1919    $current = false;
     
    5454    if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
    5555        echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>';
    56     else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
    57         echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English.</strong> There is a chance this upgrade will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';
    58     }
    5956    echo '</form>';
    6057
  • branches/2.8/wp-admin/upgrade.php

    r11698 r11553  
    6969    case 1:
    7070        wp_upgrade();
    71            
    72             $backto = empty($_GET['backto']) ? '' : $_GET['backto'] ;
    73             $backto = stripslashes( urldecode( $backto ) );
     71
     72        if ( empty( $_GET['backto'] ) )
     73            $backto = __get_option( 'home' ) . '/';
     74        else {
     75            $backto = stripslashes( urldecode( $_GET['backto'] ) );
    7476            $backto = esc_url_raw( $backto  );
    75             $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');
     77        }
    7678?>
    7779<h2><?php _e( 'Upgrade Complete' ); ?></h2>
  • branches/2.8/wp-admin/wp-admin.css

    r11698 r11553  
    436436#wpcontent option {
    437437    padding: 2px;
    438 }
    439 
    440 #timezone_string option {
    441     margin-left: 1em;
    442438}
    443439
     
    20972093}
    20982094
     2095.bordertitle {
     2096    padding-bottom: 5px;
     2097    border-bottom-width: 1px;
     2098    border-bottom-style: solid;
     2099}
     2100
    20992101/* Edit posts */
    21002102
     
    31853187}
    31863188
    3187 .widefat td p {
    3188     margin: 2px 0 0.8em;
    3189 }
    3190 
    31913189table .vers,
    31923190table .column-visible,
  • branches/2.8/wp-content/plugins/hello.php

    r11698 r11553  
    33 * @package Hello_Dolly
    44 * @author Matt Mullenweg
    5  * @version 1.5.1
     5 * @version 1.5
    66 */
    77/*
     
    1010Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
    1111Author: Matt Mullenweg
    12 Version: 1.5.1
     12Version: 1.5
    1313Author URI: http://ma.tt/
    1414*/
     
    6363// We need some CSS to position the paragraph
    6464function dolly_css() {
    65     // This makes sure that the posinioning is also good for right-to-left languages
    66     $x = ( 'rtl' == get_bloginfo( 'text_direction' ) ) ? 'left' : 'right';
    67 
    6865    echo "
    6966    <style type='text/css'>
     
    7370        margin: 0;
    7471        padding: 0;
    75         $x: 215px;
     72        right: 215px;
    7673        font-size: 11px;
    7774    }
  • branches/2.8/wp-includes/class-simplepie.php

    r11698 r11553  
    752752    function __destruct()
    753753    {
    754         if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
    755         {
    756             if (!empty($this->data['items']))
    757             {
    758                 foreach ($this->data['items'] as $item)
    759                 {
    760                     $item->__destruct();
    761                 }
    762                 unset($item, $this->data['items']);
    763             }
    764             if (!empty($this->data['ordered_items']))
    765             {
    766                 foreach ($this->data['ordered_items'] as $item)
    767                 {
    768                     $item->__destruct();
    769                 }
    770                 unset($item, $this->data['ordered_items']);
    771             }
     754        if (!empty($this->data['items']))
     755        {
     756            foreach ($this->data['items'] as $item)
     757            {
     758                $item->__destruct();
     759            }
     760            unset($this->data['items']);
     761        }
     762        if (!empty($this->data['ordered_items']))
     763        {
     764            foreach ($this->data['ordered_items'] as $item)
     765            {
     766                $item->__destruct();
     767            }
     768            unset($this->data['ordered_items']);
    772769        }
    773770    }
     
    16871684                $headers = $file->headers;
    16881685                $data = $file->body;
    1689                 $sniffer =& new $this->content_type_sniffer_class($file);
     1686                $sniffer = new $this->content_type_sniffer_class($file);
    16901687                $sniffed = $sniffer->get_type();
    16911688            }
     
    19651962                    if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
    19661963                    {
    1967                         $sniffer =& new $this->content_type_sniffer_class($file);
     1964                        $sniffer = new $this->content_type_sniffer_class($file);
    19681965                        if (substr($sniffer->get_type(), 0, 6) === 'image/')
    19691966                        {
     
    30863083    function __destruct()
    30873084    {
    3088         if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
    3089         {
    3090             unset($this->feed);
    3091         }
     3085        unset($this->feed);
    30923086    }
    30933087
     
    56895683    }
    56905684
     5685    /**
     5686     * Remove items that link back to this before destroying this object
     5687     */
     5688    function __destruct()
     5689    {
     5690        unset($this->item);
     5691    }
     5692
    56915693    function get_source_tags($namespace, $tag)
    56925694    {
     
    77457747                                    case 'gzip':
    77467748                                    case 'x-gzip':
    7747                                         $decoder =& new SimplePie_gzdecode($this->body);
     7749                                        $decoder = new SimplePie_gzdecode($this->body);
    77487750                                        if (!$decoder->parse())
    77497751                                        {
     
    89538955    function parse_url($url)
    89548956    {
    8955         preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match);
    8956         for ($i = count($match); $i <= 9; $i++)
    8957         {
    8958             $match[$i] = '';
    8959         }
    8960         return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
     8957        static $cache = array();
     8958        if (isset($cache[$url]))
     8959        {
     8960            return $cache[$url];
     8961        }
     8962        elseif (preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match))
     8963        {
     8964            for ($i = count($match); $i <= 9; $i++)
     8965            {
     8966                $match[$i] = '';
     8967            }
     8968            return $cache[$url] = array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
     8969        }
     8970        else
     8971        {
     8972            return $cache[$url] = array('scheme' => '', 'authority' => '', 'path' => '', 'query' => '', 'fragment' => '');
     8973        }
    89618974    }
    89628975
     
    1054310556    function entities_decode($data)
    1054410557    {
    10545         $decoder =& new SimplePie_Decode_HTML_Entities($data);
     10558        $decoder = new SimplePie_Decode_HTML_Entities($data);
    1054610559        return $decoder->parse();
    1054710560    }
     
    1079710810    function codepoint_to_utf8($codepoint)
    1079810811    {
     10812        static $cache = array();
    1079910813        $codepoint = (int) $codepoint;
    10800         if ($codepoint < 0)
    10801         {
    10802             return false;
     10814        if (isset($cache[$codepoint]))
     10815        {
     10816            return $cache[$codepoint];
     10817        }
     10818        elseif ($codepoint < 0)
     10819        {
     10820            return $cache[$codepoint] = false;
    1080310821        }
    1080410822        else if ($codepoint <= 0x7f)
    1080510823        {
    10806             return chr($codepoint);
     10824            return $cache[$codepoint] = chr($codepoint);
    1080710825        }
    1080810826        else if ($codepoint <= 0x7ff)
    1080910827        {
    10810             return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
     10828            return $cache[$codepoint] = chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
    1081110829        }
    1081210830        else if ($codepoint <= 0xffff)
    1081310831        {
    10814             return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
     10832            return $cache[$codepoint] = chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
    1081510833        }
    1081610834        else if ($codepoint <= 0x10ffff)
    1081710835        {
    10818             return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
     10836            return $cache[$codepoint] = chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
    1081910837        }
    1082010838        else
    1082110839        {
    1082210840            // U+FFFD REPLACEMENT CHARACTER
    10823             return "\xEF\xBF\xBD";
     10841            return $cache[$codepoint] = "\xEF\xBF\xBD";
    1082410842        }
    1082510843    }
     
    1093910957            if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
    1094010958            {
    10941                 $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'));
     10959                $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'));
    1094210960                if ($parser->parse())
    1094310961                {
     
    1095210970            if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00"))
    1095310971            {
    10954                 $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'));
     10972                $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'));
    1095510973                if ($parser->parse())
    1095610974                {
     
    1096510983            if ($pos = strpos($data, "\x00\x3F\x00\x3E"))
    1096610984            {
    10967                 $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'));
     10985                $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'));
    1096810986                if ($parser->parse())
    1096910987                {
     
    1097810996            if ($pos = strpos($data, "\x3F\x00\x3E\x00"))
    1097910997            {
    10980                 $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'));
     10998                $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'));
    1098110999                if ($parser->parse())
    1098211000                {
     
    1099111009            if ($pos = strpos($data, "\x3F\x3E"))
    1099211010            {
    10993                 $parser =& new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
     11011                $parser = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
    1099411012                if ($parser->parse())
    1099511013                {
     
    1171711735        if (!isset($cache[get_class($this)]))
    1171811736        {
    11719             $all_methods = get_class_methods($this);
     11737            if (extension_loaded('Reflection'))
     11738            {
     11739                $class = new ReflectionClass(get_class($this));
     11740                $methods = $class->getMethods();
     11741                $all_methods = array();
     11742                foreach ($methods as $method)
     11743                {
     11744                    $all_methods[] = $method->getName();
     11745                }
     11746            }
     11747            else
     11748            {
     11749                $all_methods = get_class_methods($this);
     11750            }
    1172011751
    1172111752            foreach ($all_methods as $method)
     
    1174411775        if (!$object)
    1174511776        {
    11746             $object =& new SimplePie_Parse_Date;
     11777            $object = new SimplePie_Parse_Date;
    1174711778        }
    1174811779        return $object;
     
    1277912810        if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
    1278012811        {
    12781             $sniffer =& new $this->content_type_sniffer_class($this->file);
     12812            $sniffer = new $this->content_type_sniffer_class($this->file);
    1278212813            if ($sniffer->get_type() !== 'text/html')
    1278312814            {
     
    1282512856        if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
    1282612857        {
    12827             $sniffer =& new $this->content_type_sniffer_class($file);
     12858            $sniffer = new $this->content_type_sniffer_class($file);
    1282812859            $sniffed = $sniffer->get_type();
    1282912860            if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml')))
     
    1305313084        if (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), "\x09\x0A\x0D\x20") && ($pos = strpos($data, '?>')) !== false)
    1305413085        {
    13055             $declaration =& new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
     13086            $declaration = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
    1305613087            if ($declaration->parse())
    1305713088            {
  • branches/2.8/wp-includes/default-widgets.php

    r11698 r11553  
    527527            $cache = array();
    528528
    529         if ( isset($cache[$args['widget_id']]) ) {
    530             echo $cache[$args['widget_id']];
    531             return;
    532         }
     529        if ( isset($cache[$args['widget_id']]) )
     530            return $cache[$args['widget_id']];
    533531
    534532        ob_start();
  • branches/2.8/wp-includes/formatting.php

    r11698 r11553  
    8181
    8282function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
    83     $o = preg_quote($opening, '/');
    84     $c = preg_quote($closing, '/');
     83    $o = preg_quote($opening);
     84    $c = preg_quote($closing);
    8585    foreach($disabled_elements as $element) {
    8686        if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element);
     
    20432043    if ('' == $url) return $url;
    20442044    $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
    2045     $strip = array('%0d', '%0a', '%0D', '%0A');
    2046     $url = _deep_replace($strip, $url);
     2045    $strip = array('%0d', '%0a');
     2046    $url = str_replace($strip, '', $url);
    20472047    $url = str_replace(';//', '://', $url);
    20482048    /* If the URL doesn't appear to contain a scheme, we
     
    20662066
    20672067    return apply_filters('clean_url', $url, $original_url, $context);
    2068 }
    2069 
    2070 /**
    2071  * Perform a deep string replace operation to ensure the values in $search are no longer present
    2072  *
    2073  * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
    2074  * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
    2075  * str_replace would return
    2076  *
    2077  * @since 2.8.1
    2078  * @access private
    2079  *
    2080  * @param string|array $search
    2081  * @param string $subject
    2082  * @return string The processed string
    2083  */
    2084 function _deep_replace($search, $subject){
    2085     $found = true;
    2086     while($found) {
    2087         $found = false;
    2088         foreach( (array) $search as $val ) {
    2089             while(strpos($subject, $val) !== false) {
    2090                 $found = true;
    2091                 $subject = str_replace($val, '', $subject);
    2092             }
    2093         }
    2094     }
    2095    
    2096     return $subject;
    20972068}
    20982069
  • branches/2.8/wp-includes/functions.php

    r11698 r11553  
    26832683            $wp_smiliessearch .= '|';
    26842684        }
    2685         $wp_smiliessearch .= preg_quote($rest, '/');
     2685        $wp_smiliessearch .= preg_quote($rest);
    26862686    }
    26872687
     
    31503150 */
    31513151function wp_timezone_override_offset() {
    3152     if ( !wp_timezone_supported() ) {
    3153         return false;
    3154     }
    3155     if ( !$timezone_string = get_option( 'timezone_string' ) ) {
    3156         return false;
    3157     }
    3158 
    3159     @date_default_timezone_set( $timezone_string );
    3160     $timezone_object = timezone_open( $timezone_string );
    3161     $datetime_object = date_create();
    3162     if ( false === $timezone_object || false === $datetime_object ) {
    3163         return false;
    3164     }
    3165     return round( timezone_offset_get( $timezone_object, $datetime_object ) / 3600, 2 );
     3152    if (!wp_timezone_supported()) return false;
     3153
     3154    $tz = get_option('timezone_string');
     3155    if (empty($tz)) return false;
     3156
     3157    @date_default_timezone_set($tz);
     3158
     3159    $dateTimeZoneSelected = timezone_open($tz);
     3160    $dateTimeServer = date_create();
     3161    if ($dateTimeZoneSelected === false || $dateTimeServer === false) return false;
     3162
     3163    $timeOffset = timezone_offset_get($dateTimeZoneSelected, $dateTimeServer);
     3164    $timeOffset = $timeOffset / 3600;
     3165
     3166    return $timeOffset;
    31663167}
    31673168
    31683169/**
    31693170 * Check for PHP timezone support
     3171 *
    31703172 */
    31713173function wp_timezone_supported() {
    3172     $support = false;
    3173     if (
    3174         function_exists( 'date_default_timezone_set' ) &&
    3175         function_exists( 'timezone_identifiers_list' ) &&
    3176         function_exists( 'timezone_open' ) &&
    3177         function_exists( 'timezone_offset_get' )
    3178     ) {
    3179         $support = true;
    3180     }
    3181     return apply_filters( 'timezone_support', $support );
    3182 }
    3183 
    3184 function _wp_timezone_choice_usort_callback( $a, $b ) {
    3185     // Don't use translated versions of Etc
    3186     if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) {
    3187         // Make the order of these more like the old dropdown
    3188         if ( 'GMT+' === substr( $a['city'], 0, 4 ) && 'GMT+' === substr( $b['city'], 0, 4 ) ) {
    3189             return -1 * ( strnatcasecmp( $a['city'], $b['city'] ) );
    3190         }
    3191         if ( 'UTC' === $a['city'] ) {
    3192             if ( 'GMT+' === substr( $b['city'], 0, 4 ) ) {
    3193                 return 1;
    3194             }
    3195             return -1;
    3196         }
    3197         if ( 'UTC' === $b['city'] ) {
    3198             if ( 'GMT+' === substr( $a['city'], 0, 4 ) ) {
    3199                 return -1;
    3200             }
    3201             return 1;
    3202         }
    3203         return strnatcasecmp( $a['city'], $b['city'] );
    3204     }
    3205     if ( $a['t_continent'] == $b['t_continent'] ) {
    3206         if ( $a['t_city'] == $b['t_city'] ) {
    3207             return strnatcasecmp( $a['t_subcity'], $b['t_subcity'] );
    3208         }
    3209         return strnatcasecmp( $a['t_city'], $b['t_city'] );
    3210     } else {
    3211         // Force Etc to the bottom of the list
    3212         if ( 'Etc' === $a['continent'] ) {
    3213             return 1;
    3214         }
    3215         if ( 'Etc' === $b['continent'] ) {
    3216             return -1;
    3217         }
    3218         return strnatcasecmp( $a['t_continent'], $b['t_continent'] );
    3219     }
     3174    if (function_exists('date_default_timezone_set')
     3175        && function_exists('timezone_identifiers_list')
     3176        && function_exists('timezone_open')
     3177        && function_exists('timezone_offset_get')
     3178        )
     3179        return apply_filters('timezone_support',true);
     3180
     3181    return apply_filters('timezone_support',false);
    32203182}
    32213183
     
    32233185 * Gives a nicely formatted list of timezone strings // temporary! Not in final
    32243186 *
    3225  * @param $selected_zone string Selected Zone
    3226  *
    3227  */
    3228 function wp_timezone_choice( $selected_zone ) {
     3187 * @param string $selectedzone - which zone should be the selected one
     3188 *
     3189 */
     3190function wp_timezone_choice($selectedzone) {
    32293191    static $mo_loaded = false;
    32303192
    3231     $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc' );
     3193    $continents = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc');
    32323194
    32333195    // Load translations for continents and cities
    3234     if ( !$mo_loaded ) {
     3196    if ( ! $mo_loaded ) {
    32353197        $locale = get_locale();
    3236         $mofile = WP_LANG_DIR . '/continents-cities-' . $locale . '.mo';
    3237         load_textdomain( 'continents-cities', $mofile );
     3198        $mofile = WP_LANG_DIR . "/continents-cities-$locale.mo";
     3199        load_textdomain('continents-cities', $mofile);
    32383200        $mo_loaded = true;
    32393201    }
    32403202
    3241     $zonen = array();
    3242     foreach ( timezone_identifiers_list() as $zone ) {
    3243         $zone = explode( '/', $zone );
    3244         if ( !in_array( $zone[0], $continents ) ) {
     3203    $all = timezone_identifiers_list();
     3204
     3205    $i = 0;
     3206    foreach ( $all as $zone ) {
     3207        $zone = explode('/',$zone);
     3208        if ( ! in_array($zone[0], $continents) )
    32453209            continue;
    3246         }
    3247         if ( 'Etc' === $zone[0] && in_array( $zone[1], array( 'UCT', 'GMT', 'GMT0', 'GMT+0', 'GMT-0', 'Greenwich', 'Universal', 'Zulu' ) ) ) {
     3210        if ( $zone[0] == 'Etc' && in_array($zone[1], array('UCT', 'GMT', 'GMT0', 'GMT+0', 'GMT-0', 'Greenwich', 'Universal', 'Zulu')) )
    32483211            continue;
    3249         }
    3250 
    3251         // This determines what gets set and translated - we don't translate Etc/* strings here, they are done later
    3252         $exists = array(
    3253             0 => ( isset( $zone[0] ) && $zone[0] ) ? true : false,
    3254             1 => ( isset( $zone[1] ) && $zone[1] ) ? true : false,
    3255             2 => ( isset( $zone[2] ) && $zone[2] ) ? true : false
    3256         );
    3257         $exists[3] = ( $exists[0] && 'Etc' !== $zone[0] ) ? true : false;
    3258         $exists[4] = ( $exists[1] && $exists[3] ) ? true : false;
    3259         $exists[5] = ( $exists[2] && $exists[3] ) ? true : false;
    3260 
    3261         $zonen[] = array(
    3262             'continent'   => ( $exists[0] ? $zone[0] : '' ),
    3263             'city'        => ( $exists[1] ? $zone[1] : '' ),
    3264             'subcity'     => ( $exists[2] ? $zone[2] : '' ),
    3265             't_continent' => ( $exists[3] ? translate( str_replace( '_', ' ', $zone[0] ), 'continents-cities' ) : '' ),
    3266             't_city'      => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ),
    3267             't_subcity'   => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' )
    3268         );
    3269     }
    3270     usort( $zonen, '_wp_timezone_choice_usort_callback' );
    3271 
    3272     $structure = array();
    3273 
    3274     if ( empty( $selected_zone ) ) {
    3275         $structure[] = '<option selected="selected" value="">' . __( 'Select a city' ) . '</option>';
    3276     }
    3277 
    3278     foreach ( $zonen as $key => $zone ) {
    3279         // Build value in an array to join later
    3280         $value = array( $zone['continent'] );
    3281 
    3282         if ( empty( $zone['city'] ) ) {
    3283             // It's at the continent level (generally won't happen)
    3284             $display = $zone['t_continent'];
    3285         } else {
    3286             // It's inside a continent group
    3287            
    3288             // Continent optgroup
    3289             if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) {
    3290                 $label = ( 'Etc' === $zone['continent'] ) ? __( 'Manual offsets' ) : $zone['t_continent'];
    3291                 $structure[] = '<optgroup label="'. esc_attr( $label ) .'">';
    3292             }
    3293            
    3294             // Add the city to the value
    3295             $value[] = $zone['city'];
    3296             if ( 'Etc' === $zone['continent'] ) {
    3297                 if ( 'UTC' === $zone['city'] ) {
    3298                     $display = '';
    3299                 } else {
    3300                     $display = str_replace( 'GMT', '', $zone['city'] );
    3301                     $display = strtr( $display, '+-', '-+' ) . ':00';
    3302                 }
    3303                 $display = sprintf( __( 'UTC %s' ), $display );
    3304             } else {
    3305                 $display = $zone['t_city'];
    3306                 if ( !empty( $zone['subcity'] ) ) {
    3307                     // Add the subcity to the value
    3308                     $value[] = $zone['subcity'];
    3309                     $display .= ' - ' . $zone['t_subcity'];
    3310                 }
     3212        $zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : '';
     3213        $zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : '';
     3214        $zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : '';
     3215        $i++;
     3216    }
     3217
     3218    usort($zonen, create_function(
     3219        '$a, $b', '
     3220        $t = create_function(\'$s\', \'return translate(str_replace("_", " ", $s), "continents-cities");\');
     3221        $a_continent = $t($a["continent"]);
     3222        $b_continent = $t($b["continent"]);
     3223        $a_city = $t($a["city"]);
     3224        $b_city = $t($b["city"]);
     3225        $a_subcity = $t($a["subcity"]);
     3226        $b_subcity = $t($b["subcity"]);
     3227        if ( $a_continent == $b_continent && $a_city == $b_city )
     3228            return strnatcasecmp($a_subcity, $b_subcity);
     3229        elseif ( $a_continent == $b_continent )
     3230            return strnatcasecmp($a_city, $b_city);
     3231        else
     3232            return strnatcasecmp($a_continent, $b_continent);
     3233        '));
     3234
     3235    $structure = '';
     3236    $pad = '&nbsp;&nbsp;&nbsp;';
     3237
     3238    if ( empty($selectedzone) )
     3239        $structure .= '<option selected="selected" value="">' . __('Select a city') . "</option>\n";
     3240    foreach ( $zonen as $zone ) {
     3241        extract($zone);
     3242        if ( empty($selectcontinent) && !empty($city) ) {
     3243            $selectcontinent = $continent;
     3244            $structure .= '<optgroup label="'. esc_attr( translate( $continent, "continents-cities" ) ) .'">' . "\n"; // continent
     3245        } elseif ( !empty($selectcontinent) && $selectcontinent != $continent ) {
     3246            $structure .= "</optgroup>\n";
     3247            $selectcontinent = '';
     3248            if ( !empty($city) ) {
     3249                $selectcontinent = $continent;
     3250                $structure .= '<optgroup label="'. esc_attr( translate( $continent, "continents-cities" ) ) .'">' . "\n"; // continent
    33113251            }
    33123252        }
    33133253
    3314         // Build the value
    3315         $value = join( '/', $value );
    3316         $selected = '';
    3317         if ( $value === $selected_zone ) {
    3318             $selected = 'selected="selected" ';
     3254        if ( !empty($city) ) {
     3255            $display = str_replace('_',' ',$city);
     3256            $display = translate($display, "continents-cities");
     3257            if ( !empty($subcity) ) {
     3258                $display_subcity = str_replace('_', ' ', $subcity);
     3259                $display_subcity = translate($display_subcity, "continents-cities");
     3260                $city = $city . '/'. $subcity;
     3261                $display = $display . '/' . $display_subcity;
     3262            }
     3263            if ( $continent == 'Etc' )
     3264                $display = strtr($display, '+-', '-+');
     3265            $structure .= "\t<option ".((($continent.'/'.$city)==$selectedzone)?'selected="selected"':'')." value=\"".($continent.'/'.$city)."\">$pad".$display."</option>\n"; //Timezone
     3266        } else {
     3267            $structure .= "<option ".(($continent==$selectedzone)?'selected="selected"':'')." value=\"".$continent."\">" . translate($continent, "continents-cities") . "</option>\n"; //Timezone
    33193268        }
    3320         $structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>";
    3321        
    3322         // Close continent optgroup
    3323         if ( !empty( $zone['city'] ) && ( !isset($zonen[$key + 1]) || (isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) ) ) {
    3324             $structure[] = '</optgroup>';
    3325         }
    3326     }
    3327 
    3328     return join( "\n", $structure );
     3269    }
     3270
     3271    if ( !empty($selectcontinent) )
     3272        $structure .= "</optgroup>\n";
     3273    return $structure;
    33293274}
    33303275
  • branches/2.8/wp-includes/functions.wp-styles.php

    r11698 r11553  
    9393function wp_style_is( $handle, $list = 'queue' ) {
    9494    global $wp_styles;
    95     if ( !is_a($wp_styles, 'WP_Styles') )
     95    if ( !is_a($wp_styles, 'WP_Scripts') )
    9696        $wp_styles = new WP_Styles();
    9797
  • branches/2.8/wp-includes/http.php

    r11698 r11553  
    7474     * that object to be used later.
    7575     *
    76      * The order for the GET/HEAD requests are Streams, HTTP Extension, Fopen,
    77      * and finally Fsockopen. fsockopen() is used last, because it has the most
    78      * overhead in its implementation. There isn't any real way around it, since
    79      * redirects have to be supported, much the same way the other transports
    80      * also handle redirects.
     76     * The order for the GET/HEAD requests are HTTP Extension, FSockopen Streams,
     77     * Fopen, and finally cURL. Whilst Fsockopen has the highest overhead, Its
     78     * used 2nd due to high compatibility with most hosts, The HTTP Extension is
     79     * tested first due to hosts which have it enabled, are likely to work
     80     * correctly with it.
    8181     *
    8282     * There are currently issues with "localhost" not resolving correctly with
     
    9999                $working_transport['exthttp'] = new WP_Http_ExtHttp();
    100100                $blocking_transport[] = &$working_transport['exthttp'];
    101             } else if ( true === WP_Http_Curl::test($args) ) {
    102                 $working_transport['curl'] = new WP_Http_Curl();
    103                 $blocking_transport[] = &$working_transport['curl'];
     101            } else if ( true === WP_Http_Fsockopen::test($args) ) {
     102                $working_transport['fsockopen'] = new WP_Http_Fsockopen();
     103                $blocking_transport[] = &$working_transport['fsockopen'];
    104104            } else if ( true === WP_Http_Streams::test($args) ) {
    105105                $working_transport['streams'] = new WP_Http_Streams();
     
    108108                $working_transport['fopen'] = new WP_Http_Fopen();
    109109                $blocking_transport[] = &$working_transport['fopen'];
    110             } else if ( true === WP_Http_Fsockopen::test($args) ) {
    111                 $working_transport['fsockopen'] = new WP_Http_Fsockopen();
    112                 $blocking_transport[] = &$working_transport['fsockopen'];
     110            } else if ( true === WP_Http_Curl::test($args) ) {
     111                $working_transport['curl'] = new WP_Http_Curl();
     112                $blocking_transport[] = &$working_transport['curl'];
    113113            }
    114114
     
    150150                $working_transport['exthttp'] = new WP_Http_ExtHttp();
    151151                $blocking_transport[] = &$working_transport['exthttp'];
     152            } else if ( true === WP_Http_Fsockopen::test($args) ) {
     153                $working_transport['fsockopen'] = new WP_Http_Fsockopen();
     154                $blocking_transport[] = &$working_transport['fsockopen'];
     155            } else if ( true === WP_Http_Streams::test($args) ) {
     156                $working_transport['streams'] = new WP_Http_Streams();
     157                $blocking_transport[] = &$working_transport['streams'];
    152158            } else if ( true === WP_Http_Curl::test($args) ) {
    153159                $working_transport['curl'] = new WP_Http_Curl();
    154160                $blocking_transport[] = &$working_transport['curl'];
    155             } else if ( true === WP_Http_Streams::test($args) ) {
    156                 $working_transport['streams'] = new WP_Http_Streams();
    157                 $blocking_transport[] = &$working_transport['streams'];
    158             } else if ( true === WP_Http_Fsockopen::test($args) ) {
    159                 $working_transport['fsockopen'] = new WP_Http_Fsockopen();
    160                 $blocking_transport[] = &$working_transport['fsockopen'];
    161161            }
    162162
     
    240240
    241241        if ( $this->block_request( $url ) )
    242             return new WP_Error('http_request_failed', __('User has blocked requests through HTTP.'));
     242            return new WP_Error('http_request_failed', 'User has blocked requests through HTTP.');
    243243
    244244        // Determine if this is a https call and pass that on to the transport functions
  • branches/2.8/wp-includes/js/tinymce/wp-tinymce.php

    r11698 r11553  
    99
    1010    if ( ! $path || ! @is_file($path) )
    11         return false;
     11        return '';
    1212
    1313    return @file_get_contents($path);
     
    2121header("Cache-Control: public, max-age=$expires_offset");
    2222
    23 if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
     23if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) {
    2424    header('Content-Encoding: gzip');
    25     echo $file;
     25    echo get_file($basepath . '/wp-tinymce.js.gz');
    2626} else {
    2727    echo get_file($basepath . '/wp-tinymce.js');
  • branches/2.8/wp-includes/kses.php

    r11698 r11553  
    120120        'h1' => array(
    121121            'align' => array (),
    122             'class' => array (),
    123             'id'    => array (),
    124             'style' => array ()),
    125         'h2' => array (
    126             'align' => array (),
    127             'class' => array (),
    128             'id'    => array (),
    129             'style' => array ()),
    130         'h3' => array (
    131             'align' => array (),
    132             'class' => array (),
    133             'id'    => array (),
    134             'style' => array ()),
    135         'h4' => array (
    136             'align' => array (),
    137             'class' => array (),
    138             'id'    => array (),
    139             'style' => array ()),
    140         'h5' => array (
    141             'align' => array (),
    142             'class' => array (),
    143             'id'    => array (),
    144             'style' => array ()),
    145         'h6' => array (
    146             'align' => array (),
    147             'class' => array (),
    148             'id'    => array (),
    149             'style' => array ()),
    150         'hr' => array (
     122            'class' => array ()),
     123        'h2' => array(
     124            'align' => array (),
     125            'class' => array ()),
     126        'h3' => array(
     127            'align' => array (),
     128            'class' => array ()),
     129        'h4' => array(
     130            'align' => array (),
     131            'class' => array ()),
     132        'h5' => array(
     133            'align' => array (),
     134            'class' => array ()),
     135        'h6' => array(
     136            'align' => array (),
     137            'class' => array ()),
     138        'hr' => array(
    151139            'align' => array (),
    152140            'class' => array (),
     
    534522                }
    535523
    536             if ( $arreach['name'] == 'style' ) {
    537                 $orig_value = $arreach['value'];
    538 
    539                 $value = safecss_filter_attr($orig_value);
    540 
    541                 if ( empty($value) )
    542                     continue;
    543 
    544                 $arreach['value'] = $value;
    545 
    546                 $arreach['whole'] = str_replace($orig_value, $value, $arreach['whole']);
    547             }
    548 
    549524            if ($ok)
    550525                $attr2 .= ' '.$arreach['whole']; # it passed them
     
    11481123add_action('init', 'kses_init');
    11491124add_action('set_current_user', 'kses_init');
    1150 
    1151 function safecss_filter_attr( $css, $deprecated = '' ) {
    1152     $css = wp_kses_no_null($css);
    1153     $css = str_replace(array("\n","\r","\t"), '', $css);
    1154 
    1155     if ( preg_match( '%[\\(&]|/\*%', $css ) ) // remove any inline css containing \ ( & or comments
    1156         return '';
    1157 
    1158     $css_array = split( ';', trim( $css ) );
    1159     $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float',
    1160     'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color',
    1161     'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left',
    1162     'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color',
    1163     'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top',
    1164     'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side',
    1165     'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style',
    1166     'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom',
    1167     'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom',
    1168     'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align',
    1169     'width' ) );
    1170 
    1171     if ( empty($allowed_attr) )
    1172         return $css;
    1173 
    1174     $css = '';
    1175     foreach ( $css_array as $css_item ) {
    1176         if ( $css_item == '' )
    1177             continue;
    1178         $css_item = trim( $css_item );
    1179         $found = false;
    1180         if ( strpos( $css_item, ':' ) === false ) {
    1181             $found = true;
    1182         } else {
    1183             $parts = split( ':', $css_item );
    1184             if ( in_array( trim( $parts[0] ), $allowed_attr ) )
    1185                 $found = true;
    1186         }
    1187         if ( $found ) {
    1188             if( $css != '' )
    1189                 $css .= ';';
    1190             $css .= $css_item;
    1191         }
    1192     }
    1193 
    1194     return $css;
    1195 }
     1125?>
  • branches/2.8/wp-includes/l10n.php

    r11698 r11553  
    302302
    303303/**
    304  * Loads a MO file into the domain $domain.
    305  *
    306  * If the domain already exists, the translations will be merged. If both
    307  * sets have the same string, the translation from the original value will be taken.
     304 * Loads MO file into the list of domains.
     305 *
     306 * If the domain already exists, the inclusion will fail. If the MO file is not
     307 * readable, the inclusion will fail.
    308308 *
    309309 * On success, the .mo file will be placed in the $l10n global by $domain
    310  * and will be a MO object.
     310 * and will be an gettext_reader object.
    311311 *
    312312 * @since 1.5.0
    313  * @uses $l10n Gets list of domain translated string objects
     313 * @uses $l10n Gets list of domain translated string (gettext_reader) objects
     314 * @uses CacheFileReader Reads the MO file
     315 * @uses gettext_reader Allows for retrieving translated strings
    314316 *
    315317 * @param string $domain Unique identifier for retrieving translated strings
    316318 * @param string $mofile Path to the .mo file
    317  * @return bool true on success, false on failure
     319 * @return null On failure returns null and also on success returns nothing.
    318320 */
    319321function load_textdomain($domain, $mofile) {
    320322    global $l10n;
    321323
    322     if ( !is_readable( $mofile ) ) return false;
     324    if ( !is_readable($mofile)) return;
    323325
    324326    $mo = new MO();
    325     if ( !$mo->import_from_file( $mofile ) ) return false;
    326 
    327     if ( isset( $l10n[$domain] ) )
     327    $mo->import_from_file( $mofile );
     328
     329    if (isset($l10n[$domain]))
    328330        $mo->merge_with( $l10n[$domain] );
    329331
    330332    $l10n[$domain] = &$mo;
    331     return true;
    332333}
    333334
     
    345346    $mofile = WP_LANG_DIR . "/$locale.mo";
    346347
    347     return load_textdomain('default', $mofile);
     348    load_textdomain('default', $mofile);
    348349}
    349350
     
    372373
    373374    $mofile = $path . '/'. $domain . '-' . $locale . '.mo';
    374     return load_textdomain($domain, $mofile);
     375    load_textdomain($domain, $mofile);
    375376}
    376377
     
    393394
    394395    $mofile = "$path/$locale.mo";
    395     return load_textdomain($domain, $mofile);
     396    load_textdomain($domain, $mofile);
    396397}
    397398
     
    423424 */
    424425function translate_user_role( $name ) {
    425     return translate_with_gettext_context( before_last_bar($name), 'User role' );
     426    return before_last_bar( translate_with_gettext_context( $name, 'User role' ) );
    426427}
    427428?>
  • branches/2.8/wp-includes/link-template.php

    r11698 r11553  
    16941694    $orig_scheme = $scheme;
    16951695    if ( !in_array($scheme, array('http', 'https')) ) {
    1696         if ( ( 'login_post' == $scheme || 'rpc' == $scheme ) && ( force_ssl_login() || force_ssl_admin() ) )
     1696        if ( ('login_post' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) )
    16971697            $scheme = 'https';
    16981698        elseif ( ('login' == $scheme) && ( force_ssl_admin() ) )
  • branches/2.8/wp-includes/pluggable.php

    r11698 r11553  
    881881
    882882    // remove %0d and %0a from location
    883     $strip = array('%0d', '%0a', '%0D', '%0A');
    884     $location = _deep_replace($strip, $location);
     883    $strip = array('%0d', '%0a');
     884    $found = true;
     885    while($found) {
     886        $found = false;
     887        foreach( (array) $strip as $val ) {
     888            while(strpos($location, $val) !== false) {
     889                $found = true;
     890                $location = str_replace($val, '', $location);
     891            }
     892        }
     893    }
    885894    return $location;
    886895}
     
    900909 *
    901910 * @since 2.3
    902  * @uses wp_validate_redirect() To validate the redirect is to an allowed host.
     911 * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing
     912 *      WordPress host string and $location host string.
    903913 *
    904914 * @return void Does not return anything
     
    909919    $location = wp_sanitize_redirect($location);
    910920
    911     $location = wp_validate_redirect($location, admin_url());
    912 
    913     wp_redirect($location, $status);
    914 }
    915 endif;
    916 
    917 if ( !function_exists('wp_validate_redirect') ) :
    918 /**
    919  * Validates a URL for use in a redirect.
    920  *
    921  * Checks whether the $location is using an allowed host, if it has an absolute
    922  * path. A plugin can therefore set or remove allowed host(s) to or from the
    923  * list.
    924  *
    925  * If the host is not allowed, then the redirect is to $default supplied
    926  *
    927  * @since 2.8.1
    928  * @uses apply_filters() Calls 'allowed_redirect_hosts' on an array containing
    929  *      WordPress host string and $location host string.
    930  *
    931  * @param string $location The redirect to validate
    932  * @param string $default The value to return is $location is not allowed
    933  * @return string redirect-sanitized URL
    934  **/
    935 function wp_validate_redirect($location, $default = '') {
    936921    // browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'
    937922    if ( substr($location, 0, 2) == '//' )
     
    947932
    948933    if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
    949         $location = $default;
    950 
    951     return $location;
     934        $location = admin_url();
     935
     936    wp_redirect($location, $status);
    952937}
    953938endif;
  • branches/2.8/wp-includes/plugin.php

    r11698 r11553  
    5454 * @since 0.71
    5555 * @global array $wp_filter Stores all of the filters added in the form of
    56  *  wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)']']
     56 *  wp_filter['tag']['array of priorities']['array of functions serialized']['array of ['array (functions, accepted_args)]']
    5757 * @global array $merged_filters Tracks the tags that need to be merged for later. If the hook is added, it doesn't need to run through that process.
    5858 *
     
    496496    $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash
    497497    $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir
    498     $file = trim($file, '/');
    499498    return $file;
    500499}
  • branches/2.8/wp-includes/pomo/entry.php

    r11698 r11553  
    33 * Contains Translation_Entry class
    44 *
    5  * @version $Id: entry.php 115 2009-05-11 18:56:15Z nbachiyski $
     5 * @version $Id: entry.php 13 2008-04-21 12:03:37Z nbachiyski $
    66 * @package pomo
    77 * @subpackage entry
     
    4949        $object_varnames = array_keys(get_object_vars($this));
    5050        foreach ($args as $varname => $value) {
    51             $this->$varname = $value;
     51            if (in_array($varname, $object_varnames)) {
     52                $this->$varname = $value;
     53            }
    5254        }
    5355        if (isset($args['plural'])) $this->is_plural = true;
  • branches/2.8/wp-includes/pomo/mo.php

    r11698 r11553  
    33 * Class for working with MO files
    44 *
    5  * @version $Id: mo.php 106 2009-04-23 19:48:22Z nbachiyski $
     5 * @version $Id: mo.php 33 2009-02-16 09:33:39Z nbachiyski $
    66 * @package pomo
    77 * @subpackage mo
     
    1111require_once dirname(__FILE__) . '/streams.php';
    1212
    13 class MO extends Gettext_Translations {
     13class MO extends Translations {
    1414
    1515    var $_nplurals = 2;
     16
     17    function set_header($header, $value) {
     18        parent::set_header($header, $value);
     19        if ('Plural-Forms' == $header)
     20            $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($value);
     21    }
    1622
    1723    /**
     
    2733        return $this->import_from_reader($reader);
    2834    }
    29    
    30     function export_to_file($filename) {
    31         $fh = fopen($filename, 'wb');
    32         if ( !$fh ) return false;
    33         $entries = array_filter($this->entries, create_function('$e', 'return !empty($e->translations);'));
    34         ksort($entries);
    35         $magic = 0x950412de;
    36         $revision = 0;
    37         $total = count($entries) + 1; // all the headers are one entry
    38         $originals_lenghts_addr = 28;
    39         $translations_lenghts_addr = $originals_lenghts_addr + 8 * $total;
    40         $size_of_hash = 0;
    41         $hash_addr = $translations_lenghts_addr + 8 * $total;
    42         $current_addr = $hash_addr;
    43         fwrite($fh, pack('V*', $magic, $revision, $total, $originals_lenghts_addr,
    44             $translations_lenghts_addr, $size_of_hash, $hash_addr));
    45         fseek($fh, $originals_lenghts_addr);
    46        
    47         // headers' msgid is an empty string
    48         fwrite($fh, pack('VV', 0, $current_addr));
    49         $current_addr++;
    50         $originals_table = chr(0);
    51 
    52         foreach($entries as $entry) {
    53             $originals_table .= $this->export_original($entry) . chr(0);
    54             $length = strlen($this->export_original($entry));
    55             fwrite($fh, pack('VV', $length, $current_addr));
    56             $current_addr += $length + 1; // account for the NULL byte after
    57         }
    58        
    59         $exported_headers = $this->export_headers();
    60         fwrite($fh, pack('VV', strlen($exported_headers), $current_addr));
    61         $current_addr += strlen($exported_headers) + 1;
    62         $translations_table = $exported_headers . chr(0);
    63        
    64         foreach($entries as $entry) {
    65             $translations_table .= $this->export_translations($entry) . chr(0);
    66             $length = strlen($this->export_translations($entry));
    67             fwrite($fh, pack('VV', $length, $current_addr));
    68             $current_addr += $length + 1;
    69         }
    70        
    71         fwrite($fh, $originals_table);
    72         fwrite($fh, $translations_table);
    73         fclose($fh);
    74     }
    75    
    76     function export_original($entry) {
    77         //TODO: warnings for control characters
    78         $exported = $entry->singular;
    79         if ($entry->is_plural) $exported .= chr(0).$entry->plural;
    80         if (!is_null($entry->context)) $exported = $entry->context . chr(4) . $exported;
    81         return $exported;
    82     }
    83    
    84     function export_translations($entry) {
    85         //TODO: warnings for control characters
    86         return implode(chr(0), $entry->translations);
    87     }
    88    
    89     function export_headers() {
    90         $exported = '';
    91         foreach($this->headers as $header => $value) {
    92             $exported.= "$header: $value\n";
    93         }
    94         return $exported;
    95     }
    9635
    9736    function get_byteorder($magic) {
     
    10443        // 0xde120495
    10544        $magic_big = ((int) - 569244523) && 0xFFFFFFFF;
    106        
     45
    10746        if ($magic_little == $magic || $magic_little_64 == $magic) {
    10847            return 'little';
     
    12564        $total = $reader->readint32();
    12665        // get addresses of array of lenghts and offsets for original string and translations
    127         $originals_lenghts_addr = $reader->readint32();
    128         $translations_lenghts_addr = $reader->readint32();
     66        $originals_lo_addr = $reader->readint32();
     67        $translations_lo_addr = $reader->readint32();
    12968
    130         $reader->seekto($originals_lenghts_addr);
    131         $originals_lenghts = $reader->readint32array($total * 2); // each of
    132         $reader->seekto($translations_lenghts_addr);
    133         $translations_lenghts = $reader->readint32array($total * 2);
     69        $reader->seekto($originals_lo_addr);
     70        $originals_lo = $reader->readint32array($total * 2); // each of
     71        $reader->seekto($translations_lo_addr);
     72        $translations_lo = $reader->readint32array($total * 2);
    13473
    13574        $length = create_function('$i', 'return $i * 2 + 1;');
     
    13776
    13877        for ($i = 0; $i < $total; ++$i) {
    139             $reader->seekto($originals_lenghts[$offset($i)]);
    140             $original = $reader->read($originals_lenghts[$length($i)]);
    141             $reader->seekto($translations_lenghts[$offset($i)]);
    142             $translation = $reader->read($translations_lenghts[$length($i)]);
     78            $reader->seekto($originals_lo[$offset($i)]);
     79            $original = $reader->read($originals_lo[$length($i)]);
     80            $reader->seekto($translations_lo[$offset($i)]);
     81            $translation = $reader->read($translations_lo[$length($i)]);
    14382            if ('' == $original) {
    14483                $this->set_headers($this->make_headers($translation));
     
    14887        }
    14988        return true;
     89    }
     90
     91    function make_headers($translation) {
     92        $headers = array();
     93        $lines = explode("\n", $translation);
     94        foreach($lines as $line) {
     95            $parts = explode(':', $line, 2);
     96            if (!isset($parts[1])) continue;
     97            $headers[trim($parts[0])] = trim($parts[1]);
     98        }
     99        return $headers;
    150100    }
    151101
  • branches/2.8/wp-includes/pomo/po.php

    r11698 r11553  
    33 * Class for working with PO files
    44 *
    5  * @version $Id: po.php 123 2009-05-13 19:35:43Z nbachiyski $
     5 * @version $Id: po.php 33 2009-02-16 09:33:39Z nbachiyski $
    66 * @package pomo
    77 * @subpackage po
     
    1717 * Routines for working with PO files
    1818 */
    19 class PO extends Gettext_Translations {
    20    
     19class PO extends Translations {
     20
    2121
    2222    /**
     
    7676    }
    7777
     78
    7879    /**
    7980     * Formats a string in PO-style
     
    8788        $slash = '\\';
    8889        $newline = "\n";
     90        $tab = "\t";
    8991
    9092        $replaces = array(
    9193            "$slash"    => "$slash$slash",
     94            "$tab"      => '\t',
    9295            "$quote"    => "$slash$quote",
    93             "\t"        => '\t',
    9496        );
    95 
    9697        $string = str_replace(array_keys($replaces), array_values($replaces), $string);
    9798
    98         $po = $quote.implode("${slash}n$quote$newline$quote", explode($newline, $string)).$quote;
     99        $po = array();
     100        foreach (explode($newline, $string) as $line) {
     101            $po[] = wordwrap($line, PO_MAX_LINE_LEN - 2, " $quote$newline$quote");
     102        }
     103        $po = $quote.implode("${slash}n$quote$newline$quote", $po).$quote;
    99104        // add empty string on first line for readbility
    100         if (false !== strpos($string, $newline) &&
    101                 (substr_count($string, $newline) > 1 || !($newline === substr($string, -strlen($newline))))) {
     105        if (false !== strpos($po, $newline)) {
    102106            $po = "$quote$quote$newline$po";
    103107        }
     
    106110        return $po;
    107111    }
    108    
    109     /**
    110      * Gives back the original string from a PO-formatted string
    111      *
    112      * @static
    113      * @param string $string PO-formatted string
    114      * @return string enascaped string
    115      */
    116     function unpoify($string) {
    117         $escapes = array('t' => "\t", 'n' => "\n", '\\' => '\\');
    118         $lines = array_map('trim', explode("\n", $string));
    119         $lines = array_map(array('PO', 'trim_quotes'), $lines);
    120         $unpoified = '';
    121         $previous_is_backslash = false;
    122         foreach($lines as $line) {
    123             preg_match_all('/./u', $line, $chars);
    124             $chars = $chars[0];
    125             foreach($chars as $char) {
    126                 if (!$previous_is_backslash) {
    127                     if ('\\' == $char)
    128                         $previous_is_backslash = true;
    129                     else
    130                         $unpoified .= $char;
    131                 } else {
    132                     $previous_is_backslash = false;
    133                     $unpoified .= isset($escapes[$char])? $escapes[$char] : $char;
    134                 }
    135             }
    136         }
    137         return $unpoified;
    138     }
    139112
    140113    /**
    141      * Inserts $with in the beginning of every new line of $string and 
     114     * Inserts $with in the beginning of every new line of $string and
    142115     * returns the modified string
    143116     *
     
    185158        if (!empty($entry->extracted_comments)) $po[] = PO::comment_block($entry->extracted_comments, '.');
    186159        if (!empty($entry->references)) $po[] = PO::comment_block(implode(' ', $entry->references), ':');
    187         if (!empty($entry->flags)) $po[] = PO::comment_block(implode(", ", $entry->flags), ',');
     160        if (!empty($entry->flags)) $po[] = PO::comment_block(implode("\n", $entry->flags), ',');
    188161        if (!is_null($entry->context)) $po[] = 'msgctxt '.PO::poify($entry->context);
    189162        $po[] = 'msgid '.PO::poify($entry->singular);
     
    201174    }
    202175
    203     function import_from_file($filename) {
    204         $f = fopen($filename, 'r');
    205         if (!$f) return false;
    206         $lineno = 0;
    207         while (true) {
    208             $res = $this->read_entry($f, $lineno);
    209             if (!$res) break;
    210             if ($res['entry']->singular == '') {
    211                 $this->set_headers($this->make_headers($res['entry']->translations[0]));
    212             } else {
    213                 $this->add_entry($res['entry']);
    214             }
    215         }
    216         PO::read_line($f, 'clear');
    217         return $res !== false;
    218     }
    219    
    220     function read_entry($f, $lineno = 0) {
    221         $entry = new Translation_Entry();
    222         // where were we in the last step
    223         // can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural
    224         $context = '';
    225         $msgstr_index = 0;
    226         $is_final = create_function('$context', 'return $context == "msgstr" || $context == "msgstr_plural";');
    227         while (true) {
    228             $lineno++;
    229             $line = PO::read_line($f);
    230             if (!$line)  {
    231                 if (feof($f)) {
    232                     if ($is_final($context))
    233                         break;
    234                     elseif (!$context) // we haven't read a line and eof came
    235                         return null;
    236                     else
    237                         return false;
    238                 } else {
    239                     return false;
    240                 }
    241             }
    242             if ($line == "\n") continue;
    243             $line = trim($line);
    244             if (preg_match('/^#/', $line, $m)) {
    245                 // the comment is the start of a new entry
    246                 if ($is_final($context)) {
    247                     PO::read_line($f, 'put-back');
    248                     $lineno--;
    249                     break;
    250                 }
    251                 // comments have to be at the beginning
    252                 if ($context && $context != 'comment') {
    253                     return false;
    254                 }
    255                 // add comment
    256                 $this->add_comment_to_entry($entry, $line);;
    257             } elseif (preg_match('/^msgctxt\s+(".*")/', $line, $m)) {
    258                 if ($is_final($context)) {
    259                     PO::read_line($f, 'put-back');
    260                     $lineno--;
    261                     break;
    262                 }
    263                 if ($context && $context != 'comment') {
    264                     return false;
    265                 }
    266                 $context = 'msgctxt';
    267                 $entry->context .= PO::unpoify($m[1]);
    268             } elseif (preg_match('/^msgid\s+(".*")/', $line, $m)) {
    269                 if ($is_final($context)) {
    270                     PO::read_line($f, 'put-back');
    271                     $lineno--;
    272                     break;
    273                 }
    274                 if ($context && $context != 'msgctxt' && $context != 'comment') {
    275                     return false;
    276                 }
    277                 $context = 'msgid';
    278                 $entry->singular .= PO::unpoify($m[1]);
    279             } elseif (preg_match('/^msgid_plural\s+(".*")/', $line, $m)) {
    280                 if ($context != 'msgid') {
    281                     return false;
    282                 }
    283                 $context = 'msgid_plural';
    284                 $entry->is_plural = true;
    285                 $entry->plural .= PO::unpoify($m[1]);
    286             } elseif (preg_match('/^msgstr\s+(".*")/', $line, $m)) {
    287                 if ($context != 'msgid') {
    288                     return false;
    289                 }
    290                 $context = 'msgstr';
    291                 $entry->translations = array(PO::unpoify($m[1]));
    292             } elseif (preg_match('/^msgstr\[(\d+)\]\s+(".*")/', $line, $m)) {
    293                 if ($context != 'msgid_plural' && $context != 'msgstr_plural') {
    294                     return false;
    295                 }
    296                 $context = 'msgstr_plural';
    297                 $msgstr_index = $m[1];
    298                 $entry->translations[$m[1]] = PO::unpoify($m[2]);
    299             } elseif (preg_match('/^".*"$/', $line)) {
    300                 $unpoified = PO::unpoify($line);
    301                 switch ($context) {
    302                     case 'msgid':
    303                         $entry->singular .= $unpoified; break;
    304                     case 'msgctxt':
    305                         $entry->context .= $unpoified; break;
    306                     case 'msgid_plural':
    307                         $entry->plural .= $unpoified; break;
    308                     case 'msgstr':
    309                         $entry->translations[0] .= $unpoified; break;
    310                     case 'msgstr_plural':
    311                         $entry->translations[$msgstr_index] .= $unpoified; break;
    312                     default:
    313                         return false;
    314                 }
    315             } else {
    316                 return false;
    317             }
    318         }
    319         if (array() == array_filter($entry->translations)) $entry->translations = array();
    320         return array('entry' => $entry, 'lineno' => $lineno);
    321     }
    322    
    323     function read_line($f, $action = 'read') {
    324         static $last_line = '';
    325         static $use_last_line = false;
    326         if ('clear' == $action) {
    327             $last_line = '';
    328             return true;
    329         }
    330         if ('put-back' == $action) {
    331             $use_last_line = true;
    332             return true;
    333         }
    334         $line = $use_last_line? $last_line : fgets($f);
    335         $last_line = $line;
    336         $use_last_line = false;
    337         return $line;
    338     }
    339    
    340     function add_comment_to_entry(&$entry, $po_comment_line) {
    341         $first_two = substr($po_comment_line, 0, 2);
    342         $comment = trim(substr($po_comment_line, 2));
    343         if ('#:' == $first_two) {
    344             $entry->references = array_merge($entry->references, preg_split('/\s+/', $comment));
    345         } elseif ('#.' == $first_two) {
    346             $entry->extracted_comments = trim($entry->extracted_comments . "\n" . $comment);
    347         } elseif ('#,' == $first_two) {
    348             $entry->flags = array_merge($entry->flags, preg_split('/,\s*/', $comment));
    349         } else {
    350             $entry->translator_comments = trim($entry->translator_comments . "\n" . $comment);
    351         }
    352     }
    353    
    354     function trim_quotes($s) {
    355         if ( substr($s, 0, 1) == '"') $s = substr($s, 1);
    356         if ( substr($s, -1, 1) == '"') $s = substr($s, 0, -1);
    357         return $s;
    358     }
    359176}
    360177?>
  • branches/2.8/wp-includes/pomo/streams.php

    r11698 r11553  
    44 * Based on the classes from Danilo Segan <danilo@kvota.net>
    55 *
    6  * @version $Id: streams.php 138 2009-06-23 13:22:09Z nbachiyski $
     6 * @version $Id: streams.php 33 2009-02-16 09:33:39Z nbachiyski $
    77 * @package pomo
    88 * @subpackage streams
     
    1818  var $_str;
    1919
    20     function POMO_StringReader($str = '') {
    21         $this->_str = $str;
    22         $this->_pos = 0;
    23         $this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr');
    24     }
     20  function POMO_StringReader($str = '') {
     21    $this->_str = $str;
     22    $this->_pos = 0;
     23  }
    2524
    26     function _substr($string, $start, $length) {
    27         if ($this->is_overloaded) {
    28             return mb_substr($string,$start,$length,'ascii');
    29         } else {
    30             return substr($string,$start,$length);
    31         }
    32     }
    33    
    34     function _strlen($string) {
    35         if ($this->is_overloaded) {
    36             return mb_strlen($string,'ascii');
    37         } else {
    38             return strlen($string);
    39         }
    40     }
     25  function read($bytes) {
     26    $data = substr($this->_str, $this->_pos, $bytes);
     27    $this->_pos += $bytes;
     28    if (strlen($this->_str)<$this->_pos)
     29      $this->_pos = strlen($this->_str);
    4130
    42     function read($bytes) {
    43         $data = $this->_substr($this->_str, $this->_pos, $bytes);
    44         $this->_pos += $bytes;
    45         if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str);
    46         return $data;
    47     }
     31    return $data;
     32  }
    4833
    49     function seekto($pos) {
    50         $this->_pos = $pos;
    51         if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str);
    52         return $this->_pos;
    53     }
     34  function seekto($pos) {
     35    $this->_pos = $pos;
     36    if (strlen($this->_str)<$this->_pos)
     37      $this->_pos = strlen($this->_str);
     38    return $this->_pos;
     39  }
    5440
    55     function pos() {
    56         return $this->_pos;
    57     }
     41  function pos() {
     42    return $this->_pos;
     43  }
    5844
    59     function length() {
    60         return $this->_strlen($this->_str);
    61     }
     45  function length() {
     46    return strlen($this->_str);
     47  }
    6248
    6349}
     
    6854class POMO_CachedFileReader extends POMO_StringReader {
    6955    function POMO_CachedFileReader($filename) {
    70         parent::POMO_StringReader();
    7156        $this->_str = file_get_contents($filename);
    7257        if (false === $this->_str)
    7358            return false;
    74         $this->_pos = 0;
     59        $this->pos = 0;
    7560    }
    7661}
     
    11297    function readint32() {
    11398        $bytes = $this->read(4);
    114         if (4 != $this->_strlen($bytes))
     99        if (4 != strlen($bytes))
    115100            return false;
    116101        $endian_letter = ('big' == $this->endian)? 'N' : 'V';
     
    128113    function readint32array($count) {
    129114        $bytes = $this->read(4 * $count);
    130         if (4*$count != $this->_strlen($bytes))
     115        if (4*$count != strlen($bytes))
    131116            return false;
    132117        $endian_letter = ('big' == $this->endian)? 'N' : 'V';
  • branches/2.8/wp-includes/pomo/translations.php

    r11698 r11553  
    33 * Class for a set of entries for translation and their associated headers
    44 *
    5  * @version $Id: translations.php 114 2009-05-11 17:30:38Z nbachiyski $
     5 * @version $Id: translations.php 35 2009-02-16 12:54:57Z nbachiyski $
    66 * @package pomo
    77 * @subpackage translations
     
    2020     * @return bool true on success, false if the entry doesn't have a key
    2121     */
    22     function add_entry($entry) {
    23         if (is_array($entry)) {
    24             $entry = new Translation_Entry($entry);
    25         }
     22    function add_entry(&$entry) {
    2623        $key = $entry->key();
    2724        if (false === $key) return false;
    28         $this->entries[$key] = $entry;
     25        $this->entries[$key] = &$entry;
    2926        return true;
    3027    }
     
    9188        if ($translated && 0 <= $index && $index < $total_plural_forms &&
    9289                is_array($translated->translations) &&
    93                 isset($translated->translations[$index]))
     90                count($translated->translations) == $total_plural_forms)
    9491            return $translated->translations[$index];
    9592        else
     
    9794    }
    9895
    99     /**
    100      * Merge $other in the current object.
    101      *
    102      * @param Object &$other Another Translation object, whose translations will be merged in this one
    103      * @return void
    104      **/
    105     function merge_with(&$other) {
    106         $this->entries = array_merge($this->entries, $other->entries);
    107     }
    108 }
    109 
    110 class Gettext_Translations extends Translations {
    11196    /**
    11297     * The gettext implmentation of select_plural_form.
     
    146131     * Adds parantheses to the inner parts of ternary operators in
    147132     * plural expressions, because PHP evaluates ternary oerators from left to right
    148      * 
     133     *
    149134     * @param string $expression the expression without parentheses
    150135     * @return string the expression with parentheses added
     
    174159        return rtrim($res, ';');
    175160    }
    176    
    177     function make_headers($translation) {
    178         $headers = array();
    179         // sometimes \ns are used instead of real new lines
    180         $translation = str_replace('\n', "\n", $translation);
    181         $lines = explode("\n", $translation);
    182         foreach($lines as $line) {
    183             $parts = explode(':', $line, 2);
    184             if (!isset($parts[1])) continue;
    185             $headers[trim($parts[0])] = trim($parts[1]);
    186         }
    187         return $headers;
     161
     162    /**
     163     * Merge $other in the current object.
     164     *
     165     * @param Object &$other Another Translation object, whose translations will be merged in this one
     166     * @return void
     167     **/
     168    function merge_with(&$other) {
     169        $this->entries = array_merge($this->entries, $other->entries);
    188170    }
    189 
    190     function set_header($header, $value) {
    191         parent::set_header($header, $value);
    192         if ('Plural-Forms' == $header)
    193             $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($value);
    194     }
    195 
    196    
    197171}
    198172
  • branches/2.8/wp-includes/post-template.php

    r11698 r11553  
    431431            $classes[] = 'page-parent';
    432432
    433         if ( $wp_query->post->post_parent ) {
     433        if ( $wp_query->post->post_parent )
    434434            $classes[] = 'page-child';
    435435            $classes[] = 'parent-pageid-' . $wp_query->post->post_parent;
    436         }
    437         if ( is_page_template() ) {
     436
     437        if ( is_page_template() )
    438438            $classes[] = 'page-template';
    439439            $classes[] = 'page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) );
    440         }
    441440    } elseif ( is_search() ) {
    442441        if ( !empty($wp_query->posts) )
     
    807806 */
    808807function wp_page_menu( $args = array() ) {
    809     $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
     808    $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
    810809    $args = wp_parse_args( $args, $defaults );
    811810    $args = apply_filters( 'wp_page_menu_args', $args );
  • branches/2.8/wp-includes/post.php

    r11698 r11553  
    11931193            clean_page_cache($child->ID);
    11941194
    1195         $wp_rewrite->flush_rules(false);
     1195        $wp_rewrite->flush_rules();
    11961196    } else {
    11971197        clean_post_cache($postid);
     
    33553355        if ( !defined('WP_IMPORTING') ) {
    33563356            global $wp_rewrite;
    3357             $wp_rewrite->flush_rules(false);
     3357            $wp_rewrite->flush_rules();
    33583358        }
    33593359    } else {
  • branches/2.8/wp-includes/query.php

    r11698 r11553  
    12351235        $qv['w'] = absint($qv['w']);
    12361236        $qv['m'] = absint($qv['m']);
    1237         $qv['paged'] = absint($qv['paged']);
    12381237        $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
    12391238        $qv['pagename'] = trim( $qv['pagename'] );
  • branches/2.8/wp-includes/rewrite.php

    r11698 r11553  
    18231823     * @since 2.0.1
    18241824     * @access public
    1825      * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard).
    1826      */
    1827     function flush_rules($hard = true) {
     1825     */
     1826    function flush_rules() {
    18281827        delete_transient('rewrite_rules');
    18291828        $this->wp_rewrite_rules();
    1830         if ( $hard && function_exists('save_mod_rewrite_rules') )
     1829        if ( function_exists('save_mod_rewrite_rules') )
    18311830            save_mod_rewrite_rules();
    1832         if ( $hard && function_exists('iis7_save_url_rewrite_rules') )
     1831        if ( function_exists('iis7_save_url_rewrite_rules') )
    18331832            iis7_save_url_rewrite_rules();
    18341833    }
  • branches/2.8/wp-includes/script-loader.php

    r11698 r11553  
    241241        $scripts->add_data( 'user-profile', 'group', 1 );
    242242
    243         $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090627' );
     243        $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090209' );
    244244        $scripts->add_data( 'admin-comments', 'group', 1 );
    245245        $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
     
    250250        $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", false, '3517m' );
    251251
    252         $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090618' );
     252        $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090327' );
    253253        $scripts->add_data( 'postbox', 'group', 1 );
    254254        $scripts->localize( 'postbox', 'postboxL10n', array(
     
    265265        ) );
    266266
    267         $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'slug'), '20090624' );
     267        $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'slug'), '20090526' );
    268268        $scripts->add_data( 'post', 'group', 1 );
    269269        $scripts->localize( 'post', 'postL10n', array(
     
    378378        $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
    379379
    380         $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090618' );
     380        $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090201' );
    381381        $scripts->add_data( 'dashboard', 'group', 1 );
    382382
     
    422422
    423423    // all colors stylesheets need to have the same query strings (cache manifest compat)
    424     $colors_version = '20090625';
    425 
    426     $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090625' );
     424    $colors_version = '20090610';
     425
     426    $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090610' );
    427427    $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' );
    428428
    429     $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090630' );
     429    $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090514' );
    430430    $styles->add_data( 'ie', 'conditional', 'lte IE 7' );
    431431
     
    439439    $styles->add_data( 'colors-classic', 'rtl', true );
    440440
    441     $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090630' );
     441    $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090514' );
    442442    $styles->add( 'media', '/wp-admin/css/media.css', array(), '20090516' );
    443443    $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20090603' );
    444444    $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20090514' );
    445445    $styles->add( 'install', '/wp-admin/css/install.css', array(), '20090514' );
    446     $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css', array(), '20090625' );
     446    $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css', array(), '20090514' );
    447447    $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20090514' );
    448448    $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
  • branches/2.8/wp-includes/update.php

    r11698 r11553  
    116116    $new_option = new stdClass;
    117117    $new_option->last_checked = time();
    118     $timeout = 'load-plugins.php' == current_filter() ? 3600 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
     118    $timeout = 'load-plugins.php' == current_filter() ? 360 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
    119119    $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
    120120
     
    199199    $new_option = new stdClass;
    200200    $new_option->last_checked = time( );
    201     $timeout = 'load-themes.php' == current_filter() ? 3600 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
     201    $timeout = 'load-themes.php' == current_filter() ? 360 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
    202202    $time_not_changed = isset( $current_theme->last_checked ) && $timeout > ( time( ) - $current_theme->last_checked );
    203203
  • branches/2.8/wp-includes/version.php

    r11698 r11553  
    99 * @global string $wp_version
    1010 */
    11 $wp_version = '2.8.1-RC1';
     11$wp_version = '2.8.1-rare';
    1212
    1313/**
     
    3030 * @global string $manifest_version
    3131 */
    32 $manifest_version = '20090616';
     32$manifest_version = '20090610';
  • branches/2.8/wp-includes/widgets.php

    r11698 r11553  
    886886    global $wp_registered_widgets;
    887887
    888     $sidebars_widgets = wp_get_sidebars_widgets();
     888    $sidebars_widgets = wp_get_sidebars_widgets(false);
    889889
    890890    if ( is_array($sidebars_widgets) ) {
     
    936936function is_active_sidebar( $index ) {
    937937    $index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);
    938     $sidebars_widgets = wp_get_sidebars_widgets();
     938    $sidebars_widgets = get_option( 'sidebars_widgets', array() );
    939939    if ( isset($sidebars_widgets[$index]) && !empty($sidebars_widgets[$index]) )
    940940        return true;
     
    954954 * @access private
    955955 *
    956  * @param bool $update Optional, deprecated.
    957  * @return array Upgraded list of widgets to version 3 array format when called from the admin.
    958  */
    959 function wp_get_sidebars_widgets($deprecated = true) {
     956 * @param bool $update Optional, default is true. Whether to save upgrade of widget array list.
     957 * @return array Upgraded list of widgets to version 2 array format.
     958 */
     959function wp_get_sidebars_widgets($update = true) {
    960960    global $wp_registered_widgets, $wp_registered_sidebars, $_wp_sidebars_widgets;
    961961
    962962    // If loading from front page, consult $_wp_sidebars_widgets rather than options
    963963    // to see if wp_convert_widget_settings() has made manipulations in memory.
    964     if ( !is_admin() ) {
     964    if ( is_admin() ) {
     965        $sidebars_widgets = get_option('sidebars_widgets', array());
     966    } else {
    965967        if ( empty($_wp_sidebars_widgets) )
    966             $_wp_sidebars_widgets = get_option('sidebars_widgets', array());
    967 
    968         $sidebars_widgets = $_wp_sidebars_widgets;
    969     } else {
    970         $sidebars_widgets = get_option('sidebars_widgets', array());
    971         $_sidebars_widgets = array();
    972 
    973         if ( isset($sidebars_widgets['wp_inactive_widgets']) )
    974             $sidebars_widgets['array_version'] = 3;
    975         elseif ( !isset($sidebars_widgets['array_version']) )
    976             $sidebars_widgets['array_version'] = 1;
    977 
    978         switch ( $sidebars_widgets['array_version'] ) {
    979             case 1 :
    980                 foreach ( (array) $sidebars_widgets as $index => $sidebar )
    981                 if ( is_array($sidebar) )
    982                 foreach ( (array) $sidebar as $i => $name ) {
    983                     $id = strtolower($name);
    984                     if ( isset($wp_registered_widgets[$id]) ) {
    985                         $_sidebars_widgets[$index][$i] = $id;
    986                         continue;
     968            $sidebars_widgets = get_option('sidebars_widgets', array());
     969        else
     970            $sidebars_widgets = &$_wp_sidebars_widgets;
     971    }
     972    $_sidebars_widgets = array();
     973
     974    if ( !isset($sidebars_widgets['array_version']) )
     975        $sidebars_widgets['array_version'] = 1;
     976
     977    switch ( $sidebars_widgets['array_version'] ) {
     978        case 1 :
     979            foreach ( (array) $sidebars_widgets as $index => $sidebar )
     980            if ( is_array($sidebar) )
     981            foreach ( (array) $sidebar as $i => $name ) {
     982                $id = strtolower($name);
     983                if ( isset($wp_registered_widgets[$id]) ) {
     984                    $_sidebars_widgets[$index][$i] = $id;
     985                    continue;
     986                }
     987                $id = sanitize_title($name);
     988                if ( isset($wp_registered_widgets[$id]) ) {
     989                    $_sidebars_widgets[$index][$i] = $id;
     990                    continue;
     991                }
     992
     993                $found = false;
     994
     995                foreach ( $wp_registered_widgets as $widget_id => $widget ) {
     996                    if ( strtolower($widget['name']) == strtolower($name) ) {
     997                        $_sidebars_widgets[$index][$i] = $widget['id'];
     998                        $found = true;
     999                        break;
     1000                    } elseif ( sanitize_title($widget['name']) == sanitize_title($name) ) {
     1001                        $_sidebars_widgets[$index][$i] = $widget['id'];
     1002                        $found = true;
     1003                        break;
    9871004                    }
    988                     $id = sanitize_title($name);
    989                     if ( isset($wp_registered_widgets[$id]) ) {
    990                         $_sidebars_widgets[$index][$i] = $id;
    991                         continue;
     1005                }
     1006
     1007                if ( $found )
     1008                    continue;
     1009
     1010                unset($_sidebars_widgets[$index][$i]);
     1011            }
     1012            $_sidebars_widgets['array_version'] = 2;
     1013            $sidebars_widgets = $_sidebars_widgets;
     1014            unset($_sidebars_widgets);
     1015
     1016        case 2 :
     1017            $sidebars = array_keys( $wp_registered_sidebars );
     1018            if ( !empty( $sidebars ) ) {
     1019                // Move the known-good ones first
     1020                foreach ( (array) $sidebars as $id ) {
     1021                    if ( array_key_exists( $id, $sidebars_widgets ) ) {
     1022                        $_sidebars_widgets[$id] = $sidebars_widgets[$id];
     1023                        unset($sidebars_widgets[$id], $sidebars[$id]);
    9921024                    }
    993 
    994                     $found = false;
    995 
    996                     foreach ( $wp_registered_widgets as $widget_id => $widget ) {
    997                         if ( strtolower($widget['name']) == strtolower($name) ) {
    998                             $_sidebars_widgets[$index][$i] = $widget['id'];
    999                             $found = true;
    1000                             break;
    1001                         } elseif ( sanitize_title($widget['name']) == sanitize_title($name) ) {
    1002                             $_sidebars_widgets[$index][$i] = $widget['id'];
    1003                             $found = true;
    1004                             break;
    1005                         }
    1006                     }
    1007 
    1008                     if ( $found )
    1009                         continue;
    1010 
    1011                     unset($_sidebars_widgets[$index][$i]);
    10121025                }
    1013                 $_sidebars_widgets['array_version'] = 2;
     1026
     1027                // Assign to each unmatched registered sidebar the first available orphan
     1028                unset( $sidebars_widgets[ 'array_version' ] );
     1029                while ( ( $sidebar = array_shift( $sidebars ) ) && $widgets = array_shift( $sidebars_widgets ) )
     1030                    $_sidebars_widgets[ $sidebar ] = $widgets;
     1031
     1032                $_sidebars_widgets['array_version'] = 3;
    10141033                $sidebars_widgets = $_sidebars_widgets;
    10151034                unset($_sidebars_widgets);
    1016 
    1017             case 2 :
    1018                 $sidebars = array_keys( $wp_registered_sidebars );
    1019                 if ( !empty( $sidebars ) ) {
    1020                     // Move the known-good ones first
    1021                     foreach ( (array) $sidebars as $id ) {
    1022                         if ( array_key_exists( $id, $sidebars_widgets ) ) {
    1023                             $_sidebars_widgets[$id] = $sidebars_widgets[$id];
    1024                             unset($sidebars_widgets[$id], $sidebars[$id]);
    1025                         }
    1026                     }
    1027 
    1028                     // move the rest to wp_inactive_widgets
    1029                     if ( !isset($_sidebars_widgets['wp_inactive_widgets']) )
    1030                         $_sidebars_widgets['wp_inactive_widgets'] = array();
    1031 
    1032                     if ( !empty($sidebars_widgets) ) {
    1033                         foreach ( $sidebars_widgets as $lost => $val ) {
    1034                             if ( is_array($val) )
    1035                                 $_sidebars_widgets['wp_inactive_widgets'] = array_merge( (array) $_sidebars_widgets['wp_inactive_widgets'], $val );
    1036                         }
    1037                     }
    1038 
    1039                     $sidebars_widgets = $_sidebars_widgets;
    1040                     unset($_sidebars_widgets);
    1041                 }
    1042         }
     1035            }
     1036
     1037            if ( $update && is_admin() )
     1038                update_option('sidebars_widgets', $sidebars_widgets);
    10431039    }
    10441040
     
    10911087 */
    10921088function wp_convert_widget_settings($base_name, $option_name, $settings) {
     1089    global $_wp_sidebars_widgets;
    10931090    // This test may need expanding.
    1094     $single = $changed = false;
     1091    $single = false;
    10951092    if ( empty($settings) ) {
    10961093        $single = true;
     
    11141111        } else {
    11151112            if ( empty($GLOBALS['_wp_sidebars_widgets']) )
    1116                 $GLOBALS['_wp_sidebars_widgets'] = get_option('sidebars_widgets', array());
     1113                $GLOBALS['_wp_sidebars_widgets'] = get_option('sidebars_widgets');
    11171114            $sidebars_widgets = &$GLOBALS['_wp_sidebars_widgets'];
    11181115        }
     
    11231120                    if ( $base_name == $name ) {
    11241121                        $sidebars_widgets[$index][$i] = "$name-2";
    1125                         $changed = true;
    11261122                        break 2;
    11271123                    }
     
    11301126        }
    11311127
    1132         if ( is_admin() && $changed )
     1128        if ( is_admin() )
    11331129            update_option('sidebars_widgets', $sidebars_widgets);
    11341130    }
  • branches/2.8/wp-settings.php

    r11698 r11553  
    6161    $blog_id = 1;
    6262
    63 // Fix for IIS when running with PHP ISAPI
    64 if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
     63// Fix for IIS, which doesn't set REQUEST_URI
     64if ( empty( $_SERVER['REQUEST_URI'] ) ) {
    6565
    6666    // IIS Mod-Rewrite
     
    317317    require_once(ABSPATH . WPINC . '/kses.php');
    318318    require_once(ABSPATH . WPINC . '/pluggable.php');
    319     require_once(ABSPATH . WPINC . '/formatting.php');
    320319    wp_redirect($link);
    321320    die(); // have to die here ~ Mark
     
    530529require (ABSPATH . WPINC . '/vars.php');
    531530
    532 // make taxonomies available to plugins and themes
    533 // @plugin authors: warning: this gets registered again on the init hook
    534 create_initial_taxonomies();
    535 
    536531// Check for hacks file if the option is enabled
    537532if ( get_option('hack_file') ) {
  • branches/2.8/xmlrpc.php

    r11698 r11553  
    4040    <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
    4141    <apis>
    42       <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
    43       <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
    44       <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
    45       <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
    46       <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service', 'rpc') ) ?>" />
     42      <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
     43      <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
     44      <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
     45      <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php') ?>" />
     46      <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', site_url('wp-app.php/service') ) ?>" />
    4747    </apis>
    4848  </service>
     
    25742574            $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false);
    25752575            $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false);
    2576 
    2577             // For drafts use the GMT version of the post date
    2578             if ( $postdata['post_status'] == 'draft' ) {
    2579                 $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ) );
    2580                 $post_date_gmt = preg_replace( '|\-|', '', $post_date_gmt );
    2581                 $post_date_gmt = preg_replace( '| |', 'T', $post_date_gmt );
    2582             }
    25832576
    25842577            $categories = array();
     
    33013294        $p = explode( "\n\n", $linea );
    33023295
    3303         $preg_target = preg_quote($pagelinkedto, '|');
     3296        $preg_target = preg_quote($pagelinkedto);
    33043297
    33053298        foreach ( $p as $para ) {
     
    33233316                $excerpt = strip_tags($excerpt, '<wpcontext>');        // strip all tags but our context marker
    33243317                $excerpt = trim($excerpt);
    3325                 $preg_marker = preg_quote($marker, '|');
     3318                $preg_marker = preg_quote($marker);
    33263319                $excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
    33273320                $excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
Note: See TracChangeset for help on using the changeset viewer.