Changeset 6025

Show
Ignore:
Timestamp:
09/03/07 23:19:20 (10 months ago)
Author:
ryan
Message:

Strip lines that contain only whitespace down to newlines.

Files:

Legend:

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

    r5984 r6025  
    22 
    33class JeromesKeyword_Import { 
    4      
     4 
    55    function header()  { 
    66        echo '<div class="wrap">'; 
     
    3030    } 
    3131 
    32      
     32 
    3333    function dispatch () { 
    3434        if ( empty( $_GET['step'] ) ) { 
     
    3737            $step = (int) $_GET['step']; 
    3838        } 
    39          
     39 
    4040        // load the header 
    4141        $this->header(); 
    42          
     42 
    4343        switch ( $step ) { 
    4444            case 0 : 
     
    6969                break; 
    7070        } 
    71          
     71 
    7272        // load the footer 
    7373        $this->footer(); 
    7474    } 
    75      
    76      
     75 
     76 
    7777    function check_V1_post_keyword ( $precheck = true ) { 
    7878        global $wpdb; 
    79          
     79 
    8080        echo '<div class="narrow">'; 
    8181        echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>'; 
    82          
     82 
    8383        // import Jerome's Keywords tags  
    8484        $qry = "SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'"; 
     
    114114 
    115115        } 
    116          
     116 
    117117        echo '<form action="admin.php?import=jkw&amp;step='.($precheck? 2:6).'" method="post">'; 
    118118        wp_nonce_field('import-jkw'); 
     
    125125    function check_V2_post_keyword ( $precheck = true ) { 
    126126        global $wpdb; 
    127          
     127 
    128128        echo '<div class="narrow">'; 
    129129        echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>'; 
    130          
     130 
    131131            // import Jerome's Keywords tags  
    132132            $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1); 
     
    140140                $count = count($metakeys); 
    141141            echo '<p>' . sprintf( __('Done! <strong>%s</strong> tags were read.'), $count ) . '<br /></p>'; 
    142              
     142 
    143143            echo '<ul>'; 
    144144 
    145145                foreach($metakeys as $post_meta) { 
    146146                    $keyword = addslashes(trim($post_meta->tag_name)); 
    147                      
     147 
    148148                    if ($keyword != ''){ 
    149149                        echo '<li>' . $post_meta->post_id . '&nbsp;-&nbsp;' . $keyword . '</li>'; 
     
    157157 
    158158        } 
    159          
     159 
    160160        echo '<form action="admin.php?import=jkw&amp;step='.($precheck? 4:5).'" method="post">'; 
    161161        wp_nonce_field('import-jkw'); 
     
    175175                    'query_varname'  => 'tag',          // HTTP var name used for tag searches 
    176176                    'template'       => 'keywords.php', // template file to use for displaying tag queries 
    177                  
     177 
    178178                    'meta_always_include' => '',        // meta keywords to always include 
    179179                    'meta_includecats' => 'default',    // default' => include cats in meta keywords only for home page 
    180180                                                        // all' => includes cats on every page, none' => never included 
    181                      
     181 
    182182                    'meta_autoheader'    => '1',        // automatically output meta keywords in header 
    183183                    'search_strict'      => '1',        // returns only exact tag matches if true 
    184184                    'use_feed_cats'      => '1',        // insert tags into feeds as categories 
    185                  
     185 
    186186                    /* post tag options */ 
    187187                    'post_linkformat'    => '',         // post tag format (initialized to $link_localsearch) 
     
    189189                    'post_includecats'   => '0',        // include categories in post's tag list 
    190190                    'post_notagstext'    => 'none',     // text to display if no tags found 
    191                      
     191 
    192192                    /* tag cloud options */ 
    193193                    'cloud_linkformat'   => '',         // post tag format (initialized to $link_tagcloud) 
     
    200200                    'cloud_scalemin'     => '0'         // minimum value for count scaling 
    201201                    ); 
    202                  
     202 
    203203            $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1); 
    204          
     204 
    205205        $wpdb->query('DROP TABLE IF EXISTS ' . $tablename); 
    206          
     206 
    207207                foreach($options as $optname => $optval) { 
    208208                    delete_option('jkeywords_' . $optname); 
    209209                } 
    210                  
     210 
    211211        $this->done(); 
    212212    } 
    213      
    214      
     213 
     214 
    215215    function done ( ) { 
    216216        echo '<div class="narrow">'; 
     
    218218        echo '</div>'; 
    219219    } 
    220      
     220 
    221221 
    222222    function JeromesKeyword_Import ( ) { 
    223          
     223 
    224224        // Nothing. 
    225          
    226     } 
    227      
     225 
     226    } 
     227 
    228228} 
    229229 
  • trunk/wp-admin/import/utw.php

    r5941 r6025  
    3232            $step = (int) $_GET['step']; 
    3333        } 
    34          
     34 
    3535        if ( $step > 1 ) 
    3636            check_admin_referer('import-utw'); 
  • trunk/wp-admin/includes/misc.php

    r5809 r6025  
    9898function save_mod_rewrite_rules() { 
    9999    global $wp_rewrite; 
    100      
     100 
    101101    $home_path = get_home_path(); 
    102102    $htaccess_file = $home_path.'.htaccess'; 
     
    110110        } 
    111111    } 
    112      
     112 
    113113    return false; 
    114114} 
  • trunk/wp-admin/includes/upgrade.php

    r5943 r6025  
    616616            $slug = sanitize_title($name); 
    617617            $term_group = 0; 
    618      
     618 
    619619            // Associate terms with the same slug in a term group and make slugs unique. 
    620620            if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) { 
  • trunk/wp-app.php

    r6010 r6025  
    128128            $this->redirect($this->get_service_url()); 
    129129        } 
    130      
     130 
    131131        // dispatch 
    132132        foreach($this->selectors as $regex => $funcs) { 
     
    221221 
    222222        $entry = array_pop($parser->feed->entries); 
    223          
     223 
    224224        log_app('Received entry:', print_r($entry,true)); 
    225          
     225 
    226226        $catnames = array(); 
    227227        foreach($entry->categories as $cat) 
    228228            array_push($catnames, $cat["term"]); 
    229          
     229 
    230230        $wp_cats = get_categories(array('hide_empty' => false)); 
    231          
     231 
    232232        $post_category = array(); 
    233          
     233 
    234234        foreach($wp_cats as $cat) { 
    235235            if(in_array($cat->cat_name, $catnames)) 
     
    253253        $post_date = $pubtimes[0]; 
    254254        $post_date_gmt = $pubtimes[1]; 
    255          
     255 
    256256        if ( isset( $_SERVER['HTTP_SLUG'] ) ) 
    257257            $post_name = $_SERVER['HTTP_SLUG']; 
     
    11141114 
    11151115    function rfc3339_str2time($str) { 
    1116         
     1116 
    11171117        $match = false; 
    11181118        if(!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match)) 
    11191119            return false; 
    1120      
     1120 
    11211121        if($match[3] == 'Z') 
    11221122            $match[3] == '+0000'; 
    1123      
     1123 
    11241124        return strtotime($match[1] . " " . $match[2] . " " . $match[3]); 
    11251125    }        
     
    11281128 
    11291129        $pubtime = $this->rfc3339_str2time($entry->published); 
    1130         
     1130 
    11311131        if(!$pubtime) { 
    11321132            return array(current_time('mysql'),current_time('mysql',1)); 
  • trunk/wp-includes/atomlib.php

    r6010 r6025  
    4848 
    4949    function AtomParser() { 
    50          
     50 
    5151        $this->feed = new AtomFeed(); 
    5252        $this->current = null; 
     
    8888        while ($data = fread($fp, 4096)) { 
    8989            if($this->debug) $this->content .= $data; 
    90              
     90 
    9191            if(!xml_parse($parser, $data, feof($fp))) { 
    9292                trigger_error(sprintf(__('XML error: %s at line %d')."\n", 
  • trunk/wp-includes/bookmark.php

    r5997 r6025  
    99 
    1010    $link = sanitize_bookmark($link, $filter); 
    11      
     11 
    1212    if ( $output == OBJECT ) { 
    1313        return $link; 
  • trunk/wp-includes/feed.php

    r6001 r6025  
    187187 
    188188    $tag = get_tag($tag_id); 
    189      
     189 
    190190    if ( empty($tag) || is_wp_error($tag) ) 
    191191        return false; 
    192          
     192 
    193193    $permalink_structure = get_option('permalink_structure'); 
    194194 
  • trunk/wp-includes/functions.php

    r6008 r6025  
    407407        return false; 
    408408    } 
    409      
     409 
    410410    if ( extension_loaded( 'zlib' ) ) { 
    411411        ob_start( 'ob_gzhandler' ); 
  • trunk/wp-includes/general-template.php

    r6024 r6025  
    148148        strpos($show, 'home') === false) 
    149149        $url = false; 
    150              
     150 
    151151    if ( 'display' == $filter ) { 
    152152        if ( $url ) 
  • trunk/wp-includes/plugin.php

    r5958 r6025  
    287287{ 
    288288    global $wp_filter; 
    289      
     289 
    290290    // If function then just skip all of the tests and not overwrite the following. 
    291291    // Static Calling 
  • trunk/wp-includes/query.php

    r6022 r6025  
    422422        $array_keys = array('category__in', 'category__not_in', 'category__and', 
    423423            'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and'); 
    424          
     424 
    425425        foreach ( $array_keys as $key ) { 
    426426            if ( !isset($array[$key])) 
  • trunk/wp-includes/rss.php

    r5859 r6025  
    828828    if ( $rss = fetch_rss( $url ) ) { 
    829829        echo '<ul>'; 
    830          
     830 
    831831        if ( $num_items !== -1 ) { 
    832832            $rss->items = array_slice( $rss->items, 0, $num_items ); 
    833833        } 
    834          
     834 
    835835        foreach ( $rss->items as $item ) { 
    836836            printf( 
     
    841841            ); 
    842842        } 
    843          
     843 
    844844        echo '</ul>'; 
    845845    } else { 
  • trunk/wp-includes/update.php

    r5900 r6025  
    99    global $wp_version; 
    1010    $php_version = phpversion(); 
    11      
     11 
    1212    $current = get_option( 'update_core' ); 
    1313    $locale = get_locale(); 
     
    3636            $response .= fgets( $fs, 1160 ); // One TCP-IP packet 
    3737        fclose( $fs ); 
    38      
     38 
    3939        $response = explode("\r\n\r\n", $response, 2); 
    4040        $body = trim( $response[1] ); 
    4141        $body = str_replace(array("\r\n", "\r"), "\n", $body); 
    42      
     42 
    4343        $returns = explode("\n", $body); 
    4444 
  • trunk/wp-includes/widgets.php

    r5973 r6025  
    607607    extract($args); 
    608608    $options = get_option('widget_categories'); 
    609      
     609 
    610610    $c = $options[$number]['count'] ? '1' : '0'; 
    611611    $h = $options[$number]['hierarchical'] ? '1' : '0'; 
    612612    $d = $options[$number]['dropdown'] ? '1' : '0'; 
    613      
     613 
    614614    $title = empty($options[$number]['title']) ? __('Categories') : $options[$number]['title']; 
    615615 
     
    647647function wp_widget_categories_control( $number ) { 
    648648    $options = $newoptions = get_option('widget_categories'); 
    649      
     649 
    650650    if ( !is_array( $options ) ) { 
    651651        $options = $newoptions = get_option( 'widget_categories' ); 
    652652    } 
    653      
     653 
    654654    if ( $_POST['categories-submit-' . $number] ) { 
    655655        $newoptions[$number]['count'] = isset($_POST['categories-count-' . $number]); 
     
    658658        $newoptions[$number]['title'] = strip_tags(stripslashes($_POST['categories-title-' . $number])); 
    659659    } 
    660      
     660 
    661661    if ( $options != $newoptions ) { 
    662662        $options = $newoptions; 
    663663        update_option('widget_categories', $options); 
    664664    } 
    665      
     665 
    666666    $title = attribute_escape( $options[$number]['title'] ); 
    667667?> 
     
    669669                <?php _e( 'Title:' ); ?> <input style="width:300px" id="categories-title-<?php echo $number; ?>" name="categories-title-<?php echo $number; ?>" type="text" value="<?php echo $title; ?>" /> 
    670670            </label></p> 
    671              
     671 
    672672            <p><label for="categories-dropdown-<?php echo $number; ?>"> 
    673673                <input type="checkbox" class="checkbox" id="categories-dropdown-<?php echo $number; ?>" name="categories-dropdown-<?php echo $number; ?>"<?php echo $options[$number]['dropdown'] ? ' checked="checked"' : ''; ?> /> <?php _e( 'Show as dropdown' ); ?> 
    674674            </label></p> 
    675              
     675 
    676676            <p><label for="categories-count-<?php echo $number; ?>"> 
    677677                <input type="checkbox" class="checkbox" id="categories-count-<?php echo $number; ?>" name="categories-count-<?php echo $number; ?>"<?php echo $options[$number]['count'] ? ' checked="checked"' : ''; ?> /> <?php _e( 'Show post counts' ); ?> 
    678678            </label></p> 
    679              
     679 
    680680            <p><label for="categories-hierarchical-<?php echo $number; ?>"> 
    681681                <input type="checkbox" class="checkbox" id="categories-hierarchical-<?php echo $number; ?>" name="categories-hierarchical-<?php echo $number; ?>"<?php echo $options[$number]['hierarchical'] ? ' checked="checked"' : ''; ?> /> <?php _e( 'Show hierarchy' ); ?> 
    682682            </label></p> 
    683              
     683 
    684684            <input type="hidden" id="categories-submit-<?php echo $number; ?>" name="categories-submit-<?php echo $number; ?>" value="1" /> 
    685685<?php 
     
    688688function wp_widget_categories_setup() { 
    689689    $options = $newoptions = get_option( 'widget_categories' ); 
    690      
     690 
    691691    if ( isset( $_POST['categories-number-submit'] ) ) { 
    692692        $number = (int) $_POST['categories-number']; 
    693          
     693 
    694694        if ( $number > 9 ) { 
    695695            $number = 9; 
     
    697697            $number = 1; 
    698698        } 
    699          
     699 
    700700        $newoptions['number'] = $number; 
    701701    } 
    702      
     702 
    703703    if ( $newoptions != $options ) { 
    704704        $options = $newoptions; 
     
    771771        $options = wp_widget_categories_upgrade(); 
    772772    $number = (int) $options['number']; 
    773      
     773 
    774774    if ( $number > 9 ) { 
    775775        $number = 9; 
     
    777777        $number = 1; 
    778778    } 
    779      
     779 
    780780    $dims = array( 'width' => 350, 'height' => 170 ); 
    781781    $class = array( 'classname' => 'widget_catgories' ); 
    782      
     782 
    783783    for ( $i = 1; $i <= 9; $i++ ) { 
    784784        $name = sprintf( __( 'Categories %d' ), $i ); 
    785785        $id = 'categories-' . $i; 
    786          
     786 
    787787        $widget_callback = ( $i <= $number ) ? 'wp_widget_categories' : ''; 
    788788        $control_callback = ( $i <= $number ) ? 'wp_widget_categories_control' : ''; 
    789          
     789 
    790790        wp_register_sidebar_widget( $id, $name, $widget_callback, $class, $i ); 
    791791        wp_register_widget_control( $id, $name, $control_callback, $dims, $i ); 
    792792    } 
    793      
     793 
    794794    add_action( 'sidebar_admin_setup', 'wp_widget_categories_setup' ); 
    795795    add_action( 'sidebar_admin_page', 'wp_widget_categories_page' ); 
     
    986986        echo '<ul><li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li></ul>'; 
    987987    } 
    988      
     988 
    989989    echo $after_widget; 
    990990} 
     
    10801080 
    10811081    $GLOBALS['wp_register_widget_defaults'] = true; 
    1082      
     1082 
    10831083    $dims90 = array( 'height' => 90, 'width' => 300 ); 
    10841084    $dims100 = array( 'height' => 100, 'width' => 300 ); 
    10851085    $dims150 = array( 'height' => 150, 'width' => 300 ); 
    1086      
     1086 
    10871087    $class = array('classname' => 'widget_pages'); 
    10881088    wp_register_sidebar_widget('pages', __('Pages'), 'wp_widget_pages', $class); 
    10891089    wp_register_widget_control('pages', __('Pages'), 'wp_widget_pages_control', $dims150); 
    1090      
     1090 
    10911091    $class['classname'] = 'widget_calendar'; 
    10921092    wp_register_sidebar_widget('calendar', __('Calendar'), 'wp_widget_calendar', $class); 
    10931093    wp_register_widget_control('calendar', __('Calendar'), 'wp_widget_calendar_control', $dims90); 
    1094      
     1094 
    10951095    $class['classname'] = 'widget_archives'; 
    10961096    wp_register_sidebar_widget('archives', __('Archives'), 'wp_widget_archives', $class); 
    10971097    wp_register_widget_control('archives', __('Archives'), 'wp_widget_archives_control', $dims100); 
    1098      
     1098 
    10991099    $class['classname'] = 'widget_links'; 
    11001100    wp_register_sidebar_widget('links', __('Links'), 'wp_widget_links', $class); 
    1101      
     1101 
    11021102    $class['classname'] = 'widget_meta'; 
    11031103    wp_register_sidebar_widget('meta', __('Meta'), 'wp_widget_meta', $class); 
    11041104    wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control', $dims90); 
    1105      
     1105 
    11061106    $class['classname'] = 'widget_search'; 
    11071107    wp_register_sidebar_widget('search', __('Search'), 'wp_widget_search', $class); 
    1108      
     1108 
    11091109    $class['classname'] = 'widget_recent_entries'; 
    11101110    wp_register_sidebar_widget('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries', $class); 
    11111111    wp_register_widget_control('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries_control', $dims90); 
    1112      
     1112 
    11131113    wp_widget_categories_register(); 
    11141114    wp_widget_text_register(); 
  • trunk/wp-settings.php

    r6017 r6025  
    4343        else 
    4444            $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; 
    45              
     45 
    4646        // Append the query string if it exists and isn't null 
    4747        if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {