From d0f79bb3f267f45c65d3985d559ab3f5525481d1 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Tue, 27 Feb 2007 15:24:54 +0000 Subject: [PATCH] trailing tabs and whitespace cleanup. git-svn-id: http://svn.automattic.com/wordpress/trunk@4953 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- app.php | 44 ++++---- wp-admin/admin-ajax.php | 4 +- wp-admin/admin-functions.php | 18 ++-- wp-admin/custom-header.php | 8 +- wp-admin/import/blogger.php | 16 +-- wp-admin/import/greymatter.php | 12 +-- wp-admin/link-import.php | 112 ++++++++++----------- wp-admin/menu.php | 4 +- wp-admin/options.php | 4 +- wp-admin/page.php | 2 +- wp-admin/post.php | 4 +- wp-admin/upgrade-schema.php | 4 +- wp-admin/upload-functions.php | 6 +- wp-admin/upload-js.php | 4 +- wp-includes/bookmark-template.php | 2 +- wp-includes/bookmark.php | 2 +- wp-includes/cache.php | 4 +- wp-includes/category-template.php | 2 +- wp-includes/classes.php | 18 ++-- wp-includes/cron.php | 8 +- wp-includes/feed-atom-comments.php | 8 +- wp-includes/feed-atom.php | 2 +- wp-includes/formatting.php | 2 +- wp-includes/general-template.php | 16 +-- wp-includes/gettext.php | 2 +- wp-includes/js/autosave-js.php | 14 +-- wp-includes/js/tinymce/tiny_mce_config.php | 2 +- wp-includes/link-template.php | 2 +- wp-includes/pluggable.php | 2 +- wp-includes/post-template.php | 2 +- wp-includes/post.php | 8 +- wp-includes/query.php | 44 ++++---- wp-includes/theme.php | 6 +- wp-includes/wp-db.php | 8 +- wp-login.php | 4 +- xmlrpc.php | 2 +- 36 files changed, 200 insertions(+), 202 deletions(-) diff --git a/app.php b/app.php index 7c2d82758c..b22bbd2406 100644 --- a/app.php +++ b/app.php @@ -23,7 +23,7 @@ if ($use_querystring) { $eid = (int) $_GET['eid']; $_SERVER['PATH_INFO'] = $action; - + if ($eid) { $_SERVER['PATH_INFO'] .= "/$eid"; } @@ -173,7 +173,7 @@ class AtomParser { } else if($tag == 'category') { array_push($this->entry->categories, $attrs); } - + $this->ns_decls = array(); } @@ -201,7 +201,7 @@ class AtomParser { } array_shift($this->ns_contexts); - + #print str_repeat(" ", $this->depth * $this->indent) . "end_element('$name')" ."\n"; $this->depth--; @@ -342,7 +342,7 @@ class AtomServer { exit(); } else { // only allow what we have handlers for... - $this->not_allowed(array_keys($funcs)); + $this->not_allowed(array_keys($funcs)); } } } @@ -453,7 +453,7 @@ EOD; } function put_post($postID) { - + // checked for valid content-types (atom+xml) // quick check and exit $this->get_accepted_content_type($this->atom_content_types); @@ -508,9 +508,9 @@ EOD; if(!current_user_can('edit_post', $postID)) { $this->auth_required('Sorry, you do not have the right to delete this post.'); } - + if ($entry['post_type'] == 'attachment') { - $this->delete_attachment($postID); + $this->delete_attachment($postID); } else { $result = wp_delete_post($postID); @@ -523,7 +523,7 @@ EOD; } } - + function get_attachment($postID = NULL) { global $entry; @@ -551,7 +551,7 @@ EOD; $bits .= fread($fp, 4096); } fclose($fp); - + $slug = ''; if ( isset( $_SERVER['HTTP_SLUG'] ) ) $slug = sanitize_file_name( $_SERVER['HTTP_SLUG'] ); @@ -564,7 +564,7 @@ EOD; $file = wp_upload_bits( $slug, NULL, $bits); log_app('wp_upload_bits returns:',print_r($file,true)); - + $url = $file['url']; $file = $file['file']; $filename = basename($file); @@ -718,7 +718,7 @@ EOD; } fclose($fp); fclose($localfp); - + log_app('function',"put_file($postID)"); $this->ok(); } @@ -760,7 +760,7 @@ EOD; $url = $this->get_categories_url(); echo $url; } - + function get_attachments_url($page = NULL) { global $use_querystring; $url = get_bloginfo('url') . '/' . $this->script_name; @@ -790,7 +790,7 @@ EOD; global $post; $postID = $GLOBALS['post']->ID; } - + if ($use_querystring) { $url = get_bloginfo('url') . '/' . $this->script_name . '?action=/' . $this->ENTRY_PATH . "&eid=$postID"; } else { @@ -812,7 +812,7 @@ EOD; global $post; $postID = $GLOBALS['post']->ID; } - + if ($use_querystring) { $url = get_bloginfo('url') . '/' . $this->script_name . '?action=/' . $this->MEDIA_SINGLE_PATH ."&eid=$postID"; } else { @@ -873,8 +873,8 @@ EOD; $page = 1; } $page = (int) $page; - - $count = get_option('posts_per_rss'); + + $count = get_option('posts_per_rss'); $query = "paged=$page&posts_per_page=$count&order=DESC"; if($post_type == 'attachment') { $query .= "&post_type=$post_type"; @@ -887,7 +887,7 @@ EOD; $wpdb = $GLOBALS['wpdb']; $blog_id = $GLOBALS['blog_id']; $post_cache = $GLOBALS['post_cache']; - + $total_count = $this->get_posts_count(); $last_page = (int) ceil($total_count / $count); @@ -1056,7 +1056,7 @@ $post = $GLOBALS['post']; header('Content-Type: text/plain'); exit; } - + function not_found() { log_app('Status','404: Not Found'); header('Content-Type: text/plain'); @@ -1077,7 +1077,7 @@ $post = $GLOBALS['post']; status_header('400'); exit; } - + function created($post_ID, $content, $post_type = 'post') { global $use_querystring; log_app('created()::$post_ID',"$post_ID, $post_type"); @@ -1151,7 +1151,7 @@ $post = $GLOBALS['post']; function authenticate() { $login_data = array(); $already_md5 = false; - + log_app("authenticate()",print_r($_ENV, true)); // if using mod_rewrite/ENV hack @@ -1209,7 +1209,7 @@ $post = $GLOBALS['post']; function process_conditionals() { - + if(empty($this->params)) return; if($_SERVER['REQUEST_METHOD'] == 'DELETE') return; @@ -1240,7 +1240,7 @@ $post = $GLOBALS['post']; // If string is empty, return 0. If not, attempt to parse into a timestamp $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0; - // Make a timestamp for our most recent modification... + // Make a timestamp for our most recent modification... $wp_modified_timestamp = strtotime($wp_last_modified); if ( ($client_last_modified && $client_etag) ? diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index c7b51d5f73..d3103d87f8 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -226,8 +226,8 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() $_POST['post_status'] = 'draft'; $_POST['post_category'] = explode(",", $_POST['catslist']); if($_POST['post_type'] == 'page' || empty($_POST['post_category'])) - unset($_POST['post_category']); - + unset($_POST['post_category']); + if($_POST['post_ID'] < 0) { $_POST['temp_ID'] = $_POST['post_ID']; $id = wp_write_post(); diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 91d4e1717e..dd136ceb74 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -681,7 +681,7 @@ function get_nested_categories( $default = 0, $parent = 0 ) { if ( count( $checked_categories ) == 0 ) { // No selected categories, strange $checked_categories[] = $default; - } + } } else { $checked_categories[] = $default; } @@ -737,7 +737,7 @@ function get_nested_link_categories( $default = 0, $parent = 0 ) { if ( count( $checked_categories ) == 0 ) { // No selected categories, strange $checked_categories[] = $default; - } + } } else { $checked_categories[] = $default; } @@ -778,7 +778,7 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { } $output = ob_get_contents(); ob_end_clean(); - + $output = apply_filters('cat_rows', $output); echo $output; @@ -1316,7 +1316,7 @@ function user_can_access_admin_page() { if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) return false; - + if ( empty( $parent) ) { if ( isset( $_wp_menu_nopriv[$pagenow] ) ) return false; @@ -1328,7 +1328,7 @@ function user_can_access_admin_page() { if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) ) return false; if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) ) - return false; + return false; } return true; } @@ -1450,14 +1450,14 @@ function get_admin_page_parent() { if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; return $parent_file; - } + } } if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) { $parent_file = $pagenow; if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; - return $parent_file; + return $parent_file; } foreach (array_keys( $submenu ) as $parent) { @@ -1897,7 +1897,7 @@ function wp_handle_upload( &$file, $overrides = false ) { // Compute the URL $url = $uploads['url'] . "/$filename"; - + $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); return $return; @@ -2056,7 +2056,7 @@ function update_home_siteurl( $old_value, $value ) { // Clear cookies for old paths. wp_clearcookie(); // Set cookies for new paths. - wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' )); + wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' )); } add_action( 'update_option_home', 'update_home_siteurl', 10, 2 ); diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 4db9f71d85..1b913c28eb 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -17,7 +17,7 @@ class Custom_Image_Header { function js_includes() { wp_enqueue_script('cropper'); - wp_enqueue_script('colorpicker'); + wp_enqueue_script('colorpicker'); } function js() { @@ -115,7 +115,7 @@ class Custom_Image_Header { function colorDefault() { pickColor(''); } - + function hide_text() { $('name').style.display = 'none'; $('desc').style.display = 'none'; @@ -126,7 +126,7 @@ class Custom_Image_Header { // $('hidetext').onclick = 'show_text()'; Event.observe( $('hidetext'), 'click', show_text ); } - + function show_text() { $('name').style.display = 'block'; $('desc').style.display = 'block'; @@ -134,7 +134,7 @@ class Custom_Image_Header { $('defaultcolor').style.display = 'inline'; $('textcolor').value = ''; $('hidetext').value = ''; - Event.stopObserving( $('hidetext'), 'click', show_text ); + Event.stopObserving( $('hidetext'), 'click', show_text ); Event.observe( $('hidetext'), 'click', hide_text ); } diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index 8ed78cae4a..ae7a669d09 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -55,7 +55,7 @@ class Blogger_Import { return false; } $this->token = $matches[1]; - + wp_redirect( remove_query_arg( array( 'token', 'noheader' ) ) ); } @@ -369,9 +369,9 @@ class Blogger_Import { $sock = $this->_get_blogger_sock( $blog['host'] ); if ( ! $sock ) return; // TODO: Error handling $response = $this->_txrx( $sock, $request ); - + $response = $this->parse_response( $response ); - + // Extract the entries and send for insertion preg_match_all( '/]*>.*?<\/entry>/s', $response['body'], $matches ); if ( count( $matches[0] ) ) { @@ -437,7 +437,7 @@ class Blogger_Import { foreach ( $entries as $entry ) { $entry = "$entry"; $AtomParser = new AtomParser(); - $AtomParser->parse( $entry ); + $AtomParser->parse( $entry ); $this->import_comment($AtomParser->entry); unset($AtomParser); } @@ -623,7 +623,7 @@ class Blogger_Import { $sel = ( $user->user_id == $current ) ? " selected='selected'" : ''; $options .= ""; } - + return $options; } @@ -706,7 +706,7 @@ class Blogger_Import { function restart() { global $wpdb; $options = get_option( 'blogger_importer' ); - + if ( isset( $options['token'] ) ) $this->revoke( $options['token'] ); @@ -922,7 +922,7 @@ class AtomParser { } else if($tag == 'category') { array_push($this->entry->categories, $attrs['term']); } - + $this->ns_decls = array(); } @@ -950,7 +950,7 @@ class AtomParser { } array_shift($this->ns_contexts); - + #print str_repeat(" ", $this->depth * $this->indent) . "end_element('$name')" ."\n"; $this->depth--; diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php index e20b408e95..9203ff72c8 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -91,7 +91,7 @@ class GM_Import { if (!chdir($gmpath)) wp_die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $gmpath)); - + $this->header(); ?>

@@ -128,7 +128,7 @@ class GM_Import { $user_info = array("user_login"=>"$user_login", "user_pass"=>"$pass1", "user_nickname"=>"$user_nickname", "user_email"=>"$user_email", "user_url"=>"$user_url", "user_ip"=>"$user_ip", "user_domain"=>"$user_domain", "user_browser"=>"$user_browser", "dateYMDhour"=>"$user_joindate", "user_level"=>"1", "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$userdata[0]] = $user_id; - + printf('
  • '.__('user %s...').' '.__('Done').'
  • ', "$user_login"); } @@ -213,21 +213,21 @@ class GM_Import { $user_email=$wpdb->escape("user@deleted.com"); $user_url=$wpdb->escape(""); $user_joindate=$wpdb->escape($user_joindate); - + $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname"); $user_id = wp_insert_user($user_info); $this->gmnames[$postinfo[1]] = $user_id; - + echo ': '; printf(__('registered deleted user %s at level 0 '), "$user_login"); } - + if (array_key_exists($postinfo[1], $this->gmnames)) { $post_author = $this->gmnames[$postinfo[1]]; } else { $post_author = $user_id; } - + $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt'); $post_ID = wp_insert_post($postdata); } diff --git a/wp-admin/link-import.php b/wp-admin/link-import.php index 6484dbb1fb..5844f42148 100644 --- a/wp-admin/link-import.php +++ b/wp-admin/link-import.php @@ -12,16 +12,16 @@ if (!$step) $step = 0; ?>
    +

    @@ -40,7 +40,6 @@ switch ($step) {
    -


    @@ -60,74 +59,73 @@ foreach ($categories as $category) {

    -

    +

    false, 'test_type' => false); - $file = wp_handle_upload($_FILES['userfile'], $overrides); + $opml_url = $_POST['opml_url']; + if ( isset($opml_url) && $opml_url != '' && $opml_url != 'http://' ) { + $blogrolling = true; + } else { // try to get the upload file. + $overrides = array('test_form' => false, 'test_type' => false); + $file = wp_handle_upload($_FILES['userfile'], $overrides); - if ( isset($file['error']) ) - wp_die($file['error']); + if ( isset($file['error']) ) + wp_die($file['error']); - $url = $file['url']; - $opml_url = $file['file']; - $blogrolling = false; - } + $url = $file['url']; + $opml_url = $file['file']; + $blogrolling = false; + } - if (isset($opml_url) && $opml_url != '') { - $opml = wp_remote_fopen($opml_url); - include_once('link-parse-opml.php'); + if ( isset($opml_url) && $opml_url != '' ) { + $opml = wp_remote_fopen($opml_url); + include_once('link-parse-opml.php'); - $link_count = count($names); - for ($i = 0; $i < $link_count; $i++) { - if ('Last' == substr($titles[$i], 0, 4)) - $titles[$i] = ''; - if ('http' == substr($titles[$i], 0, 4)) - $titles[$i] = ''; - $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); - wp_insert_link($link); - echo sprintf('

    '.__('Inserted %s').'

    ', $names[$i]); - } + $link_count = count($names); + for ( $i = 0; $i < $link_count; $i++ ) { + if ('Last' == substr($titles[$i], 0, 4)) + $titles[$i] = ''; + if ( 'http' == substr($titles[$i], 0, 4) ) + $titles[$i] = ''; + $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); + wp_insert_link($link); + echo sprintf('

    '.__('Inserted %s').'

    ', $names[$i]); + } ?> -

    manage those links.'), $link_count, $cat_id, 'link-manager.php') ?>

    -" . __("You need to supply your OPML url. Press back on your browser and try again") . "

    \n"; - } // end else - if ( ! $blogrolling ) - @unlink($opml_url); +

    manage those links.'), $link_count, $cat_id, 'link-manager.php') ?>

    + +" . __("You need to supply your OPML url. Press back on your browser and try again") . "

    \n"; +} // end else + +if ( ! $blogrolling ) + @unlink($opml_url); ?>
    +?> \ No newline at end of file diff --git a/wp-admin/menu.php b/wp-admin/menu.php index b18ac28379..1707b44c0b 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -14,7 +14,7 @@ if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') ) $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php'); else $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php'); - + $menu[15] = array(__('Comments'), 'edit_posts', 'edit-comments.php'); $menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php'); $menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php'); @@ -104,7 +104,7 @@ foreach ( $menu as $id => $data ) { if ( $new_parent != $old_parent ) { $_wp_real_parent_file[$old_parent] = $new_parent; $menu[$id][2] = $new_parent; - + foreach ($submenu[$old_parent] as $index => $data) { $submenu[$new_parent][$index] = $submenu[$old_parent][$index]; unset($submenu[$old_parent][$index]); diff --git a/wp-admin/options.php b/wp-admin/options.php index 90b857a26b..12c01b764d 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -78,7 +78,7 @@ function sanitize_option($option, $value) { // Remember to call stripslashes! break; } - return $value; + return $value; } switch($action) { @@ -150,7 +150,7 @@ foreach ( (array) $options as $option) : if (stristr($value, "\n")) echo ""; else echo ""; - + echo " $option->option_description "; diff --git a/wp-admin/page.php b/wp-admin/page.php index 12f6afc963..665cd52364 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -107,7 +107,7 @@ case 'editpost': } if ( isset($_POST['save']) ) - $location = "page.php?action=edit&post=$page_ID"; + $location = "page.php?action=edit&post=$page_ID"; } else { if ($_POST['save']) { $location = "page.php?action=edit&post=$page_ID"; diff --git a/wp-admin/post.php b/wp-admin/post.php index 8f0cc53621..163e22013c 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -47,7 +47,7 @@ case 'edit': $editing = true; $post_ID = $p = (int) $_GET['post']; $post = get_post($post_ID); - + if ( 'page' == $post->post_type ) { wp_redirect("page.php?action=edit&post=$post_ID"); exit(); @@ -119,7 +119,7 @@ case 'editpost': if ( !empty($_POST['referredby']) ) $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']); $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer()); - + if ($_POST['save']) { $location = "post.php?action=edit&post=$post_ID"; } elseif ($_POST['updatemeta']) { diff --git a/wp-admin/upgrade-schema.php b/wp-admin/upgrade-schema.php index 9346b61366..77aa8a1125 100644 --- a/wp-admin/upgrade-schema.php +++ b/wp-admin/upgrade-schema.php @@ -2,12 +2,12 @@ // Here we keep the DB structure and option values $charset_collate = ''; - + if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) { if ( ! empty($wpdb->charset) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty($wpdb->collate) ) - $charset_collate .= " COLLATE $wpdb->collate"; + $charset_collate .= " COLLATE $wpdb->collate"; } $wp_queries="CREATE TABLE $wpdb->categories ( diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index 2ba76cdc0a..c2b5519e8a 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -13,13 +13,13 @@ function wp_upload_display( $dims = false, $href = '' ) { } if ( isset($attachment_data['width']) ) list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128); - + ob_start(); the_title(); $post_title = attribute_escape(ob_get_contents()); ob_end_clean(); $post_content = apply_filters( 'content_edit_pre', $post->post_content ); - + $class = 'text'; $innerHTML = get_attachment_innerHTML( $id, false, $dims ); if ( $image_src = get_attachment_icon_src() ) { @@ -285,7 +285,7 @@ function wp_upload_posts_where( $where ) { function wp_upload_tab_browse() { global $wpdb, $action, $paged; $old_vars = compact( 'paged' ); - + switch ( $action ) : case 'edit' : case 'view' : diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index 50db0ac458..b406355b89 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -189,7 +189,7 @@ addLoadEvent( function() { new Insertion.Top('upload-content', h); if (e) Event.stop(e); - return false; + return false; }, prepView: function(id) { @@ -264,7 +264,7 @@ addLoadEvent( function() { } return false; } - + }; theFileList.initializeVars(); theFileList.initializeLinks(); diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index 0770268190..29887f36b2 100644 --- a/wp-includes/bookmark-template.php +++ b/wp-includes/bookmark-template.php @@ -342,7 +342,7 @@ function wp_list_bookmarks($args = '') { } else { //output one single list using title_li for the title $bookmarks = get_bookmarks("limit=$limit&category=$category&show_updated=$show_updated&orderby=$orderby&order=$order&hide_invisible=$hide_invisible&show_updated=$show_updated"); - + if ( !empty($bookmarks) ) { if ( !empty( $title_li ) ){ $output .= str_replace(array('%id', '%class'), array("linkcat-$category", $class), $category_before); diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index 638f006e49..b7cf5f84db 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -72,7 +72,7 @@ function get_bookmarks($args = '') { } if (!empty($exclusions)) $exclusions .= ')'; - + if ( ! empty($category_name) ) { if ( $cat_id = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$category_name' LIMIT 1") ) $category = $cat_id; diff --git a/wp-includes/cache.php b/wp-includes/cache.php index 299c33fbe2..b776d91ba4 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -386,7 +386,7 @@ class WP_Object_Cache { function WP_Object_Cache() { return $this->__construct(); } - + function __construct() { global $blog_id; @@ -429,7 +429,7 @@ class WP_Object_Cache { function __destruct() { $this->save(); - return true; + return true; } } ?> diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 1d84227035..a65dae3033 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -247,7 +247,7 @@ function wp_list_categories($args = '') { $output .= __("No categories"); } else { global $wp_query; - + if ( is_category() ) $r['current_category'] = $wp_query->get_queried_object_id(); diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 223780fcd5..e8563ec332 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -414,16 +414,16 @@ class Walker { $cb_args = array_merge( array($output, $element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'start_el'), $cb_args); } - + // End the element. if ( isset($element->$id_field) && $element->$id_field != 0 ) { $cb_args = array_merge( array($output, $element, $depth - 1), $args); $output = call_user_func_array(array(&$this, 'end_el'), $cb_args); } - - continue; + + continue; } - + // Walk the tree. if ( !empty($previous_element) && ($element->$parent_field == $previous_element->$id_field) ) { // Previous element is my parent. Descend a level. @@ -512,19 +512,19 @@ class Walker_Page extends Walker { $css_class .= ' current_page_parent'; $output .= $indent . '
  • ' . $page->post_title . ''; - + if ( !empty($show_date) ) { if ( 'modified' == $show_date ) $time = $page->post_modified; else $time = $page->post_date; - + $output .= " " . mysql2date($date_format, $time); } return $output; } - + function end_el($output, $page, $depth) { $output .= "
  • \n"; @@ -613,10 +613,10 @@ class Walker_Category extends Walker { if ( empty($feed_image) ) $link .= ')'; } - + if ( isset($show_count) && $show_count ) $link .= ' (' . intval($category->category_count) . ')'; - + if ( isset($show_date) && $show_date ) { $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); } diff --git a/wp-includes/cron.php b/wp-includes/cron.php index f770500290..b4af252161 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -54,7 +54,7 @@ function wp_unschedule_event( $timestamp, $hook, $args = array() ) { function wp_clear_scheduled_hook( $hook ) { $args = array_slice( func_get_args(), 1 ); - + while ( $timestamp = wp_next_scheduled( $hook, $args ) ) wp_unschedule_event( $timestamp, $hook, $args ); } @@ -73,10 +73,10 @@ function wp_next_scheduled( $hook, $args = array() ) { function spawn_cron() { $crons = _get_cron_array(); - + if ( !is_array($crons) ) return; - + $keys = array_keys( $crons ); if ( array_shift( $keys ) > time() ) return; @@ -98,7 +98,7 @@ function wp_cron() { return; $crons = _get_cron_array(); - + if ( !is_array($crons) ) return; diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php index 7687a8c09a..7efb3f97b2 100644 --- a/wp-includes/feed-atom-comments.php +++ b/wp-includes/feed-atom-comments.php @@ -16,10 +16,10 @@ echo '' printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); ?> - + WordPress - + @@ -41,13 +41,13 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment(); } ?> - + ' . get_comment_author_url() . ''; ?> - + diff --git a/wp-includes/feed-atom.php b/wp-includes/feed-atom.php index fe3ff13590..6f2d5f7e8d 100644 --- a/wp-includes/feed-atom.php +++ b/wp-includes/feed-atom.php @@ -13,7 +13,7 @@ $more = 1; > <?php bloginfo_rss('name') ?> - + WordPress diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 25971d3909..daafba365f 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -21,7 +21,7 @@ function wptexturize($text) { $static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace); $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); - $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); + $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); for ( $i = 0; $i < $stop; $i++ ) { $curl = $textarr[$i]; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index f9797928c2..f88542b1da 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -351,15 +351,15 @@ function wp_get_archives($args = '') { } elseif ('yearly' == $type) { $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts WHERE post_type ='post' AND post_status = 'publish' GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit); if ($arcresults) { - $afterafter = $after; - foreach ($arcresults as $arcresult) { - $url = get_year_link($arcresult->year); - $text = sprintf('%d', $arcresult->year); + $afterafter = $after; + foreach ($arcresults as $arcresult) { + $url = get_year_link($arcresult->year); + $text = sprintf('%d', $arcresult->year); if ($show_post_count) - $after = ' ('.$arcresult->posts.')' . $afterafter; - echo get_archives_link($url, $text, $format, $before, $after); - } - } + $after = ' ('.$arcresult->posts.')' . $afterafter; + echo get_archives_link($url, $text, $format, $before, $after); + } + } } elseif ( 'daily' == $type ) { $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit); if ( $arcresults ) { diff --git a/wp-includes/gettext.php b/wp-includes/gettext.php index dd79dcd50f..aabd9cfd7b 100644 --- a/wp-includes/gettext.php +++ b/wp-includes/gettext.php @@ -308,7 +308,7 @@ class gettext_reader { # poEdit doesn't put any semicolons, which # results in parse error in eval $string .= ';'; - + $total = 0; $plural = 0; diff --git a/wp-includes/js/autosave-js.php b/wp-includes/js/autosave-js.php index e30134d0e6..caaa16d931 100644 --- a/wp-includes/js/autosave-js.php +++ b/wp-includes/js/autosave-js.php @@ -28,7 +28,7 @@ function autosave_cur_time() { ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes() + ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds(); } - + function autosave_update_nonce() { var response = nonceAjax.response; document.getElementsByName('_wpnonce')[0].value = response; @@ -38,7 +38,7 @@ function autosave_update_post_ID() { var response = autosaveAjax.response; var res = parseInt(response); var message; - + if(isNaN(res)) { message = "" + response; } else { @@ -70,7 +70,7 @@ function autosave_saved() { var response = autosaveAjax.response; var res = parseInt(response); var message; - + if(isNaN(res)) { message = "" + response; } else { @@ -127,7 +127,7 @@ function autosave() { goodcats.push(cats[i].value); } catslist = goodcats.join(","); - + autosaveAjax.setVar("action", "autosave"); autosaveAjax.setVar("cookie", document.cookie); autosaveAjax.setVar("catslist", catslist); @@ -139,15 +139,15 @@ function autosave() { if ( form.ping_status.checked ) autosaveAjax.setVar("ping_status", 'open'); if(form.excerpt) - autosaveAjax.setVar("excerpt", form.excerpt.value); - + autosaveAjax.setVar("excerpt", form.excerpt.value); + if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) { autosaveAjax.setVar("content", form.content.value); } else { tinyMCE.wpTriggerSave(); autosaveAjax.setVar("content", form.content.value); } - + autosaveAjax.requestFile = "/wp-admin/admin-ajax.php"; autosaveAjax.method = "POST"; autosaveAjax.element = null; diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 6697d9ded5..9e065753af 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -40,7 +40,7 @@ $mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera', 'safari')); $mce_browsers = implode($mce_browsers, ','); - + $mce_popups_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/popups.css'; $mce_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/wordpress.css'; $mce_css = apply_filters('mce_css', $mce_css); diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 1f600ee716..16f6b5879e 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -262,7 +262,7 @@ function get_post_comments_feed_link($post_id = '', $feed = 'rss2') { $url = get_option('home') . "/?feed=$feed&p=$id"; } - return apply_filters('post_comments_feed_link', $url); + return apply_filters('post_comments_feed_link', $url); } function edit_post_link($link = 'Edit This', $before = '', $after = '') { diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index dac196c245..42577685c2 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -163,7 +163,7 @@ function wp_mail($to, $subject, $message, $headers = '') { require_once(ABSPATH . WPINC . '/class-smtp.php'); $phpmailer = new PHPMailer(); } - + $mail = compact('to', 'subject', 'message', 'headers'); $mail = apply_filters('wp_mail', $mail); extract($mail); diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index efdc0383a1..cfa56f8e85 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -101,7 +101,7 @@ function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_ if ( ! empty($more_link_text) ) $output .= ' $more_link_text"; } - + } if ( $preview ) // preview fix for javascript bug with foreign languages $output = preg_replace('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output); diff --git a/wp-includes/post.php b/wp-includes/post.php index 4ecfba628b..cb64909dec 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -80,7 +80,7 @@ function get_extended($post) { $main = $post; $extended = ''; } - + // Strip leading and trailing whitespace $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main); $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended); @@ -555,7 +555,7 @@ function wp_insert_post($postarr = array()) { if ( 'draft' != $post_status ) $post_date_gmt = get_gmt_from_date($post_date); } - + if ( 'publish' == $post_status ) { $now = gmdate('Y-m-d H:i:59'); if ( mysql2date('U', $post_date_gmt) > mysql2date('U', $now) ) @@ -704,7 +704,7 @@ function wp_insert_post($postarr = array()) { // Schedule publication. if ( 'future' == $post_status ) wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', array($post_ID)); - + do_action('save_post', $post_ID); do_action('wp_insert_post', $post_ID); @@ -1107,7 +1107,7 @@ function &get_pages($args = '') { $author_query = ''; if (!empty($authors)) { $post_authors = preg_split('/[\s,]+/',$authors); - + if ( count($post_authors) ) { foreach ( $post_authors as $post_author ) { //Do we have an author id or an author login? diff --git a/wp-includes/query.php b/wp-includes/query.php index e221b07ef3..c474f4aa6b 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -200,7 +200,7 @@ function is_single ($post = '') { function is_singular() { global $wp_query; - return $wp_query->is_singular; + return $wp_query->is_singular; } function is_time () { @@ -285,7 +285,7 @@ class WP_Query { var $current_post = -1; var $in_the_loop = false; var $post; - + var $comments; var $comment_count = 0; var $current_comment = -1; @@ -360,7 +360,7 @@ class WP_Query { function parse_query_vars() { $this->parse_query(''); } - + function fill_query_vars($array) { $keys = array( 'error' @@ -395,7 +395,7 @@ class WP_Query { if ( !isset($array[$key])) $array[$key] = ''; } - + return $array; } @@ -410,9 +410,9 @@ class WP_Query { $this->query = $query; $this->query_vars = $qv; } - + $qv = $this->fill_query_vars($qv); - + if ( ! empty($qv['robots']) ) { $this->is_robots = true; return; @@ -609,7 +609,7 @@ class WP_Query { // Shorthand. $q = &$this->query_vars; - + $q = $this->fill_query_vars($q); // First let's clear some variables @@ -1001,7 +1001,7 @@ class WP_Query { $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; } } - + // Comments feeds if ( $this->is_comment_feed && ( $this->is_archive || $this->is_search || !$this->is_singular ) ) { if ( $this->is_archive || $this->is_search ) { @@ -1013,19 +1013,19 @@ class WP_Query { $cwhere = "WHERE post_status = 'publish' AND comment_approved = '1'"; $cgroupby = ''; } - + $cjoin = apply_filters('comment_feed_join', $cjoin); $cwhere = apply_filters('comment_feed_where', $cwhere); $cgroupby = apply_filters('comment_feed_groupby', $cgroupby); - + $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_settings('posts_per_rss')); $this->comment_count = count($this->comments); $post_ids = array(); - + foreach ($this->comments as $comment) $post_ids[] = (int) $comment->comment_post_ID; - + $post_ids = join(',', $post_ids); $join = ''; if ( $post_ids ) @@ -1061,14 +1061,14 @@ class WP_Query { $this->comments = $wpdb->get_results($comments_request); $this->comment_count = count($this->comments); } - + if ( !empty($limits) ) { $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' ); $this->found_posts = $wpdb->get_var( $found_posts_query ); $this->found_posts = apply_filters( 'found_posts', $this->found_posts ); $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']); } - + // Check post status to determine if post should be displayed. if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) { $status = get_post_status($this->posts[0]); @@ -1148,34 +1148,34 @@ class WP_Query { $this->post = $this->posts[0]; } } - + function next_comment() { $this->current_comment++; - + $this->comment = $this->comments[$this->current_comment]; return $this->comment; } - + function the_comment() { global $comment; - + $comment = $this->next_comment(); - + if ($this->current_comment == 0) { do_action('comment_loop_start'); } } - + function have_comments() { if ($this->current_comment + 1 < $this->comment_count) { return true; } elseif ($this->current_comment + 1 == $this->comment_count) { $this->rewind_comments(); } - + return false; } - + function rewind_comments() { $this->current_comment = -1; if ($this->comment_count > 0) { diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 8c60a9cbc3..633412cff7 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -186,7 +186,7 @@ function get_themes() { if ( !file_exists("$theme_root/$template/index.php") ) { $parent_dir = dirname(dirname($theme_file)); if ( file_exists("$theme_root/$parent_dir/$template/index.php") ) { - $template = "$parent_dir/$template"; + $template = "$parent_dir/$template"; } else { $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); continue; @@ -484,7 +484,7 @@ function get_header_textcolor() { } function header_textcolor() { - echo get_header_textcolor(); + echo get_header_textcolor(); } function get_header_image() { @@ -492,7 +492,7 @@ function get_header_image() { } function header_image() { - echo get_header_image(); + echo get_header_image(); } function add_custom_image_header($header_callback, $admin_header_callback) { diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 1f659d1f10..d9673037ef 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -48,7 +48,7 @@ class wpdb { function wpdb($dbuser, $dbpassword, $dbname, $dbhost) { return $this->__construct($dbuser, $dbpassword, $dbname, $dbhost); } - + function __construct($dbuser, $dbpassword, $dbname, $dbhost) { register_shutdown_function(array(&$this, "__destruct")); @@ -79,7 +79,7 @@ class wpdb { } function __destruct() { - return true; + return true; } /** @@ -181,7 +181,7 @@ class wpdb { $this->result = @mysql_query($query, $this->dbh); ++$this->num_queries; - + if (SAVEQUERIES) $this->queries[] = array( $query, $this->timer_stop() ); @@ -255,7 +255,7 @@ class wpdb { $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; if ( $query ) $this->query($query); - + if ( !isset($this->last_result[$y]) ) return null; diff --git a/wp-login.php b/wp-login.php index 0afb2a55ef..0e7a9cbd2a 100644 --- a/wp-login.php +++ b/wp-login.php @@ -96,7 +96,7 @@ case 'retrievepassword' : $errors['user_email'] = __('ERROR: The e-mail field is empty.'); do_action('lostpassword_post'); - + if ( empty( $errors ) ) { $user_data = get_userdatabylogin(trim($_POST['user_login'])); // redefining user_login ensures we return the right case in the email @@ -328,7 +328,7 @@ default: $errors['expiredsession'] = __('Your session has expired.'); } } - + if ( $_POST && empty( $user_login ) ) $errors['user_login'] = __('ERROR: The username field is empty.'); if ( $_POST && empty( $user_pass ) ) diff --git a/xmlrpc.php b/xmlrpc.php index 4f6ce62e6d..373d6d5607 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -504,7 +504,7 @@ class wp_xmlrpc_server extends IXR_Server { if(empty($category["description"])) { $category["description"] = ""; } - + $new_category = array( "cat_name" => $category["name"], "category_nicename" => $category["slug"],