Changeset 1344

Show
Ignore:
Timestamp:
07/02/08 13:44:49 (4 months ago)
Author:
donncha
Message:

WP Merge to rev 8216

Files:

Legend:

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

    r1328 r1344  
    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; 
  • trunk/wp-admin/admin-header.php

    r1342 r1344  
    8888        <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> 
    8989        <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> 
    90         <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div> 
     90        <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div> 
    9191        </div> 
    9292 
     
    9797        <p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p> 
    9898        <div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button> 
    99         <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div> 
     99        <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div> 
    100100        </div> 
    101101 
  • trunk/wp-admin/gears-manifest.php

    r1342 r1344  
    6565{ 
    6666"betaManifestVersion" : 1, 
    67 "version" : "<?php echo $man_version; ?>_20080625", 
     67"version" : "<?php echo $man_version; ?>_20080626", 
    6868"entries" : [ 
    6969<?php echo $defaults; ?> 
     
    113113{ "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" }, 
    114114 
    115 { "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=3101" }, 
    116 { "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=3101" }, 
    117 { "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=3101" }, 
    118 { "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=3101" }, 
    119 { "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=3101" }, 
    120 { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=3101" }, 
    121 { "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=3101" }, 
    122 { "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=3101" }, 
    123 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=3101" }, 
    124 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=3101" }, 
    125 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=3101" }, 
    126 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=3101" }, 
    127 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=3101" }, 
    128 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=3101" }, 
    129 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=3102" }, 
     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" }, 
    130130 
    131 { "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=3101" }, 
    132 { "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=3101" }, 
    133 { "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=3101" }, 
    134 { "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=3101" }, 
    135 { "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=3101" }, 
    136 { "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=3101" }, 
    137 { "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=3101" }, 
    138 { "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=3101" }, 
    139 { "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=3101" }, 
    140 { "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=3101" }, 
    141 { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=3101" }, 
    142 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=3101" }, 
    143 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=3101" }, 
    144 { "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" }, 
    145145 
    146 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=3101" }, 
    147 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=3101" }, 
    148 { "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=3101" }, 
    149 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=3101" }, 
    150 { "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=3101" }, 
    151 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=3101" }, 
    152 { "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=3101" }, 
    153 { "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=3101" }, 
    154 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=3101" }, 
    155 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=3101" }, 
    156 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=3101" }, 
    157 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=3101" }, 
    158 { "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" }, 
    159159 
    160160{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" }, 
  • trunk/wp-admin/includes/media.php

    r1342 r1344  
    331331 
    332332        if ( !empty($src) ) { 
    333                 if ( !strpos($src, '://') ) 
    334                         $src = "http://$src"; 
    335333                $alt = @$desc; 
    336334                $html = "<img src='$src' alt='$alt' />"; 
  • trunk/wp-admin/includes/schema.php

    r1342 r1344  
    331331        // 2.6 
    332332        add_option('avatar_default', 'mystery'); 
    333         add_option('enable_app',0); 
    334         add_option('enable_xmlrpc',0); 
     333        add_option('enable_app', 0); 
     334        add_option('enable_xmlrpc', 0); 
    335335         
    336336        // Delete unused options 
  • trunk/wp-admin/includes/upgrade.php

    r1342 r1344  
    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); 
    2321 
    2422        $guessurl = wp_guess_url(); 
     
    207205                upgrade_252(); 
    208206 
    209         if ( $wp_current_db_version < 8000
     207        if ( $wp_current_db_version < 8201
    210208                upgrade_260(); 
    211209 
     
    753751 
    754752function upgrade_260() { 
    755         populate_roles_260(); 
     753        if ( $wp_current_db_version < 8000 ) 
     754                populate_roles_260(); 
     755 
     756        if ( $wp_current_db_version < 8201 ) { 
     757                update_option('enable_app', 1); 
     758                update_option('enable_xmlrpc', 1); 
     759        } 
    756760} 
    757761 
  • trunk/wp-admin/index.php

    r1336 r1344  
    9292} 
    9393 
    94 $total_comments = sprintf( __( '%1$s total' ), $num_comm['total_comments'] ); 
    95 $approved_comments = sprintf( __( '%1$s approved' ), $num_comm['approved'] ); 
    96 $spam_comments = sprintf( __( '%1$s spam' ), $num_comm['spam'] ); 
    97 $moderated_comments = sprintf( __( '%1$s awaiting moderation' ), $num_comm['awaiting_moderation'] ); 
     94$total_comments = sprintf( __ngettext( '%1$s total', '%1$s total', $num_comm['total_comments'] ), number_format_i18n($num_comm['total_comments']) ); 
     95$approved_comments = sprintf( __ngettext( '%1$s approved', '%1$s approved', $num_comm['approved'] ), number_format_i18n($num_comm['approved']) ); 
     96$spam_comments = sprintf( __ngettext( '%1$s spam', '%1$s spam', $num_comm['spam'] ), number_format_i18n($num_comm['spam']) ); 
     97$moderated_comments = sprintf( __ngettext( '%1$s awaiting moderation', '%1$s awaiting moderation', $num_comm['awaiting_moderation'] ), number_format_i18n($num_comm['awaiting_moderation']) ); 
    9898 
    9999if( current_user_can( 'moderate_comments' ) ) { 
     
    103103} 
    104104 
    105 $comm_text = sprintf( __( 'Current comment break down: %1$s, %2$s, %3$s and %4$s.' ), $total_comments, $approved_comments, $spam_comments, $moderated_comments ); 
     105$comm_text = sprintf( __ngettext( 'You have %1$s comment, %2$s, %3$s and %4$s.', 'You have %1$s comments, %2$s, %3$s and %4$s.', $num_comm['total_comments'] ), $total_comments, $approved_comments, $spam_comments, $moderated_comments ); 
    106106 
    107107$post_type_text = implode(', ', $post_type_texts); 
  • trunk/wp-admin/js/post.js

    r1336 r1344  
    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 
  • trunk/wp-admin/press-this.php

    r1336 r1344  
    9191        <body class="press-this"> 
    9292                 
    93                 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $post_ID; ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();">Close Window</a></p></div> 
     93                <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $post_ID; ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p></div> 
    9494                 
    9595                <div id="footer"> 
     
    138138                 
    139139        <p><input type="hidden" name="this_photo" value="<?php echo $image; ?>" id="this_photo" /> 
    140                 <a href="#" class="select"><img src="<?php echo $image; ?>" width="475" alt="Click to insert." title="Click to insert." /></a></p> 
    141          
    142         <p id="options"><a href="#" class="select">Insert Image</a> | <a href="#" class="cancel">Cancel</a></p> 
     140                <a href="#" class="select"><img src="<?php echo $image; ?>" width="475" alt="<?php echo attribute_escape(__('Click to insert.')); ?>" title="<?php echo attribute_escape(__('Click to insert.')); ?>" /></a></p> 
     141         
     142        <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> 
    143143<?php die;  
    144144} 
     
    165165        </div> 
    166166         
    167         <p id="options"><a href="#" class="select">Insert Image</a> | <a href="#" class="cancel">Cancel</a></p> 
     167        <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> 
    168168<?php die;  
    169169} 
     
    433433                        case 'photo' : 
    434434                                set_menu('photo'); 
    435                                 set_title('Post'); 
     435                                set_title('<?php _e('Post') ?>'); 
    436436                                <?php if($selection) { ?> 
    437437                                        set_editor("<?php echo $selection; ?>"); 
    438438                                <?php } ?> 
    439439                                jQuery('#extra_fields').show(); 
    440                                 jQuery('#extra_fields').before('<h2 id="waiting"><img src="images/loading.gif" alt="" /> Loading...</h2>'); 
     440                                jQuery('#extra_fields').before('<h2 id="waiting"><img src="images/loading.gif" alt="" /><?php echo js_escape( __( 'Loading...' ) ); ?></h2>'); 
    441441                                jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&u='.attribute_escape($url); ?>'); 
    442442                                jQuery.ajax({ 
     
    519519                        <div id="tagchecklist"></div> 
    520520                </div> 
    521                 <label for="post_status" id="post_status"><input type="radio" name="post_status" value="publish" checked="checked" id="published" />Published <input type="radio" name="post_status" value="draft" id="unpubplished" /> Unpublished</label> 
     521                <div id="post_status"> 
     522                        <input type="radio" name="post_status" value="publish" checked="checked" id="published" /> <label for="published"><?php _e('Published'); ?></label> 
     523                        <input type="radio" name="post_status" value="draft" id="unpublished" /> <label for="unpublished"><?php _e('Unpublished'); ?></label> 
     524                </div> 
    522525                <p class="submit">          
    523526                        <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> 
  • trunk/wp-app.php

    r1328 r1344  
    195195                        $this->redirect($this->get_service_url()); 
    196196                } 
     197 
     198                // check to see if AtomPub is enabled 
     199                if( !get_option( 'enable_app' ) ) 
     200                        $this->not_allowed( 'AtomPub services are disabled on this blog.  An admin user can enable them at ' . admin_url('options-writing.php') ); 
    197201 
    198202                // dispatch 
  • trunk/wp-includes/bookmark-template.php

    r1336 r1344  
    187187        $defaults = array( 
    188188                'orderby' => 'name', 'order' => 'ASC', 
    189                 'limit' => -1, 'category' => '', 
     189                'limit' => -1, 'category' => '', 'exclude_category' => '', 
    190190                'category_name' => '', 'hide_invisible' => 1, 
    191191                'show_updated' => 0, 'echo' => 1, 
     
    204204        if ( $categorize ) { 
    205205                //Split the bookmarks into ul's for each category 
    206                 $cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0)); 
     206                $cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0)); 
    207207 
    208208                foreach ( (array) $cats as $cat ) { 
  • trunk/wp-includes/class-smtp.php

    r1336 r1344  
    250250     * that is to be send with the headers. Each header needs to be 
    251251     * on a single line followed by a <CRLF> with the message headers 
    252      * and the message body being seperated by and additional <CRLF>. 
     252     * and the message body being separated by and additional <CRLF>. 
    253253     * 
    254254     * Implements rfc 821: DATA <CRLF> 
  • trunk/wp-includes/default-filters.php

    r1328 r1344  
    154154add_filter('pre_comment_content', 'wp_rel_nofollow', 15); 
    155155add_filter('comment_email', 'antispambot'); 
     156add_filter('option_tag_base', '_wp_filter_taxonomy_base'); 
     157add_filter('option_category_base', '_wp_filter_taxonomy_base'); 
    156158 
    157159//Atom SSL support 
  • trunk/wp-includes/functions.php

    r1337 r1344  
    100100} 
    101101 
    102  
     102/** 
     103 * Retrieve the date in localized format, based on timestamp. 
     104 * 
     105 * If the locale specifies the locale month and weekday, then the locale will 
     106 * take over the format for the date. If it isn't, then the date format string 
     107 * will be used instead. 
     108 * 
     109 * @since 0.71 
     110 * 
     111 * @param string $dateformatstring Format to display the date 
     112 * @param int $unixtimestamp Unix timestamp 
     113 * @return string The date, translated if locale specifies it. 
     114 */ 
    103115function date_i18n( $dateformatstring, $unixtimestamp ) { 
    104116        global $wp_locale; 
    105117        $i = $unixtimestamp; 
     118        // Sanity check for PHP 5.1.0- 
     119        if ( -1 == $i ) 
     120                $i = false; 
     121         
    106122        if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) { 
    107123                $datemonth = $wp_locale->get_month( date( 'm', $i ) ); 
     
    277293} 
    278294 
    279 /* Options functions */ 
    280  
    281295/** 
    282296 * Retrieve option value based on setting name. 
    283297 * 
    284  * {@internal Missing Long Description}} 
     298 * If the option does not exist or does not have a value, then the return value 
     299 * will be false. This is useful to check whether you need to install an option 
     300 * and is commonly used during installation of plugin options and to test 
     301 * whether upgrading is required. 
     302 * 
     303 * You can "short-circuit" the retrieval of the option from the database for 
     304 * your plugin or core options that aren't protected. You can do so by hooking 
     305 * into the 'pre_option_$option' with the $option being replaced by the option 
     306 * name. You should not try to override special options, but you will not be 
     307 * prevented from doing so. 
     308 * 
     309 * There is a second filter called 'option_$option' with the $option being 
     310 * replaced with the option name. This gives the value as the only parameter. 
    285311 * 
    286312 * @since 1.5.0 
    287313 * @package WordPress 
    288314 * @subpackage Option 
     315 * @uses apply_filters() Calls 'pre_option_$optionname' false to allow 
     316 *              overwriting the option value in a plugin. 
     317 * @uses apply_filters() Calls 'option_$optionname' with the option name value. 
    289318 * 
    290319 * @param string $setting Name of option to retrieve. Should already be SQL-escaped 
     
    348377} 
    349378 
     379/** 
     380 * Retrieve all autoload options or all options, if no autoloaded ones exist. 
     381 * 
     382 * This is different from wp_load_alloptions(), in this that function does not 
     383 * cache all options and will retrieve all options from the database every time 
     384 * it is called. 
     385 * 
     386 * @since 1.0.0 
     387 * @package WordPress 
     388 * @subpackage Option 
     389 * @uses apply_filters() Calls 'pre_option_$optionname' hook with option value as parameter. 
     390 * @uses apply_filters() Calls 'all_options' on options list. 
     391 * 
     392 * @return array List of all options. 
     393 */ 
    350394function get_alloptions() { 
    351395        global $wpdb, $wp_queries; 
     
    358402                // "When trying to design a foolproof system, 
    359403                //  never underestimate the ingenuity of the fools :)" -- Dougal 
    360                 if ( in_array( $option->option_name, array( 'siteurl', 'home', 'category_base' ) ) ) 
     404                if ( in_array( $option->option_name, array( 'siteurl', 'home', 'category_base', 'tag_base' ) ) ) 
    361405                        $option->option_value = untrailingslashit( $option->option_value ); 
    362406                $value = maybe_unserialize( $option->option_value ); 
     
    366410} 
    367411 
    368  
     412/** 
     413 * Loads and caches all autoloaded options, if available or all options. 
     414 * 
     415 * This is different from get_alloptions(), in that this function will cache the 
     416 * options and will return the cached options when called again. 
     417 * 
     418 * @since 2.2.0 
     419 * @package WordPress 
     420 * @subpackage Option 
     421 * 
     422 * @return array List all options. 
     423 */ 
    369424function wp_load_alloptions() { 
    370425        global $wpdb; 
     
    433488} 
    434489 
    435 // expects $option_name to NOT be SQL-escaped 
     490/** 
     491 * Update the value of an option that was already added. 
     492 * 
     493 * If the option does not exist, then the option will be added with the option 
     494 * value, but you will not be able to set whether it is autoloaded. If you want 
     495 * to set whether an option autoloaded, then you need to use the add_option(). 
     496 * 
     497 * When the option is updated, then the filter named 
     498 * 'update_option_$option_name', with the $option_name as the $option_name 
     499 * parameter value, will be called. The hook should accept two parameters, the 
     500 * first is the old parameter and the second is the new parameter. 
     501 * 
     502 * @since 1.0.0 
     503 * @package WordPress 
     504 * @subpackage Option 
     505 * 
     506 * @param string $option_name Option name. Expected to not be SQL-escaped 
     507 * @param mixed $newvalue Option value. 
     508 * @return bool False if value was not updated and true if value was updated. 
     509 */ 
    436510function update_option( $option_name, $newvalue ) { 
    437511        global $wpdb; 
     
    465539} 
    466540 
    467  
    468 // thx Alex Stapleton, http://alex.vort-x.net/blog/ 
    469 // expects $name to NOT be SQL-escaped 
     541/** 
     542 * Add a new option. 
     543 * 
     544 * You can create options without values and then add values later. Does not 
     545 * check whether the option has already been added, but does check that you 
     546 * aren't adding a protected WordPress option. Care should be taken to not name 
     547 * options, the same as the ones which are protected and to not add options 
     548 * that were already added. 
     549 * 
     550 * The filter named 'add_option_$optionname', with the $optionname being 
     551 * replaced with the option's name, will be called. The hook should accept two 
     552 * parameters, the first is the option name, and the second is the value. 
     553 * 
     554 * @package WordPress 
     555 * @subpackage Option 
     556 * @since 1.0.0 
     557 * @link http://alex.vort-x.net/blog/ Thanks Alex Stapleton 
     558 * 
     559 * @param string $name Option name to add. Expects to NOT be SQL escaped. 
     560 * @param mixed $value Optional. Option value, can be anything. 
     561 * @param mixed $deprecated Optional. Description. Not used anymore. 
     562 * @param bool $autoload Optional. Default is enabled. Whether to load the option when WordPress starts up. 
     563 * @return null returns when finished. 
     564 */ 
    470565function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) { 
    471566        global $wpdb; 
     
    485580        $wpdb->query( $wpdb->prepare( "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES (%s, %s, %s)", $name, $value, $autoload ) ); 
    486581 
    487         do_action( "add_option_{$name}", $name, $value );  
     582        do_action( "add_option_{$name}", $name, $value ); 
    488583        return; 
    489584} 
    490585 
    491  
     586/** 
     587 * Removes option by name and prevents removal of protected WordPress options. 
     588 * 
     589 * @package WordPress 
     590 * @subpackage Option 
     591 * @since unknown 
     592 * 
     593 * @param string $name Option name to remove. 
     594 * @return bool True, if succeed. False, if failure. 
     595 */ 
    492596function delete_option( $name ) { 
    493597        global $wpdb; 
     
    504608        // expected_slashed ($name) 
    505609        $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name = '$name'" ); 
    506  
    507610        return true; 
    508611} 
    509612 
    510  
     613/** 
     614 * Serialize data, if needed. 
     615 * 
     616 * @param mixed $data Data that might be serialized. 
     617 * @return mixed A scalar data 
     618 */ 
    511619function maybe_serialize( $data ) { 
    512620        if ( is_string( $data ) ) 
     
    572680} 
    573681 
    574  
     682/** 
     683 * Open the file handle for debugging. 
     684 * 
     685 * This function is used for XMLRPC feature, but it is general purpose enough 
     686 * to be used in anywhere. 
     687 * 
     688 * @see fopen() for mode options. 
     689 * @package WordPress 
     690 * @subpackage Debug 
     691 * @since unknown 
     692 * @uses $debug Used for whether debugging is enabled. 
     693 * 
     694 * @param string $filename File path to debug file. 
     695 * @param string $mode Same as fopen() mode parameter. 
     696 * @return bool|resource File handle. False on failure. 
     697 */ 
    575698function debug_fopen( $filename, $mode ) { 
    576699        global $debug; 
     
    583706} 
    584707 
    585  
     708/** 
     709 * Write contents to the file used for debugging. 
     710 * 
     711 * Technically, this can be used to write to any file handle when the global 
     712 * $debug is set to 1 or true. 
     713 * 
     714 * @package WordPress 
     715 * @subpackage Debug 
     716 * @since unknown 
     717 * @uses $debug Used for whether debugging is enabled. 
     718 * 
     719 * @param resource $fp File handle for debugging file. 
     720 * @param string $string Content to write to debug file. 
     721 */ 
    586722function debug_fwrite( $fp, $string ) { 
    587723        global $debug; 
     
    590726} 
    591727 
    592  
     728/** 
     729 * Close the debugging file handle. 
     730 * 
     731 * Technically, this can be used to close any file handle when the global $debug 
     732 * is set to 1 or true. 
     733 * 
     734 * @package WordPress 
     735 * @subpackage Debug 
     736 * @since unknown 
     737 * @uses $debug Used for whether debugging is enabled. 
     738 * 
     739 * @param resource $fp Debug File handle. 
     740 */ 
    593741function debug_fclose( $fp ) { 
    594742        global $debug; 
     
    759907} 
    760908 
    761  
     909/** 
     910 * Build URL query based on an associative and, or indexed array. 
     911 * 
     912 * This is a convenient function for easily building url queries. It sets the 
     913 * separator to '&' and uses _http_build_query() function. 
     914 * 
     915 * @see _http_build_query() Used to build the query 
     916 * @link http://us2.php.net/manual/en/function.http-build-query.php more on what 
     917 *              http_build_query() does. 
     918 * 
     919 * @since unknown 
     920 * 
     921 * @param array $data URL-encode key/value pairs. 
     922 * @return string URL encoded string 
     923 */ 
    762924function build_query( $data ) { 
    763925        return _http_build_query( $data, NULL, '&', '', false ); 
     
    765927 
    766928/** 
    767  * Retrieve a modified query string. 
    768  * 
    769  * {@internal Missing Long Description}} 
    770  * 
    771  * Adding a single key & value or an associative array. 
    772  * Setting a key value to emptystring removes the key. 
    773  * Omitting oldquery_or_uri uses the $_SERVER value. 
     929 * Retrieve a modified URL query string. 
     930 * 
     931 * You can rebuild the URL and append a new query variable to the URL query by 
     932 * using this function. You can also retrieve the full URL with query data. 
     933 * 
     934 * Adding a single key & value or an associative array. Setting a key value to 
     935 * emptystring removes the key. Omitting oldquery_or_uri uses the $_SERVER 
     936 * value. 
    774937 * 
    775938 * @since 1.5.0 
     
    8841047} 
    8851048 
     1049/** 
     1050 * HTTP request for URI to retrieve content. 
     1051 * 
     1052 * Tries to retrieve the HTTP content with fopen first and then using cURL, if 
     1053 * fopen can't be used. 
     1054 * 
     1055 * @since unknown 
     1056 * 
     1057 * @param string $uri URI/URL of web page to retrieve. 
     1058 * @return string HTTP content. 
     1059 */ 
    8861060function wp_remote_fopen( $uri ) { 
    8871061        $timeout = 10; 
     
    9951169} 
    9961170 
    997  
     1171/** 
     1172 * Set HTTP status header. 
     1173 * 
     1174 * @since unknown 
     1175 * @uses apply_filters() Calls 'status_header' on status header string, HTTP 
     1176 *              HTTP code, HTTP code description, and protocol string as separate 
     1177 *              parameters. 
     1178 * 
     1179 * @param int $header HTTP status code 
     1180 * @return null Does not return anything. 
     1181 */ 
    9981182function status_header( $header ) { 
    9991183        $text = get_status_header_desc( $header ); 
     
    12931477        // $dir is absolute, $path is (maybe) relative to ABSPATH 
    12941478        $dir = path_join( ABSPATH, $upload_path ); 
    1295         $path = str_replace( ABSPATH, '', trim( $upload_path ) ); 
    12961479 
    12971480        if ( !$url = get_option( 'upload_url_path' ) ) 
    1298                 $url = trailingslashit( $siteurl ) . $path
     1481                $url = WP_CONTENT_URL . '/uploads'
    12991482 
    13001483        if ( defined('UPLOADS') ) { 
     
    17901973} 
    17911974 
    1792  
    17931975/** 
    17941976 * Load the correct database class file. 
     
    18081990                require_once( ABSPATH . WPINC . '/wp-db.php' ); 
    18091991} 
    1810  
    18111992 
    18121993/** 
     
    18572038} 
    18582039 
    1859  
    18602040/** 
    18612041 * Converts value to positive integer. 
     
    18692049        return abs( intval( $maybeint ) ); 
    18702050} 
    1871  
    18722051 
    18732052/** 
     
    19032082        return false; 
    19042083} 
    1905  
    19062084 
    19072085/** 
     
    19212099} 
    19222100 
    1923  
    19242101/** 
    19252102 * Marks a function as deprecated and informs when it has been used. 
     
    19592136} 
    19602137 
    1961  
    19622138/** 
    19632139 * Marks a file as deprecated and informs when it has been used. 
     
    19972173} 
    19982174 
    1999  
    20002175/** 
    20012176 * Is the server running earlier than 1.5.0 version of lighttpd 
     
    20102185        return  'lighttpd' == $server_parts[0] && -1 == version_compare( $server_parts[1], '1.5.0' ); 
    20112186} 
    2012  
    20132187 
    20142188/** 
     
    20412215} 
    20422216 
    2043  
    20442217/** 
    20452218 * File validates against allowed set of defined rules. 
     
    20722245} 
    20732246 
    2074  
    20752247/** 
    20762248 * Determine if SSL is used. 
     
    20832255        return ( 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;  
    20842256} 
    2085  
    20862257 
    20872258/** 
     
    21052276} 
    21062277 
    2107  
    21082278/** 
    21092279 * Whether to force SSL used for the Administration Panels. 
     
    21262296} 
    21272297 
     2298/** 
     2299 * Guess the URL for the site. 
     2300 * 
     2301 * Will remove wp-admin links to retrieve only return URLs not in the wp-admin 
     2302 * directory. 
     2303 * 
     2304 * @since 2.6 
     2305 * 
     2306 * @return string 
     2307 */ 
     2308function wp_guess_url() { 
     2309        if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { 
     2310                $url = WP_SITEURL; 
     2311        } else { 
     2312                $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
     2313                $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     2314        } 
     2315        return $url; 
     2316} 
     2317 
    21282318?> 
  • trunk/wp-includes/js/jquery/suggest.js

    r1328 r1344  
    11/* 
    2  *      jquery.suggest 1.1 - 2007-08-06 
     2 *      jquery.suggest 1.1b - 2007-08-06 
     3 * Patched by Mark Jaquith with Alexander Dick's "multiple items" patch to allow for auto-suggesting of more than one tag before submitting 
     4 * See: http://www.vulgarisoip.com/2007/06/29/jquerysuggest-an-alternative-jquery-based-autocomplete-library/#comment-7228 
    35 *       
    46 *      Uses code and techniques from following libraries: 
     
    114116                        var q = $.trim($input.val()); 
    115117 
     118                        if ( options.multiple ) { 
     119                                var multipleSepPos = q.lastIndexOf(options.multipleSep); 
     120                                if ( multipleSepPos != -1 ) { 
     121                                        q = q.substr(multipleSepPos + options.multipleSep.length); 
     122                                } 
     123                        } 
    116124                        if (q.length >= options.minchars) { 
    117125                                 
     
    246254                 
    247255                        if ($currentResult) { 
    248                                 $input.val($currentResult.text()); 
     256                                if ( options.multiple ) { 
     257                                        if ( $input.val().indexOf(options.multipleSep) != -1 ) { 
     258                                                $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ); 
     259                                        } else { 
     260                                                $currentVal = ""; 
     261                                        } 
     262