From 87c4f3a17f5f6e8526200d07257b6bb3dee5997d Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 3 Sep 2007 23:19:20 +0000 Subject: [PATCH] Strip lines that contain only whitespace down to newlines. git-svn-id: http://svn.automattic.com/wordpress/trunk@6025 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/import/jkw.php | 100 +++++++++++++++---------------- wp-admin/import/utw.php | 2 +- wp-admin/includes/misc.php | 4 +- wp-admin/includes/upgrade.php | 2 +- wp-app.php | 22 +++---- wp-includes/atomlib.php | 4 +- wp-includes/bookmark.php | 2 +- wp-includes/feed.php | 4 +- wp-includes/functions.php | 2 +- wp-includes/general-template.php | 2 +- wp-includes/plugin.php | 2 +- wp-includes/query.php | 2 +- wp-includes/rss.php | 6 +- wp-includes/update.php | 6 +- wp-includes/widgets.php | 60 +++++++++---------- wp-settings.php | 2 +- 16 files changed, 111 insertions(+), 111 deletions(-) diff --git a/wp-admin/import/jkw.php b/wp-admin/import/jkw.php index 8480b42c9..fddfd6247 100644 --- a/wp-admin/import/jkw.php +++ b/wp-admin/import/jkw.php @@ -1,17 +1,17 @@ '; echo '

'.__('Import Jerome’s Keywords').'

'; echo '

'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

'; } - + function footer() { echo ''; } - + function greet() { echo '
'; echo '

'.__('Howdy! This imports tags from an existing Jerome’s Keywords installation into this blog using the new WordPress native tagging structure.').'

'; @@ -28,18 +28,18 @@ class JeromesKeyword_Import { echo ''; echo '
'; } - - + + function dispatch () { if ( empty( $_GET['step'] ) ) { $step = 0; } else { $step = (int) $_GET['step']; } - + // load the header $this->header(); - + switch ( $step ) { case 0 : $this->greet(); @@ -68,18 +68,18 @@ class JeromesKeyword_Import { $this->done(); break; } - + // load the footer $this->footer(); } - - + + function check_V1_post_keyword ( $precheck = true ) { global $wpdb; - + echo '
'; echo '

'.__('Reading Jerome’s Keywords Tags…').'

'; - + // import Jerome's Keywords tags $qry = "SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'"; $metakeys = $wpdb->get_results($qry); @@ -89,9 +89,9 @@ class JeromesKeyword_Import { } else { $count = count($metakeys); echo '

' . sprintf( __('Done! %s posts with tags were read.'), $count ) . '

'; - + echo ''; - + } - + echo '
'; wp_nonce_field('import-jkw'); echo '

'; echo '
'; echo '
'; } - - + + function check_V2_post_keyword ( $precheck = true ) { global $wpdb; - + echo '
'; echo '

'.__('Reading Jerome’s Keywords Tags…').'

'; - + // import Jerome's Keywords tags $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1); $qry = "SELECT post_id, tag_name FROM $tablename"; @@ -139,12 +139,12 @@ class JeromesKeyword_Import { else { $count = count($metakeys); echo '

' . sprintf( __('Done! %s tags were read.'), $count ) . '

'; - + echo ''; - + } - + echo '
'; wp_nonce_field('import-jkw'); echo '

'; echo '
'; echo '
'; } - - + + function cleanup_V2_import ( ) { global $wpdb; - + /* options from V2.0a (jeromes-keywords.php) */ $options = array( 'version' => '2.0', // keywords options version 'keywords_table' => 'jkeywords', // table where keywords/tags are stored 'query_varname' => 'tag', // HTTP var name used for tag searches 'template' => 'keywords.php', // template file to use for displaying tag queries - + 'meta_always_include' => '', // meta keywords to always include 'meta_includecats' => 'default', // default' => include cats in meta keywords only for home page // all' => includes cats on every page, none' => never included - + 'meta_autoheader' => '1', // automatically output meta keywords in header 'search_strict' => '1', // returns only exact tag matches if true 'use_feed_cats' => '1', // insert tags into feeds as categories - + /* post tag options */ 'post_linkformat' => '', // post tag format (initialized to $link_localsearch) 'post_tagseparator' => ', ', // tag separator character(s) 'post_includecats' => '0', // include categories in post's tag list 'post_notagstext' => 'none', // text to display if no tags found - + /* tag cloud options */ 'cloud_linkformat' => '', // post tag format (initialized to $link_tagcloud) 'cloud_tagseparator' => ' ', // tag separator character(s) @@ -199,39 +199,39 @@ class JeromesKeyword_Import { 'cloud_scalemax' => '0', // maximum value for count scaling (no scaling if zero) 'cloud_scalemin' => '0' // minimum value for count scaling ); - + $tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1); - + $wpdb->query('DROP TABLE IF EXISTS ' . $tablename); - + foreach($options as $optname => $optval) { delete_option('jkeywords_' . $optname); } - + $this->done(); } - - + + function done ( ) { echo '
'; echo '

'.__('Import Complete!').'

'; echo '
'; } - - + + function JeromesKeyword_Import ( ) { - + // Nothing. - + } - + } - - + + // create the import object $jkw_import = new JeromesKeyword_Import(); - + // add it to the import page! register_importer('jkw', 'Jerome’s Keywords', __('Import Jerome’s Keywords into the new native tagging structure.'), array($jkw_import, 'dispatch')); - + ?> diff --git a/wp-admin/import/utw.php b/wp-admin/import/utw.php index 52e347ad1..b321f25af 100644 --- a/wp-admin/import/utw.php +++ b/wp-admin/import/utw.php @@ -31,7 +31,7 @@ class UTW_Import { } else { $step = (int) $_GET['step']; } - + if ( $step > 1 ) check_admin_referer('import-utw'); diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index b9550cb2f..5902c4e8b 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -97,7 +97,7 @@ function insert_with_markers( $filename, $marker, $insertion ) { function save_mod_rewrite_rules() { global $wp_rewrite; - + $home_path = get_home_path(); $htaccess_file = $home_path.'.htaccess'; @@ -109,7 +109,7 @@ function save_mod_rewrite_rules() { return insert_with_markers( $htaccess_file, 'WordPress', $rules ); } } - + return false; } diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 61066dcf4..89ae58b00 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -615,7 +615,7 @@ function upgrade_230() { $name = $wpdb->escape($category->cat_name); $slug = sanitize_title($name); $term_group = 0; - + // Associate terms with the same slug in a term group and make slugs unique. if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) { $term_group = $exists[0]->term_group; diff --git a/wp-app.php b/wp-app.php index 1eb0418ca..5e95dfc5b 100644 --- a/wp-app.php +++ b/wp-app.php @@ -127,7 +127,7 @@ class AtomServer { if(strlen($path) == 0 || $path == '/') { $this->redirect($this->get_service_url()); } - + // dispatch foreach($this->selectors as $regex => $funcs) { if(preg_match($regex, $path, $matches)) { @@ -220,17 +220,17 @@ EOD; } $entry = array_pop($parser->feed->entries); - + log_app('Received entry:', print_r($entry,true)); - + $catnames = array(); foreach($entry->categories as $cat) array_push($catnames, $cat["term"]); - + $wp_cats = get_categories(array('hide_empty' => false)); - + $post_category = array(); - + foreach($wp_cats as $cat) { if(in_array($cat->cat_name, $catnames)) array_push($post_category, $cat->cat_ID); @@ -252,7 +252,7 @@ EOD; $pubtimes = $this->get_publish_time($entry); $post_date = $pubtimes[0]; $post_date_gmt = $pubtimes[1]; - + if ( isset( $_SERVER['HTTP_SLUG'] ) ) $post_name = $_SERVER['HTTP_SLUG']; @@ -1113,21 +1113,21 @@ EOD; } function rfc3339_str2time($str) { - + $match = false; 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)) return false; - + if($match[3] == 'Z') $match[3] == '+0000'; - + return strtotime($match[1] . " " . $match[2] . " " . $match[3]); } function get_publish_time($entry) { $pubtime = $this->rfc3339_str2time($entry->published); - + if(!$pubtime) { return array(current_time('mysql'),current_time('mysql',1)); } else { diff --git a/wp-includes/atomlib.php b/wp-includes/atomlib.php index 020f0bfcb..b72038523 100644 --- a/wp-includes/atomlib.php +++ b/wp-includes/atomlib.php @@ -47,7 +47,7 @@ class AtomParser { var $current; function AtomParser() { - + $this->feed = new AtomFeed(); $this->current = null; $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";'); @@ -87,7 +87,7 @@ class AtomParser { $fp = fopen($this->FILE, "r"); while ($data = fread($fp, 4096)) { if($this->debug) $this->content .= $data; - + if(!xml_parse($parser, $data, feof($fp))) { trigger_error(sprintf(__('XML error: %s at line %d')."\n", xml_error_string(xml_get_error_code($xml_parser)), diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index 0c108fac8..997847c3d 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -8,7 +8,7 @@ function get_bookmark($bookmark_id, $output = OBJECT, $filter = 'raw') { $link->link_category = array_unique( wp_get_object_terms($link_id, 'link_category', 'fields=ids') ); $link = sanitize_bookmark($link, $filter); - + if ( $output == OBJECT ) { return $link; } elseif ( $output == ARRAY_A ) { diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 109416801..cac3b09dc 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -186,10 +186,10 @@ function get_tag_feed_link($tag_id, $feed = 'rss2') { $tag_id = (int) $tag_id; $tag = get_tag($tag_id); - + if ( empty($tag) || is_wp_error($tag) ) return false; - + $permalink_structure = get_option('permalink_structure'); if ( '' == $permalink_structure ) { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 8d6860cef..d031dd769 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -406,7 +406,7 @@ function gzip_compression() { if ( ( ini_get( 'zlib.output_compression' ) == 'On' || ini_get( 'zlib.output_compression_level' ) > 0 ) || ini_get( 'output_handler' ) == 'ob_gzhandler' ) { return false; } - + if ( extension_loaded( 'zlib' ) ) { ob_start( 'ob_gzhandler' ); } diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 0791e80d6..23cea80a2 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -147,7 +147,7 @@ function get_bloginfo($show = '', $filter = 'raw') { strpos($show, 'directory') === false && strpos($show, 'home') === false) $url = false; - + if ( 'display' == $filter ) { if ( $url ) $output = apply_filters('bloginfo_url', $output, $show); diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index 43a8aba03..6da174f79 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -286,7 +286,7 @@ function register_deactivation_hook($file, $function) { function _wp_filter_build_unique_id($tag, $function, $priority = 10) { global $wp_filter; - + // If function then just skip all of the tests and not overwrite the following. // Static Calling if( is_string($function) ) diff --git a/wp-includes/query.php b/wp-includes/query.php index 1b31d1317..fabaa75f6 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -421,7 +421,7 @@ class WP_Query { $array_keys = array('category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and'); - + foreach ( $array_keys as $key ) { if ( !isset($array[$key])) $array[$key] = array(); diff --git a/wp-includes/rss.php b/wp-includes/rss.php index ac747a2d9..5dd5c6de0 100644 --- a/wp-includes/rss.php +++ b/wp-includes/rss.php @@ -827,11 +827,11 @@ if ( !function_exists('wp_rss') ) : function wp_rss( $url, $num_items = -1 ) { if ( $rss = fetch_rss( $url ) ) { echo ''; } else { _e( 'An error has occurred, which probably means the feed is down. Try again later.' ); diff --git a/wp-includes/update.php b/wp-includes/update.php index d19726e0e..9903f753c 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -8,7 +8,7 @@ function wp_version_check() { global $wp_version; $php_version = phpversion(); - + $current = get_option( 'update_core' ); $locale = get_locale(); @@ -35,11 +35,11 @@ function wp_version_check() { while ( !feof( $fs ) ) $response .= fgets( $fs, 1160 ); // One TCP-IP packet fclose( $fs ); - + $response = explode("\r\n\r\n", $response, 2); $body = trim( $response[1] ); $body = str_replace(array("\r\n", "\r"), "\n", $body); - + $returns = explode("\n", $body); $new_option->response = $returns[0]; diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 543e9c726..7227d7295 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -606,11 +606,11 @@ function wp_widget_text_register() { function wp_widget_categories($args, $number = 1) { extract($args); $options = get_option('widget_categories'); - + $c = $options[$number]['count'] ? '1' : '0'; $h = $options[$number]['hierarchical'] ? '1' : '0'; $d = $options[$number]['dropdown'] ? '1' : '0'; - + $title = empty($options[$number]['title']) ? __('Categories') : $options[$number]['title']; echo $before_widget; @@ -646,60 +646,60 @@ function wp_widget_categories($args, $number = 1) { function wp_widget_categories_control( $number ) { $options = $newoptions = get_option('widget_categories'); - + if ( !is_array( $options ) ) { $options = $newoptions = get_option( 'widget_categories' ); } - + if ( $_POST['categories-submit-' . $number] ) { $newoptions[$number]['count'] = isset($_POST['categories-count-' . $number]); $newoptions[$number]['hierarchical'] = isset($_POST['categories-hierarchical-' . $number]); $newoptions[$number]['dropdown'] = isset($_POST['categories-dropdown-' . $number]); $newoptions[$number]['title'] = strip_tags(stripslashes($_POST['categories-title-' . $number])); } - + if ( $options != $newoptions ) { $options = $newoptions; update_option('widget_categories', $options); } - + $title = attribute_escape( $options[$number]['title'] ); ?>

- +

- +

- +

- + 9 ) { $number = 9; } elseif ( $number < 1 ) { $number = 1; } - + $newoptions['number'] = $number; } - + if ( $newoptions != $options ) { $options = $newoptions; update_option( 'widget_categories', $options ); @@ -770,27 +770,27 @@ function wp_widget_categories_register() { if ( !isset($options['number']) ) $options = wp_widget_categories_upgrade(); $number = (int) $options['number']; - + if ( $number > 9 ) { $number = 9; } elseif ( $number < 1 ) { $number = 1; } - + $dims = array( 'width' => 350, 'height' => 170 ); $class = array( 'classname' => 'widget_catgories' ); - + for ( $i = 1; $i <= 9; $i++ ) { $name = sprintf( __( 'Categories %d' ), $i ); $id = 'categories-' . $i; - + $widget_callback = ( $i <= $number ) ? 'wp_widget_categories' : ''; $control_callback = ( $i <= $number ) ? 'wp_widget_categories_control' : ''; - + wp_register_sidebar_widget( $id, $name, $widget_callback, $class, $i ); wp_register_widget_control( $id, $name, $control_callback, $dims, $i ); } - + add_action( 'sidebar_admin_setup', 'wp_widget_categories_setup' ); add_action( 'sidebar_admin_page', 'wp_widget_categories_page' ); } @@ -985,7 +985,7 @@ function wp_widget_rss($args, $number = 1) { } else { echo ''; } - + echo $after_widget; } @@ -1079,37 +1079,37 @@ function wp_widgets_init() { return; $GLOBALS['wp_register_widget_defaults'] = true; - + $dims90 = array( 'height' => 90, 'width' => 300 ); $dims100 = array( 'height' => 100, 'width' => 300 ); $dims150 = array( 'height' => 150, 'width' => 300 ); - + $class = array('classname' => 'widget_pages'); wp_register_sidebar_widget('pages', __('Pages'), 'wp_widget_pages', $class); wp_register_widget_control('pages', __('Pages'), 'wp_widget_pages_control', $dims150); - + $class['classname'] = 'widget_calendar'; wp_register_sidebar_widget('calendar', __('Calendar'), 'wp_widget_calendar', $class); wp_register_widget_control('calendar', __('Calendar'), 'wp_widget_calendar_control', $dims90); - + $class['classname'] = 'widget_archives'; wp_register_sidebar_widget('archives', __('Archives'), 'wp_widget_archives', $class); wp_register_widget_control('archives', __('Archives'), 'wp_widget_archives_control', $dims100); - + $class['classname'] = 'widget_links'; wp_register_sidebar_widget('links', __('Links'), 'wp_widget_links', $class); - + $class['classname'] = 'widget_meta'; wp_register_sidebar_widget('meta', __('Meta'), 'wp_widget_meta', $class); wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control', $dims90); - + $class['classname'] = 'widget_search'; wp_register_sidebar_widget('search', __('Search'), 'wp_widget_search', $class); - + $class['classname'] = 'widget_recent_entries'; wp_register_sidebar_widget('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries', $class); wp_register_widget_control('recent-posts', __('Recent Posts'), 'wp_widget_recent_entries_control', $dims90); - + wp_widget_categories_register(); wp_widget_text_register(); wp_widget_rss_register(); diff --git a/wp-settings.php b/wp-settings.php index c4fafd7ab..b8b745533 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -42,7 +42,7 @@ if ( empty( $_SERVER['REQUEST_URI'] ) ) { $_SERVER['REQUEST_URI'] = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')) . '/'; else $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; - + // Append the query string if it exists and isn't null if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];