Changeset 8242 for branches

Show
Ignore:
Timestamp:
07/02/08 23:07:56 (5 months ago)
Author:
mdawaffe
Message:

crazyhorse: merge with log:trunk@8151:8240

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/crazyhorse/wp-admin/admin-ajax.php

    r8219 r8242  
    1414    $s = $_GET['q']; // is this slashed already? 
    1515 
    16     if ( strstr( $s, ',' ) ) 
    17         die; // it's a multiple tag insert, we won't find anything 
    18     $results = $wpdb->get_col( $wpdb->prepare("SELECT name FROM $wpdb->terms WHERE name LIKE (%s)", '%' . $s . '%') ); 
     16    if ( strstr( $s, ',' ) ) {  
     17        $s = explode( ',', $s );  
     18        $s = $s[count( $s ) - 1];  
     19    } 
     20    $s = trim( $s ); 
     21    if ( strlen( $s ) < 2 ) 
     22     die; // require 2 chars for matching 
     23    $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" ); 
    1924    echo join( $results, "\n" ); 
    2025    die; 
  • branches/crazyhorse/wp-admin/admin-header.php

    r8143 r8242  
    8080    <div id="gears-msg1"> 
    8181    <h3 class="info-box-title"><?php _e('Speed up WordPress'); ?></h3> 
    82     <p><?php _e('WordPress has support for Gears that adds new features to your web browser.'); ?><br /> 
     82    <p><?php _e('WordPress now has support for Gears, which adds new features to your web browser.'); ?><br /> 
    8383    <a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p> 
    84     <p><?php _e('After installing and enabling it, most of the WordPress images, scripts and CSS files will be stored on this computer. This will speed up page loading.'); ?></p> 
    85     <p><strong><?php _e('Please make sure you are not using a public or shared computer.'); ?></strong></p> 
    86     <div class="submit"><button onclick="window.location = 'http://gears.google.com/?action=install&amp;return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button> 
    87     <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div> 
     84    <p><?php _e('After you install and enable Gears most of WordPress&#8217; images, scripts, and CSS files will be stored locally on your computer. This speeds up page load time.'); ?></p> 
     85    <p><strong><?php _e('Don&#8217;t install on a public or shared computer.'); ?></strong></p> <div class="submit"><button onclick="window.location = 'http://gears.google.com/?action=install&amp;return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button> 
     86    <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div> 
    8887    </div> 
    8988 
     
    9493    <p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p> 
    9594    <div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button> 
    96     <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div> 
     95    <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div> 
    9796    </div> 
    9897 
     
    111110    <?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | 
    112111    <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> 
    113     <?php if ( $gears_compat ) { ?>| <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Speed up!') ?></a></span><?php } ?> 
     112    <?php if ( $gears_compat ) { ?>| <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Turbo') ?></a></span><?php } ?> 
    114113</p></div> 
    115114 
  • branches/crazyhorse/wp-admin/async-upload.php

    r8023 r8242  
    1111 
    1212// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead 
    13 if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 
     13if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 
     14    $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie']; 
     15elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) 
    1416    $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie']; 
    1517unset($current_user); 
  • branches/crazyhorse/wp-admin/css/press-this.css

    r8151 r8242  
    295295} 
    296296 
     297#img_container a { 
     298    display: block; 
     299    width: 79px; 
     300    height: 79px; 
     301    float: left; 
     302} 
    297303#img_container img { 
    298304    width: 75px; 
    299305    height: 75px; 
     306    border: 0px; 
    300307    padding: 2px; 
    301308    background-color: #f4f4f4; 
    302     margin-right: 7px; 
    303     margin-bottom: 7px; 
    304309    cursor: pointer; 
    305310} 
     311#img_container a, #img_container a:link, #img_container a:visited { 
     312    border: 2px solid #ccc; 
     313    margin: 0 4px 4px 0; 
     314}  
     315#img_container a:hover, #img_container a:active { 
     316    border: 2px solid #000; 
     317} 
    306318.submit { 
    307 -moz-border-radius-bottomleft: 3px; 
    308 -khtml-border-bottom-left-radius: 3px; 
    309 -webkit-border-bottom-left-radius: 3px; 
    310 border-bottom-left-radius: 3px; 
    311 -moz-border-radius-bottomright: 3px; 
    312 -khtml-border-bottom-right-radius: 3px; 
    313 -webkit-border-bottom-right-radius: 3px; 
    314 border-bottom-right-radius: 3px; 
    315 margin: 0; 
    316 padding: 0; 
     319   -moz-border-radius-bottomleft: 3px; 
     320   -khtml-border-bottom-left-radius: 3px; 
     321   -webkit-border-bottom-left-radius: 3px; 
     322   border-bottom-left-radius: 3px; 
     323   -moz-border-radius-bottomright: 3px; 
     324   -khtml-border-bottom-right-radius: 3px; 
     325   -webkit-border-bottom-right-radius: 3px; 
     326   border-bottom-right-radius: 3px; 
     327   margin: 0; 
     328   padding: 0; 
    317329} 
    318330.submitbox { 
     
    467479 
    468480#post_status { 
    469 margin-left: 10px; 
    470 margin-bottom: 1em; 
    471 display: block; 
     481   margin-left: 10px; 
     482   margin-bottom: 1em; 
     483   display: block; 
    472484} 
    473485 
  • branches/crazyhorse/wp-admin/edit-form-advanced.php

    r8222 r8242  
    2323    $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 
    2424    $autosave = wp_get_post_autosave( $post_id ); 
    25     if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) 
    26         $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); 
     25 
     26    // Detect if there exists an autosave newer than the post and if that autosave is different than the post 
     27    if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) { 
     28        foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { 
     29            if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) { 
     30                $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); 
     31                break; 
     32            } 
     33        } 
     34        unset($autosave_field, $_autosave_field); 
     35    } 
    2736} 
    2837 
  • branches/crazyhorse/wp-admin/gears-manifest.php

    r8151 r8242  
    1616function site_url() {} 
    1717function admin_url() {} 
     18function wp_guess_url() {} 
    1819 
    1920require(ABSPATH . '/wp-includes/script-loader.php'); 
     
    6465{ 
    6566"betaManifestVersion" : 1, 
    66 "version" : "<?php echo $man_version; ?>_20080618", 
     67"version" : "<?php echo $man_version; ?>_20080701", 
    6768"entries" : [ 
    6869<?php echo $defaults; ?> 
     
    112113{ "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" }, 
    113114 
    114 { "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=3101" }, 
    115 { "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=3101" }, 
    116 { "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=3101" }, 
    117 { "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=3101" }, 
    118 { "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=3101" }, 
    119 { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=3101" }, 
    120 { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=3101" }, 
    121 { "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=3101" }, 
    122 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=3101" }, 
    123 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=3101" }, 
    124 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=3101" }, 
    125 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=3101" }, 
    126 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=3101" }, 
    127 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=3101" }, 
    128 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=3101" }, 
     115{ "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=311" }, 
     116{ "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=311" }, 
     117{ "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=311" }, 
     118{ "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=311" }, 
     119{ "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=311" }, 
     120{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=311" }, 
     121{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=311" }, 
     122{ "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=311" }, 
     123{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=311" }, 
     124{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=311" }, 
     125{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=311" }, 
     126{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" }, 
     127{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, 
     128{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, 
     129{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311" }, 
    129130 
    130 { "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=3101" }, 
    131 { "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=3101" }, 
    132 { "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=3101" }, 
    133 { "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=3101" }, 
    134 { "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=3101" }, 
    135 { "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=3101" }, 
    136 { "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=3101" }, 
    137 { "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=3101" }, 
    138 { "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=3101" }, 
    139 { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=3101" }, 
    140 { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=3101" }, 
    141 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=3101" }, 
    142 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=3101" }, 
    143 { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=3101" }, 
     131{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311" }, 
     132{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311" }, 
     133{ "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=311" }, 
     134{ "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=311" }, 
     135{ "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=311" }, 
     136{ "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=311" }, 
     137{ "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=311" }, 
     138{ "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=311" }, 
     139{ "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=311" }, 
     140{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" }, 
     141{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, 
     142{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, 
     143{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311" }, 
     144{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 
    144145 
    145 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=3101" }, 
    146 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=3101" }, 
    147 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=3101" }, 
    148 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=3101" }, 
    149 { "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=3101" }, 
    150 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=3101" }, 
    151 { "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=3101" }, 
    152 { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=3101" }, 
    153 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=3101" }, 
    154 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=3101" }, 
    155 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=3101" }, 
    156 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=3101" }, 
    157 { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=3101" }, 
     146{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" }, 
     147{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=311" }, 
     148{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=311" }, 
     149{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=311" }, 
     150{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=311" }, 
     151{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=311" }, 
     152{ "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=311" }, 
     153{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" }, 
     154{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, 
     155{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, 
     156{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311" }, 
     157{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, 
     158{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, 
    158159 
    159160{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" }, 
  • branches/crazyhorse/wp-admin/includes/file.php

    r8103 r8242  
    286286 
    287287    $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); 
    288  
     288     
     289    // Strip the query strings. 
     290    $filename = str_replace('?','-', $filename); 
     291    $filename = str_replace('&','-', $filename); 
     292     
    289293    // Move the file to the uploads dir 
    290294    $new_file = $uploads['path'] . "/$filename"; 
  • branches/crazyhorse/wp-admin/includes/media.php

    r8067 r8242  
    6363} 
    6464 
     65function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 
     66 
     67    if ( empty($alt) ) return $html; 
     68    $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 
     69 
     70    preg_match( '/width="([0-9]+)/', $html, $matches ); 
     71    if ( ! isset($matches[1]) ) return $html; 
     72    $width = $matches[1]; 
     73 
     74    $html = preg_replace( '/align[^\s\'"]+\s?/', '', $html ); 
     75    if ( empty($align) ) $align = 'none'; 
     76 
     77    $shcode = '[wp_caption id="' . $id . '" align="align' . $align 
     78    . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/wp_caption]'; 
     79 
     80    return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); 
     81} 
     82add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 ); 
     83 
    6584function media_send_to_editor($html) { 
    6685    ?> 
    6786<script type="text/javascript"> 
    68 <!-- 
    69 top.send_to_editor('<?php echo addslashes($html); ?>')
    70 top.tb_remove(); 
    71 --> 
     87/* <![CDATA[ */ 
     88var win = window.dialogArguments || opener || parent || top
     89win.send_to_editor('<?php echo addslashes($html); ?>'); 
     90/* ]]> */ 
    7291</script> 
    7392    <?php 
     
    116135} 
    117136 
    118  
    119 function media_sideload_image($file, $post_id, $desc = null) { 
    120  
    121     if (!empty($file) ) { 
    122         // Upload File button was clicked 
    123          
    124         $file_array['name'] = basename($file); 
    125         $file_array['tmp_name'] = download_url($file); 
    126         $desc = @$desc; 
    127          
    128         $sideload = media_handle_sideload($file_array, $post_id, $desc); 
    129  
    130         $id = $sideload['id']; 
    131         $src = $sideload['src']; 
    132          
    133         unset($file_array['tmp_name']); 
    134         unset($file_array); 
    135          
    136         if ( is_wp_error($id) ) { 
    137             $errors['upload_error'] = $id; 
    138             $id = false; 
    139         } 
    140     } 
    141      
    142     if ( !empty($src) && !strpos($src, '://') ) 
    143          
    144         $src = "http://$src"; 
    145         $alt = @$desc; 
    146          
    147         if ( !empty($src) ) 
    148             $html = "<img src='$src' alt='$alt' />"; 
    149             return $html; 
    150      
    151 } 
    152  
    153137function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) { 
    154138    $overrides = array('test_form'=>false); 
     
    187171    if ( !is_wp_error($id) ) { 
    188172        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); 
    189     } 
    190  
    191     return array('id' => $id, 'src' => $url); 
    192  
     173        return $url; 
     174    } 
     175    return $id; 
    193176} 
    194177 
     
    347330 
    348331    return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); 
     332} 
     333 
     334function media_sideload_image($file, $post_id, $desc = null) { 
     335    if (!empty($file) ) { 
     336        $file_array['name'] = basename($file); 
     337        $file_array['tmp_name'] = download_url($file); 
     338        $desc = @$desc; 
     339         
     340        $id = media_handle_sideload($file_array, $post_id, $desc); 
     341        $src = $id; 
     342 
     343        unset($file_array); 
     344 
     345        if ( is_wp_error($id) ) { 
     346            $errors['upload_error'] = $id; 
     347            return $id; 
     348        } 
     349    } 
     350 
     351    if ( !empty($src) ) { 
     352        $alt = @$desc; 
     353        $html = "<img src='$src' alt='$alt' />"; 
     354        return $html; 
     355    } 
    349356} 
    350357 
     
    861868            post_params : { 
    862869                "post_id" : "<?php echo $post_id; ?>", 
    863                 "auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>", 
     870                "auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>", 
    864871                "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>", 
    865872                "type" : "<?php echo $type; ?>", 
  • branches/crazyhorse/wp-admin/includes/misc.php

    r7508 r8242  
    6868        } 
    6969        if (!$foundit) { 
    70             fwrite( $f, "# BEGIN {$marker}\n" ); 
     70            fwrite( $f, "\n# BEGIN {$marker}\n" ); 
    7171            foreach ( $insertion as $insertline ) 
    7272                fwrite( $f, "{$insertline}\n" ); 
  • branches/crazyhorse/wp-admin/includes/schema.php

    r8151 r8242  
    154154function populate_options() { 
    155155    global $wpdb, $wp_db_version; 
    156  
    157     $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
    158     $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     156     
     157    $guessurl = wp_guess_url(); 
    159158     
    160159    do_action('populate_options'); 
     
    256255    // 2.6 
    257256    add_option('avatar_default', 'mystery'); 
    258     add_option('enable_app',0); 
    259     add_option('enable_xmlrpc',0); 
     257    add_option('enable_app', 0); 
     258    add_option('enable_xmlrpc', 0); 
    260259     
    261260    // Delete unused options 
  • branches/crazyhorse/wp-admin/includes/template.php

    r8222 r8242  
    758758    $actions = array(); 
    759759 
    760     $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
    761     $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
    762  
    763     // we're looking at list of only approved or only unapproved comments 
    764     if ( 'moderated' == $comment_status ) { 
    765         $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
    766         unset($actions['unapprove']); 
    767     } elseif ( 'approved' == $comment_status ) { 
    768         $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
    769         unset($actions['approve']); 
    770     } 
    771  
    772760    if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
     761        $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
     762        $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     763 
     764        // we're looking at list of only approved or only unapproved comments 
     765        if ( 'moderated' == $comment_status ) { 
     766            $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
     767            unset($actions['unapprove']); 
     768        } elseif ( 'approved' == $comment_status ) { 
     769            $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     770            unset($actions['approve']); 
     771        } 
     772 
    773773        $actions['edit']      = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a> | '; 
    774774        $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 
    775775        $actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>'; 
     776        $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 
    776777        foreach ( $actions as $action => $link ) 
    777778            echo "<span class='$action'>$link</span>"; 
     
    912913<tr class="submit"><td colspan="3"> 
    913914    <?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?> 
    914     <input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta::post_id=<?php echo $GLOBALS['post_ID'] ? $GLOBALS['post_ID'] : $GLOBALS['temp_ID']; ?>" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" /> 
     915    <input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" /> 
    915916</td></tr> 
    916917</table> 
  • branches/crazyhorse/wp-admin/includes/upgrade.php

    r8151 r8242  
    77 
    88if ( !function_exists('wp_install') ) : 
    9 function wp_install($blog_title, $user_name, $user_email, $public, $remote) { 
     9function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') { 
    1010    global $wp_rewrite; 
    1111 
     
    1919    update_option('admin_email', $user_email); 
    2020    update_option('blog_public', $public); 
    21     update_option('enable_app',$remote); 
    22     update_option('enable_xmlrpc',$remote); 
    23  
    24     $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
    25  
    26     if ( defined('WP_SITEURL') && '' != WP_SITEURL ) 
    27         $guessurl = WP_SITEURL; 
    28     else 
    29         $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     21 
     22    $guessurl = wp_guess_url(); 
    3023 
    3124    update_option('siteurl', $guessurl); 
     
    212205        upgrade_252(); 
    213206 
    214     if ( $wp_current_db_version < 8000
     207    if ( $wp_current_db_version < 8201
    215208        upgrade_260(); 
    216209 
     
    750743 
    751744function upgrade_260() { 
    752     populate_roles_260(); 
     745    if ( $wp_current_db_version < 8000 ) 
     746        populate_roles_260(); 
     747 
     748    if ( $wp_current_db_version < 8201 ) { 
     749        update_option('enable_app', 1); 
     750        update_option('enable_xmlrpc', 1); 
     751    } 
    753752} 
    754753 
     
    882881    global $wpdb; 
    883882 
    884     // Seperate individual queries into an array 
     883    // Separate individual queries into an array 
    885884    if( !is_array($queries) ) { 
    886885        $queries = explode( ';', $queries ); 
  • branches/crazyhorse/wp-admin/includes/user.php

    r7645 r8242  
    355355    function do_paging() { 
    356356        if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results 
     357            $args = array(); 
     358            if( ! empty($this->search_term) ) 
     359                $args['usersearch'] = urlencode($this->search_term); 
     360            if( ! empty($this->role) ) 
     361                $args['role'] = urlencode($this->role); 
     362 
    357363            $this->paging_text = paginate_links( array( 
    358364                'total' => ceil($this->total_users_for_query / $this->users_per_page), 
     
    360366                'base' => 'users.php?%_%', 
    361367                'format' => 'userspage=%#%', 
    362                 'add_args' => array( 'usersearch' => urlencode($this->search_term) ) 
     368                'add_args' => $args 
    363369            ) ); 
    364370        } 
  • branches/crazyhorse/wp-admin/install.php

    r8151 r8242  
    5454            <td colspan="2"><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td> 
    5555        </tr> 
    56         <tr> 
    57             <td colspan="2"><label><input type="checkbox" name="enable_remotepublishing" value="0" /> <?php _e('Enable remote publishing using the WordPress, Movable Type, MetaWeblog, Blogger and Atom publishing protocols for my blog.'); ?></label></td> 
    58         </tr> 
    59     </table> 
    6056    </table> 
    6157    <input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /> 
     
    7369        $admin_email = stripslashes($_POST['admin_email']); 
    7470        $public = (int) $_POST['blog_public']; 
    75         $remote = (int) $_POST['enable_remotepublishing']; 
    7671        // check e-mail address 
    7772        if (empty($admin_email)) { 
     
    8479 
    8580        $wpdb->show_errors(); 
    86         $result = wp_install($weblog_title, 'admin', $admin_email, $public, $remote); 
     81        $result = wp_install($weblog_title, 'admin', $admin_email, $public); 
    8782        extract($result, EXTR_SKIP); 
    8883?> 
  • branches/crazyhorse/wp-admin/js/editor.js

    r7716 r8242  
    5353        content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div'); 
    5454        content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n'); 
     55        content = content.replace(new RegExp('\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*', 'gi'), '\n\n[wp_caption$1[/wp_caption]\n\n'); 
    5556 
    5657        var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; 
     
    7071        // Trim whitespace 
    7172        content = content.replace(new RegExp('^\\s*', ''), ''); 
    72         content = content.replace(new RegExp('\\s*$', ''), ''); 
     73        content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), ''); 
    7374 
    7475        // put back the line breaks in pre|script 
     
    165166        pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1"); 
    166167        pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1'); 
     168        pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[wp_caption$1[/wp_caption]'); 
    167169        // pee = pee.replace(new RegExp('^((?:&nbsp;)*)\\s', 'mg'), '$1&nbsp;'); 
    168170 
  • branches/crazyhorse/wp-admin/js/media-upload.js

    r7989 r8242  
    11// send html to the post editor 
    22function send_to_editor(h) { 
    3     var win = window.dialogArguments || opener || parent || top; 
     3    if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) { 
     4        ed.focus(); 
     5        if (tinymce.isIE) 
     6            ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); 
    47 
    5     tinyMCE = win.tinyMCE; 
    6     if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) { 
    7         tinyMCE.selectedInstance.getWin().focus(); 
    8         tinyMCE.execCommand('mceInsertContent', false, h); 
     8        ed.execCommand('mceInsertContent', false, h); 
     9        ed.execCommand('mceCleanup'); 
    910    } else 
    10         win.edInsertContent(win.edCanvas, h); 
     11        edInsertContent(edCanvas, h); 
     12 
     13    tb_remove(); 
    1114} 
    1215 
     
    2326            $('#TB_iframeContent').width( W - 50 ).height( H - 75 ); 
    2427            tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'}); 
    25             if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 )
     28            if ( typeof document.body.style.maxWidth != 'undefined'
    2629                tbWindow.css({'top':'20px','margin-top':'0'}); 
    2730            $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'}); 
     
    3639        }); 
    3740    }; 
     41     
     42    jQuery('a.thickbox').click(function(){ 
     43        if ( typeof tinyMCE != 'undefined' &&  tinyMCE.activeEditor ) { 
     44            tinyMCE.get('content').focus(); 
     45            tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple'); 
     46        } 
     47    }); 
    3848 
    3949    $(window).resize( function() { tb_position() } ); 
  • branches/crazyhorse/wp-admin/js/post.js

    r8220 r8242  
    9999 
    100100    // auto-suggest stuff 
    101     jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2 } ); 
     101    jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); 
    102102    jQuery('#newtag').keypress( tag_press_key ); 
    103103 
     
    182182            autosave_update_post_ID(s.parsed.responses[0].supplemental.postid); 
    183183        } 
    184     } }); 
     184    }, addBefore: function( s ) { 
     185        s.data += '&post_id=' + jQuery('#post_ID').val(); 
     186        return s; 
     187    } 
     188    }); 
    185189}); 
  • branches/crazyhorse/wp-admin/js/theme-preview.js

    r7989 r8242  
    1313            $('#TB_iframeContent').width( W - 90 ).height( H - 90 ); 
    1414            tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'}); 
    15             if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 )
     15            if ( typeof document.body.style.maxWidth != 'undefined'
    1616                tbWindow.css({'top':'30px','margin-top':'0'}); 
    1717        }; 
  • branches/crazyhorse/wp-admin/options-writing.php

    r8151 r8242  
    134134<p class="submit"> 
    135135<input type="hidden" name="action" value="update" /> 
    136 <input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category,use_