Index: wp-includes/bookmark-template.php
===================================================================
--- wp-includes/bookmark-template.php	(revision 3978)
+++ wp-includes/bookmark-template.php	(working copy)
@@ -77,7 +77,7 @@
 		$order = 'DESC';
 		$orderby = substr($orderby, 1);
 	}
-	
+
 	if ($category == -1) {  //get_bookmarks uses '' to signify all categories
 		$category = '';
 	}
@@ -159,7 +159,7 @@
 }
 
 function get_linkrating($link) {
-    return apply_filters('link_rating', $link->link_rating);
+	return apply_filters('link_rating', $link->link_rating);
 }
 
 /** function get_linkcatname()
@@ -170,9 +170,9 @@
 function get_linkcatname($id = 0) {
 	$id = (int) $id;
 
-    if ( empty($id) )
-    	return '';
-  
+	if ( empty($id) )
+		return '';
+
 	$cats = wp_get_link_cats($id);
 
 	if ( empty($cats) || ! is_array($cats) )
@@ -195,23 +195,23 @@
  **   count (default true) - the number of links in the db
  */
 function links_popup_script($text = 'Links', $width=400, $height=400,
-                            $file='links.all.php', $count = true) {
-   if ($count == true) {
-      $counts = $wpdb->get_var("SELECT count(*) FROM $wpdb->links");
-   }
+	$file='links.all.php', $count = true) {
+	if ($count == true) {
+		$counts = $wpdb->get_var("SELECT count(*) FROM $wpdb->links");
+	}
 
-   $javascript = "<a href=\"#\" " .
-                 " onclick=\"javascript:window.open('$file?popup=1', '_blank', " .
-                 "'width=$width,height=$height,scrollbars=yes,status=no'); " .
-                 " return false\">";
-   $javascript .= $text;
+	$javascript = "<a href=\"#\" " .
+		" onclick=\"javascript:window.open('$file?popup=1', '_blank', " .
+		"'width=$width,height=$height,scrollbars=yes,status=no'); " .
+		" return false\">";
+	$javascript .= $text;
 
-   if ($count == true) {
-      $javascript .= " ($counts)";
-   }
+	if ($count == true) {
+		$javascript .= " ($counts)";
+	}
 
-   $javascript .="</a>\n\n";
-   echo $javascript;
+	$javascript .="</a>\n\n";
+	echo $javascript;
 }
 
 
@@ -345,10 +345,10 @@
 		'category_orderby' => 'name', 'category_order' => 'ASC');
 	$r = array_merge($defaults, $r);
 	extract($r);
-	
+
 	// TODO: The rest of it.
 	// If $categorize, group links by category with the category name being the
-	// title of each li, otherwise just list them with title_li as the li title. 
+	// title of each li, otherwise just list them with title_li as the li title.
 	// If $categorize and $category or $category_name, list links for the given category
 	// with the category name as the title li.  If not $categorize, use title_li.
 	// When using each category's name as a title li, use before and after args for specifying
Index: wp-includes/bookmark.php
===================================================================
--- wp-includes/bookmark.php	(revision 3978)
+++ wp-includes/bookmark.php	(working copy)
@@ -19,7 +19,7 @@
 
 // Deprecate
 function get_link($bookmark_id, $output = OBJECT) {
-	return get_bookmark($bookmark_id, $output);	
+	return get_bookmark($bookmark_id, $output);
 }
 
 function get_bookmarks($args = '') {
@@ -50,7 +50,7 @@
 			}
 		}
 	}
-	if (!empty($inclusions)) 
+	if (!empty($inclusions))
 		$inclusions .= ')';
 
 	$exclusions = '';
@@ -65,9 +65,9 @@
 			}
 		}
 	}
-	if (!empty($exclusions)) 
+	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;
@@ -87,7 +87,7 @@
 		}
 	}
 	if (!empty($category_query)) {
-		$category_query .= ')';	
+		$category_query .= ')';
 		$join = " LEFT JOIN $wpdb->link2cat ON ($wpdb->links.link_id = $wpdb->link2cat.link_id) ";
 	}
 
Index: wp-includes/cache.php
===================================================================
--- wp-includes/cache.php	(revision 3978)
+++ wp-includes/cache.php	(working copy)
@@ -67,7 +67,7 @@
 	var $secret = '';
 
 	function acquire_lock() {
-		// Acquire a write lock. 
+		// Acquire a write lock.
 		$this->mutex = @fopen($this->cache_dir.$this->flock_filename, 'w');
 		if ( false == $this->mutex)
 			return false;
@@ -239,11 +239,11 @@
 		while ($index < count($stack)) {
 			# Get indexed directory from stack
 			$dir = $stack[$index];
-      
+
 			$dh = @ opendir($dir);
 			if (!$dh)
 				return false;
-      
+
 			while (($file = @ readdir($dh)) !== false) {
 				if ($file == '.' or $file == '..')
 					continue;
Index: wp-includes/capabilities.php
===================================================================
--- wp-includes/capabilities.php	(revision 3978)
+++ wp-includes/capabilities.php	(working copy)
@@ -211,18 +211,18 @@
 	}
 
 	function level_reduction($max, $item) {
-	    if(preg_match('/^level_(10|[0-9])$/i', $item, $matches)) {
-	        $level = intval($matches[1]);
-	        return max($max, $level);
-	    } else {
-	        return $max;
-	    }
+		if(preg_match('/^level_(10|[0-9])$/i', $item, $matches)) {
+			$level = intval($matches[1]);
+			return max($max, $level);
+		} else {
+			return $max;
+		}
 	}
 
 	function update_user_level_from_caps() {
-	    global $wpdb;
-	    $this->user_level = array_reduce(array_keys($this->allcaps), 	array(&$this, 'level_reduction'), 0);
-	    update_usermeta($this->id, $wpdb->prefix.'user_level', $this->user_level);
+		global $wpdb;
+		$this->user_level = array_reduce(array_keys($this->allcaps), 	array(&$this, 'level_reduction'), 0);
+		update_usermeta($this->id, $wpdb->prefix.'user_level', $this->user_level);
 	}
 
 	function add_cap($cap, $grant = true) {
@@ -288,7 +288,7 @@
 		$post = get_post($args[0]);
 		if ( 'page' == $post->post_type ) {
 			$args = array_merge(array('delete_page', $user_id), $args);
-			return call_user_func_array('map_meta_cap', $args);	
+			return call_user_func_array('map_meta_cap', $args);
 		}
 		$post_author_data = get_userdata($post->post_author);
 		//echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br/>";
@@ -342,7 +342,7 @@
 		$post = get_post($args[0]);
 		if ( 'page' == $post->post_type ) {
 			$args = array_merge(array('edit_page', $user_id), $args);
-			return call_user_func_array('map_meta_cap', $args);	
+			return call_user_func_array('map_meta_cap', $args);
 		}
 		$post_author_data = get_userdata($post->post_author);
 		//echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br/>";
@@ -392,7 +392,7 @@
 		$post = get_post($args[0]);
 		if ( 'page' == $post->post_type ) {
 			$args = array_merge(array('read_page', $user_id), $args);
-			return call_user_func_array('map_meta_cap', $args);	
+			return call_user_func_array('map_meta_cap', $args);
 		}
 
 		if ( 'private' != $post->post_status ) {
Index: wp-includes/category-template.php
===================================================================
--- wp-includes/category-template.php	(revision 3978)
+++ wp-includes/category-template.php	(working copy)
@@ -184,8 +184,8 @@
 			$output .= "\t<option value='0'>$show_option_all</option>\n";
 		}
 
-		if ( $show_option_none) { 
-			$show_option_none = apply_filters('list_cats', $show_option_none);		
+		if ( $show_option_none) {
+			$show_option_none = apply_filters('list_cats', $show_option_none);
 			$output .= "\t<option value='-1'>$show_option_none</option>\n";
 		}
 
@@ -222,7 +222,7 @@
 	extract($r);
 
 	$categories = get_categories($r);
-	
+
 	$output = '';
 	if ( $title_li && 'list' == $style )
 			$output = '<li class="categories">' . $r['title_li'] . '<ul>';
@@ -245,7 +245,7 @@
 
 	if ( $title_li && 'list' == $style )
 		$output .= '</ul></li>';
-			
+
 	echo apply_filters('list_cats', $output);
 }
 
Index: wp-includes/category.php
===================================================================
--- wp-includes/category.php	(revision 3978)
+++ wp-includes/category.php	(working copy)
@@ -28,8 +28,8 @@
 	$where = 'cat_ID > 0';
 	$inclusions = '';
 	if ( !empty($include) ) {
-		$child_of = 0; //ignore child_of and exclude params if using include 
-		$exclude = '';  
+		$child_of = 0; //ignore child_of and exclude params if using include
+		$exclude = '';
 		$incategories = preg_split('/[\s,]+/',$include);
 		if ( count($incategories) ) {
 			foreach ( $incategories as $incat ) {
@@ -40,8 +40,8 @@
 			}
 		}
 	}
-	if (!empty($inclusions)) 
-		$inclusions .= ')';	
+	if (!empty($inclusions))
+		$inclusions .= ')';
 	$where .= $inclusions;
 
 	$exclusions = '';
@@ -57,7 +57,7 @@
 			}
 		}
 	}
-	if (!empty($exclusions)) 
+	if (!empty($exclusions))
 		$exclusions .= ')';
 	$exclusions = apply_filters('list_cats_exclusions', $exclusions );
 	$where .= $exclusions;
@@ -85,7 +85,7 @@
 		function stamp_cat($cat) {
 			global $cat_stamps;
 			$cat->last_update_timestamp = $cat_stamps[$cat->cat_ID];
-			return $cat;	
+			return $cat;
 		}
 		$categories = array_map('stamp_cat', $categories);
 		unset($cat_stamps);
@@ -139,7 +139,7 @@
 
 	$categories = $wpdb->get_results("SELECT cat_ID, category_nicename, category_parent FROM $wpdb->categories WHERE category_nicename = '$leaf_path'");
 
-	if ( empty($categories) ) 
+	if ( empty($categories) )
 		return NULL;
 
 	foreach ($categories as $category) {
Index: wp-includes/class-IXR.php
===================================================================
--- wp-includes/class-IXR.php	(revision 3978)
+++ wp-includes/class-IXR.php	(working copy)
@@ -1,815 +1,814 @@
 <?php
-/* 
-   IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002-2005
-   Version 1.7 (beta) - Simon Willison, 23rd May 2005
-   Site:   http://scripts.incutio.com/xmlrpc/
-   Manual: http://scripts.incutio.com/xmlrpc/manual.php
-   Made available under the BSD License: http://www.opensource.org/licenses/bsd-license.php
+/*
+	 IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002-2005
+	 Version 1.7 (beta) - Simon Willison, 23rd May 2005
+	 Site:   http://scripts.incutio.com/xmlrpc/
+	 Manual: http://scripts.incutio.com/xmlrpc/manual.php
+	 Made available under the BSD License: http://www.opensource.org/licenses/bsd-license.php
 */
 
 class IXR_Value {
-    var $data;
-    var $type;
-    function IXR_Value ($data, $type = false) {
-        $this->data = $data;
-        if (!$type) {
-            $type = $this->calculateType();
-        }
-        $this->type = $type;
-        if ($type == 'struct') {
-            /* Turn all the values in the array in to new IXR_Value objects */
-            foreach ($this->data as $key => $value) {
-                $this->data[$key] = new IXR_Value($value);
-            }
-        }
-        if ($type == 'array') {
-            for ($i = 0, $j = count($this->data); $i < $j; $i++) {
-                $this->data[$i] = new IXR_Value($this->data[$i]);
-            }
-        }
-    }
-    function calculateType() {
-        if ($this->data === true || $this->data === false) {
-            return 'boolean';
-        }
-        if (is_integer($this->data)) {
-            return 'int';
-        }
-        if (is_double($this->data)) {
-            return 'double';
-        }
-        // Deal with IXR object types base64 and date
-        if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
-            return 'date';
-        }
-        if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
-            return 'base64';
-        }
-        // If it is a normal PHP object convert it in to a struct
-        if (is_object($this->data)) {
-            
-            $this->data = get_object_vars($this->data);
-            return 'struct';
-        }
-        if (!is_array($this->data)) {
-            return 'string';
-        }
-        /* We have an array - is it an array or a struct ? */
-        if ($this->isStruct($this->data)) {
-            return 'struct';
-        } else {
-            return 'array';
-        }
-    }
-    function getXml() {
-        /* Return XML for this value */
-        switch ($this->type) {
-            case 'boolean':
-                return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
-                break;
-            case 'int':
-                return '<int>'.$this->data.'</int>';
-                break;
-            case 'double':
-                return '<double>'.$this->data.'</double>';
-                break;
-            case 'string':
-                return '<string>'.htmlspecialchars($this->data).'</string>';
-                break;
-            case 'array':
-                $return = '<array><data>'."\n";
-                foreach ($this->data as $item) {
-                    $return .= '  <value>'.$item->getXml()."</value>\n";
-                }
-                $return .= '</data></array>';
-                return $return;
-                break;
-            case 'struct':
-                $return = '<struct>'."\n";
-                foreach ($this->data as $name => $value) {
+	var $data;
+	var $type;
+	function IXR_Value ($data, $type = false) {
+		$this->data = $data;
+		if (!$type) {
+			$type = $this->calculateType();
+		}
+		$this->type = $type;
+		if ($type == 'struct') {
+			/* Turn all the values in the array in to new IXR_Value objects */
+			foreach ($this->data as $key => $value) {
+				$this->data[$key] = new IXR_Value($value);
+			}
+		}
+		if ($type == 'array') {
+			for ($i = 0, $j = count($this->data); $i < $j; $i++) {
+				$this->data[$i] = new IXR_Value($this->data[$i]);
+			}
+		}
+	}
+	function calculateType() {
+		if ($this->data === true || $this->data === false) {
+			return 'boolean';
+		}
+		if (is_integer($this->data)) {
+			return 'int';
+		}
+		if (is_double($this->data)) {
+			return 'double';
+		}
+		// Deal with IXR object types base64 and date
+		if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
+			return 'date';
+		}
+		if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
+			return 'base64';
+		}
+		// If it is a normal PHP object convert it in to a struct
+		if (is_object($this->data)) {
+			$this->data = get_object_vars($this->data);
+			return 'struct';
+		}
+		if (!is_array($this->data)) {
+			return 'string';
+		}
+		/* We have an array - is it an array or a struct ? */
+		if ($this->isStruct($this->data)) {
+			return 'struct';
+		} else {
+			return 'array';
+		}
+	}
+	function getXml() {
+		/* Return XML for this value */
+		switch ($this->type) {
+			case 'boolean':
+				return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
+				break;
+			case 'int':
+				return '<int>'.$this->data.'</int>';
+				break;
+			case 'double':
+				return '<double>'.$this->data.'</double>';
+				break;
+			case 'string':
+				return '<string>'.htmlspecialchars($this->data).'</string>';
+				break;
+			case 'array':
+				$return = '<array><data>'."\n";
+				foreach ($this->data as $item) {
+					$return .= '  <value>'.$item->getXml()."</value>\n";
+				}
+				$return .= '</data></array>';
+				return $return;
+				break;
+			case 'struct':
+				$return = '<struct>'."\n";
+				foreach ($this->data as $name => $value) {
 					$name = htmlspecialchars($name);
-                    $return .= "  <member><name>$name</name><value>";
-                    $return .= $value->getXml()."</value></member>\n";
-                }
-                $return .= '</struct>';
-                return $return;
-                break;
-            case 'date':
-            case 'base64':
-                return $this->data->getXml();
-                break;
-        }
-        return false;
-    }
-    function isStruct($array) {
-        /* Nasty function to check if an array is a struct or not */
-        $expected = 0;
-        foreach ($array as $key => $value) {
-            if ((string)$key != (string)$expected) {
-                return true;
-            }
-            $expected++;
-        }
-        return false;
-    }
+					$return .= "  <member><name>$name</name><value>";
+					$return .= $value->getXml()."</value></member>\n";
+				}
+				$return .= '</struct>';
+				return $return;
+				break;
+			case 'date':
+			case 'base64':
+				return $this->data->getXml();
+				break;
+		}
+		return false;
+	}
+	function isStruct($array) {
+		/* Nasty function to check if an array is a struct or not */
+		$expected = 0;
+		foreach ($array as $key => $value) {
+			if ((string)$key != (string)$expected) {
+				return true;
+			}
+			$expected++;
+		}
+		return false;
+	}
 }
 
 
 class IXR_Message {
-    var $message;
-    var $messageType;  // methodCall / methodResponse / fault
-    var $faultCode;
-    var $faultString;
-    var $methodName;
-    var $params;
-    // Current variable stacks
-    var $_arraystructs = array();   // The stack used to keep track of the current array/struct
-    var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
-    var $_currentStructName = array();  // A stack as well
-    var $_param;
-    var $_value;
-    var $_currentTag;
-    var $_currentTagContents;
-    // The XML parser
-    var $_parser;
-    function IXR_Message ($message) {
-        $this->message = $message;
-    }
-    function parse() {
-        // first remove the XML declaration
-        $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);
-        if (trim($this->message) == '') {
-            return false;
-        }
-        $this->_parser = xml_parser_create();
-        // Set XML parser to take the case of tags in to account
-        xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
-        // Set XML parser callback functions
-        xml_set_object($this->_parser, $this);
-        xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
-        xml_set_character_data_handler($this->_parser, 'cdata');
-        if (!xml_parse($this->_parser, $this->message)) {
-            /* die(sprintf('XML error: %s at line %d',
-                xml_error_string(xml_get_error_code($this->_parser)),
-                xml_get_current_line_number($this->_parser))); */
-            return false;
-        }
-        xml_parser_free($this->_parser);
-        // Grab the error messages, if any
-        if ($this->messageType == 'fault') {
-            $this->faultCode = $this->params[0]['faultCode'];
-            $this->faultString = $this->params[0]['faultString'];
-        }
-        return true;
-    }
-    function tag_open($parser, $tag, $attr) {
+	var $message;
+	var $messageType;  // methodCall / methodResponse / fault
+	var $faultCode;
+	var $faultString;
+	var $methodName;
+	var $params;
+	// Current variable stacks
+	var $_arraystructs = array();   // The stack used to keep track of the current array/struct
+	var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
+	var $_currentStructName = array();  // A stack as well
+	var $_param;
+	var $_value;
+	var $_currentTag;
+	var $_currentTagContents;
+	// The XML parser
+	var $_parser;
+	function IXR_Message ($message) {
+		$this->message = $message;
+	}
+	function parse() {
+		// first remove the XML declaration
+		$this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);
+		if (trim($this->message) == '') {
+			return false;
+		}
+		$this->_parser = xml_parser_create();
+		// Set XML parser to take the case of tags in to account
+		xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
+		// Set XML parser callback functions
+		xml_set_object($this->_parser, $this);
+		xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
+		xml_set_character_data_handler($this->_parser, 'cdata');
+		if (!xml_parse($this->_parser, $this->message)) {
+			/* die(sprintf('XML error: %s at line %d',
+			xml_error_string(xml_get_error_code($this->_parser)),
+			xml_get_current_line_number($this->_parser))); */
+			return false;
+		}
+		xml_parser_free($this->_parser);
+		// Grab the error messages, if any
+		if ($this->messageType == 'fault') {
+			$this->faultCode = $this->params[0]['faultCode'];
+			$this->faultString = $this->params[0]['faultString'];
+		}
+		return true;
+	}
+	function tag_open($parser, $tag, $attr) {
 		$this->_currentTagContents = '';
-        $this->currentTag = $tag;
-        switch($tag) {
-            case 'methodCall':
-            case 'methodResponse':
-            case 'fault':
-                $this->messageType = $tag;
-                break;
-            /* Deal with stacks of arrays and structs */
-            case 'data':    // data is to all intents and puposes more interesting than array
-                $this->_arraystructstypes[] = 'array';
-                $this->_arraystructs[] = array();
-                break;
-            case 'struct':
-                $this->_arraystructstypes[] = 'struct';
-                $this->_arraystructs[] = array();
-                break;
-        }
-    }
-    function cdata($parser, $cdata) {
-        $this->_currentTagContents .= $cdata;
-    }
-    function tag_close($parser, $tag) {
-        $valueFlag = false;
-        switch($tag) {
-            case 'int':
-            case 'i4':
-                $value = (int) trim($this->_currentTagContents);
-                $valueFlag = true;
-                break;
-            case 'double':
-                $value = (double) trim($this->_currentTagContents);
-                $valueFlag = true;
-                break;
-            case 'string':
-                $value = $this->_currentTagContents;
-                $valueFlag = true;
-                break;
-            case 'dateTime.iso8601':
-                $value = new IXR_Date(trim($this->_currentTagContents));
-                // $value = $iso->getTimestamp();
-                $valueFlag = true;
-                break;
-            case 'value':
-                // "If no type is indicated, the type is string."
-                if (trim($this->_currentTagContents) != '') {
-                    $value = (string)$this->_currentTagContents;
-                    $valueFlag = true;
-                }
-                break;
-            case 'boolean':
-                $value = (boolean) trim($this->_currentTagContents);
-                $valueFlag = true;
-                break;
-            case 'base64':
-                $value = base64_decode( trim( $this->_currentTagContents ) );
-                $valueFlag = true;
-                break;
-            /* Deal with stacks of arrays and structs */
-            case 'data':
-            case 'struct':
-                $value = array_pop($this->_arraystructs);
-                array_pop($this->_arraystructstypes);
-                $valueFlag = true;
-                break;
-            case 'member':
-                array_pop($this->_currentStructName);
-                break;
-            case 'name':
-                $this->_currentStructName[] = trim($this->_currentTagContents);
-                break;
-            case 'methodName':
-                $this->methodName = trim($this->_currentTagContents);
-                break;
-        }
-        if ($valueFlag) {
-            if (count($this->_arraystructs) > 0) {
-                // Add value to struct or array
-                if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {
-                    // Add to struct
-                    $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;
-                } else {
-                    // Add to array
-                    $this->_arraystructs[count($this->_arraystructs)-1][] = $value;
-                }
-            } else {
-                // Just add as a paramater
-                $this->params[] = $value;
-            }
-        }
+		$this->currentTag = $tag;
+		switch($tag) {
+			case 'methodCall':
+			case 'methodResponse':
+			case 'fault':
+				$this->messageType = $tag;
+				break;
+			/* Deal with stacks of arrays and structs */
+			case 'data':    // data is to all intents and puposes more interesting than array
+				$this->_arraystructstypes[] = 'array';
+				$this->_arraystructs[] = array();
+				break;
+			case 'struct':
+				$this->_arraystructstypes[] = 'struct';
+				$this->_arraystructs[] = array();
+				break;
+		}
+	}
+	function cdata($parser, $cdata) {
+		$this->_currentTagContents .= $cdata;
+	}
+	function tag_close($parser, $tag) {
+		$valueFlag = false;
+		switch($tag) {
+			case 'int':
+			case 'i4':
+				$value = (int) trim($this->_currentTagContents);
+				$valueFlag = true;
+				break;
+			case 'double':
+				$value = (double) trim($this->_currentTagContents);
+				$valueFlag = true;
+				break;
+			case 'string':
+				$value = $this->_currentTagContents;
+				$valueFlag = true;
+				break;
+			case 'dateTime.iso8601':
+				$value = new IXR_Date(trim($this->_currentTagContents));
+				// $value = $iso->getTimestamp();
+				$valueFlag = true;
+				break;
+			case 'value':
+				// "If no type is indicated, the type is string."
+				if (trim($this->_currentTagContents) != '') {
+					$value = (string)$this->_currentTagContents;
+					$valueFlag = true;
+				}
+				break;
+			case 'boolean':
+				$value = (boolean) trim($this->_currentTagContents);
+				$valueFlag = true;
+				break;
+			case 'base64':
+				$value = base64_decode( trim( $this->_currentTagContents ) );
+				$valueFlag = true;
+				break;
+			/* Deal with stacks of arrays and structs */
+			case 'data':
+			case 'struct':
+				$value = array_pop($this->_arraystructs);
+				array_pop($this->_arraystructstypes);
+				$valueFlag = true;
+				break;
+			case 'member':
+				array_pop($this->_currentStructName);
+				break;
+			case 'name':
+				$this->_currentStructName[] = trim($this->_currentTagContents);
+				break;
+			case 'methodName':
+				$this->methodName = trim($this->_currentTagContents);
+				break;
+		}
+		if ($valueFlag) {
+			if (count($this->_arraystructs) > 0) {
+				// Add value to struct or array
+				if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {
+					// Add to struct
+					$this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;
+				} else {
+					// Add to array
+					$this->_arraystructs[count($this->_arraystructs)-1][] = $value;
+				}
+			} else {
+				// Just add as a paramater
+				$this->params[] = $value;
+			}
+		}
 		$this->_currentTagContents = '';
-    }       
+	}
 }
 
 
 class IXR_Server {
-    var $data;
-    var $callbacks = array();
-    var $message;
-    var $capabilities;
-    function IXR_Server($callbacks = false, $data = false) {
-        $this->setCapabilities();
-        if ($callbacks) {
-            $this->callbacks = $callbacks;
-        }
-        $this->setCallbacks();
-        $this->serve($data);
-    }
-    function serve($data = false) {
-        if (!$data) {
-            global $HTTP_RAW_POST_DATA;
-            if (!$HTTP_RAW_POST_DATA) {
-               die('XML-RPC server accepts POST requests only.');
-            }
-            $data = $HTTP_RAW_POST_DATA;
-        }
-        $this->message = new IXR_Message($data);
-        if (!$this->message->parse()) {
-            $this->error(-32700, 'parse error. not well formed');
-        }
-        if ($this->message->messageType != 'methodCall') {
-            $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
-        }
-        $result = $this->call($this->message->methodName, $this->message->params);
-        // Is the result an error?
-        if (is_a($result, 'IXR_Error')) {
-            $this->error($result);
-        }
-        // Encode the result
-        $r = new IXR_Value($result);
-        $resultxml = $r->getXml();
-        // Create the XML
-        $xml = <<<EOD
+	var $data;
+	var $callbacks = array();
+	var $message;
+	var $capabilities;
+	function IXR_Server($callbacks = false, $data = false) {
+		$this->setCapabilities();
+		if ($callbacks) {
+			$this->callbacks = $callbacks;
+		}
+		$this->setCallbacks();
+		$this->serve($data);
+	}
+	function serve($data = false) {
+		if (!$data) {
+			global $HTTP_RAW_POST_DATA;
+			if (!$HTTP_RAW_POST_DATA) {
+				 die('XML-RPC server accepts POST requests only.');
+			}
+			$data = $HTTP_RAW_POST_DATA;
+		}
+		$this->message = new IXR_Message($data);
+		if (!$this->message->parse()) {
+			$this->error(-32700, 'parse error. not well formed');
+		}
+		if ($this->message->messageType != 'methodCall') {
+			$this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
+		}
+		$result = $this->call($this->message->methodName, $this->message->params);
+		// Is the result an error?
+		if (is_a($result, 'IXR_Error')) {
+			$this->error($result);
+		}
+		// Encode the result
+		$r = new IXR_Value($result);
+		$resultxml = $r->getXml();
+		// Create the XML
+		$xml = <<<EOD
 <methodResponse>
-  <params>
-    <param>
-      <value>
-        $resultxml
-      </value>
-    </param>
-  </params>
+	<params>
+		<param>
+			<value>
+				$resultxml
+			</value>
+		</param>
+	</params>
 </methodResponse>
 
 EOD;
-        // Send it
-        $this->output($xml);
-    }
-    function call($methodname, $args) {
-        if (!$this->hasMethod($methodname)) {
-            return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
-        }
-        $method = $this->callbacks[$methodname];
-        // Perform the callback and send the response
-        if (count($args) == 1) {
-            // If only one paramater just send that instead of the whole array
-            $args = $args[0];
-        }
-        // Are we dealing with a function or a method?
-        if (substr($method, 0, 5) == 'this:') {
-            // It's a class method - check it exists
-            $method = substr($method, 5);
-            if (!method_exists($this, $method)) {
-                return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
-            }
-            // Call the method
-            $result = $this->$method($args);
-        } else {
-            // It's a function - does it exist?
-            if (is_array($method)) {
-            	if (!method_exists($method[0], $method[1])) {
-                return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.');
-            	}
-            } else if (!function_exists($method)) {
-                return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
-            }
-            // Call the function
-            $result = call_user_func($method, $args);
-        }
-        return $result;
-    }
+		// Send it
+		$this->output($xml);
+	}
+	function call($methodname, $args) {
+		if (!$this->hasMethod($methodname)) {
+			return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
+		}
+		$method = $this->callbacks[$methodname];
+		// Perform the callback and send the response
+		if (count($args) == 1) {
+			// If only one paramater just send that instead of the whole array
+			$args = $args[0];
+		}
+		// Are we dealing with a function or a method?
+		if (substr($method, 0, 5) == 'this:') {
+			// It's a class method - check it exists
+			$method = substr($method, 5);
+			if (!method_exists($this, $method)) {
+				return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
+			}
+			// Call the method
+			$result = $this->$method($args);
+		} else {
+			// It's a function - does it exist?
+			if (is_array($method)) {
+				if (!method_exists($method[0], $method[1])) {
+					return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.');
+				}
+			} else if (!function_exists($method)) {
+				return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
+			}
+			// Call the function
+			$result = call_user_func($method, $args);
+		}
+		return $result;
+	}
 
-    function error($error, $message = false) {
-        // Accepts either an error object or an error code and message
-        if ($message && !is_object($error)) {
-            $error = new IXR_Error($error, $message);
-        }
-        $this->output($error->getXml());
-    }
-    function output($xml) {
-        $xml = '<?xml version="1.0"?>'."\n".$xml;
-        $length = strlen($xml);
-        header('Connection: close');
-        header('Content-Length: '.$length);
-        header('Content-Type: text/xml');
-        header('Date: '.date('r'));
-        echo $xml;
-        exit;
-    }
-    function hasMethod($method) {
-        return in_array($method, array_keys($this->callbacks));
-    }
-    function setCapabilities() {
-        // Initialises capabilities array
-        $this->capabilities = array(
-            'xmlrpc' => array(
-                'specUrl' => 'http://www.xmlrpc.com/spec',
-                'specVersion' => 1
-            ),
-            'faults_interop' => array(
-                'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php',
-                'specVersion' => 20010516
-            ),
-            'system.multicall' => array(
-                'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208',
-                'specVersion' => 1
-            ),
-        );   
-    }
-    function getCapabilities($args) {
-        return $this->capabilities;
-    }
-    function setCallbacks() {
-        $this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
-        $this->callbacks['system.listMethods'] = 'this:listMethods';
-        $this->callbacks['system.multicall'] = 'this:multiCall';
-    }
-    function listMethods($args) {
-        // Returns a list of methods - uses array_reverse to ensure user defined
-        // methods are listed before server defined methods
-        return array_reverse(array_keys($this->callbacks));
-    }
-    function multiCall($methodcalls) {
-        // See http://www.xmlrpc.com/discuss/msgReader$1208
-        $return = array();
-        foreach ($methodcalls as $call) {
-            $method = $call['methodName'];
-            $params = $call['params'];
-            if ($method == 'system.multicall') {
-                $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden');
-            } else {
-                $result = $this->call($method, $params);
-            }
-            if (is_a($result, 'IXR_Error')) {
-                $return[] = array(
-                    'faultCode' => $result->code,
-                    'faultString' => $result->message
-                );
-            } else {
-                $return[] = array($result);
-            }
-        }
-        return $return;
-    }
+	function error($error, $message = false) {
+		// Accepts either an error object or an error code and message
+		if ($message && !is_object($error)) {
+			$error = new IXR_Error($error, $message);
+		}
+		$this->output($error->getXml());
+	}
+	function output($xml) {
+		$xml = '<?xml version="1.0"?>'."\n".$xml;
+		$length = strlen($xml);
+		header('Connection: close');
+		header('Content-Length: '.$length);
+		header('Content-Type: text/xml');
+		header('Date: '.date('r'));
+		echo $xml;
+		exit;
+	}
+	function hasMethod($method) {
+		return in_array($method, array_keys($this->callbacks));
+	}
+	function setCapabilities() {
+		// Initialises capabilities array
+		$this->capabilities = array(
+			'xmlrpc' => array(
+				'specUrl' => 'http://www.xmlrpc.com/spec',
+				'specVersion' => 1
+			),
+			'faults_interop' => array(
+				'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php',
+				'specVersion' => 20010516
+			),
+			'system.multicall' => array(
+				'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208',
+				'specVersion' => 1
+			),
+		);
+	}
+	function getCapabilities($args) {
+		return $this->capabilities;
+	}
+	function setCallbacks() {
+		$this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
+		$this->callbacks['system.listMethods'] = 'this:listMethods';
+		$this->callbacks['system.multicall'] = 'this:multiCall';
+	}
+	function listMethods($args) {
+		// Returns a list of methods - uses array_reverse to ensure user defined
+		// methods are listed before server defined methods
+		return array_reverse(array_keys($this->callbacks));
+	}
+	function multiCall($methodcalls) {
+		// See http://www.xmlrpc.com/discuss/msgReader$1208
+		$return = array();
+		foreach ($methodcalls as $call) {
+			$method = $call['methodName'];
+			$params = $call['params'];
+			if ($method == 'system.multicall') {
+				$result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden');
+			} else {
+				$result = $this->call($method, $params);
+			}
+			if (is_a($result, 'IXR_Error')) {
+				$return[] = array(
+					'faultCode' => $result->code,
+					'faultString' => $result->message
+				);
+			} else {
+				$return[] = array($result);
+			}
+		}
+		return $return;
+	}
 }
 
 class IXR_Request {
-    var $method;
-    var $args;
-    var $xml;
-    function IXR_Request($method, $args) {
-        $this->method = $method;
-        $this->args = $args;
-        $this->xml = <<<EOD
+	var $method;
+	var $args;
+	var $xml;
+	function IXR_Request($method, $args) {
+		$this->method = $method;
+		$this->args = $args;
+		$this->xml = <<<EOD
 <?xml version="1.0"?>
 <methodCall>
 <methodName>{$this->method}</methodName>
 <params>
 
 EOD;
-        foreach ($this->args as $arg) {
-            $this->xml .= '<param><value>';
-            $v = new IXR_Value($arg);
-            $this->xml .= $v->getXml();
-            $this->xml .= "</value></param>\n";
-        }
-        $this->xml .= '</params></methodCall>';
-    }
-    function getLength() {
-        return strlen($this->xml);
-    }
-    function getXml() {
-        return $this->xml;
-    }
+		foreach ($this->args as $arg) {
+			$this->xml .= '<param><value>';
+			$v = new IXR_Value($arg);
+			$this->xml .= $v->getXml();
+			$this->xml .= "</value></param>\n";
+		}
+		$this->xml .= '</params></methodCall>';
+	}
+	function getLength() {
+		return strlen($this->xml);
+	}
+	function getXml() {
+		return $this->xml;
+	}
 }
 
 
 class IXR_Client {
-    var $server;
-    var $port;
-    var $path;
-    var $useragent;
-    var $response;
-    var $message = false;
-    var $debug = false;
+	var $server;
+	var $port;
+	var $path;
+	var $useragent;
+	var $response;
+	var $message = false;
+	var $debug = false;
 	var $timeout;
-    // Storage place for an error message
-    var $error = false;
-    function IXR_Client($server, $path = false, $port = 80, $timeout = false) {
-        if (!$path) {
-            // Assume we have been given a URL instead
-            $bits = parse_url($server);
-            $this->server = $bits['host'];
-            $this->port = isset($bits['port']) ? $bits['port'] : 80;
-            $this->path = isset($bits['path']) ? $bits['path'] : '/';
-            // Make absolutely sure we have a path
-            if (!$this->path) {
-                $this->path = '/';
-            }
-        } else {
-            $this->server = $server;
-            $this->path = $path;
-            $this->port = $port;
-        }
-        $this->useragent = 'Incutio XML-RPC';
+	// Storage place for an error message
+	var $error = false;
+	function IXR_Client($server, $path = false, $port = 80, $timeout = false) {
+		if (!$path) {
+			// Assume we have been given a URL instead
+			$bits = parse_url($server);
+			$this->server = $bits['host'];
+			$this->port = isset($bits['port']) ? $bits['port'] : 80;
+			$this->path = isset($bits['path']) ? $bits['path'] : '/';
+			// Make absolutely sure we have a path
+			if (!$this->path) {
+				$this->path = '/';
+			}
+		} else {
+			$this->server = $server;
+			$this->path = $path;
+			$this->port = $port;
+		}
+		$this->useragent = 'Incutio XML-RPC';
 		$this->timeout = $timeout;
-    }
-    function query() {
-        $args = func_get_args();
-        $method = array_shift($args);
-        $request = new IXR_Request($method, $args);
-        $length = $request->getLength();
-        $xml = $request->getXml();
-        $r = "\r\n";
-        $request  = "POST {$this->path} HTTP/1.0$r";
-        $request .= "Host: {$this->server}$r";
-        $request .= "Content-Type: text/xml$r";
-        $request .= "User-Agent: {$this->useragent}$r";
-        $request .= "Content-length: {$length}$r$r";
-        $request .= $xml;
-        // Now send the request
-        if ($this->debug) {
-            echo '<pre>'.htmlspecialchars($request)."\n</pre>\n\n";
-        }
-        if ($this->timeout) {
-            $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
-        } else {
-            $fp = @fsockopen($this->server, $this->port, $errno, $errstr);
-        }
-        if (!$fp) {
-            $this->error = new IXR_Error(-32300, "transport error - could not open socket: $errno $errstr");
-            return false;
-        }
-        fputs($fp, $request);
-        $contents = '';
-        $gotFirstLine = false;
-        $gettingHeaders = true;
-        while (!feof($fp)) {
-            $line = fgets($fp, 4096);
-            if (!$gotFirstLine) {
-                // Check line for '200'
-                if (strstr($line, '200') === false) {
-                    $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200');
-                    return false;
-                }
-                $gotFirstLine = true;
-            }
-            if (trim($line) == '') {
-                $gettingHeaders = false;
-            }
-            if (!$gettingHeaders) {
-                $contents .= trim($line)."\n";
-            }
-        }
-        if ($this->debug) {
-            echo '<pre>'.htmlspecialchars($contents)."\n</pre>\n\n";
-        }
-        // Now parse what we've got back
-        $this->message = new IXR_Message($contents);
-        if (!$this->message->parse()) {
-            // XML error
-            $this->error = new IXR_Error(-32700, 'parse error. not well formed');
-            return false;
-        }
-        // Is the message a fault?
-        if ($this->message->messageType == 'fault') {
-            $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
-            return false;
-        }
-        // Message must be OK
-        return true;
-    }
-    function getResponse() {
-        // methodResponses can only have one param - return that
-        return $this->message->params[0];
-    }
-    function isError() {
-        return (is_object($this->error));
-    }
-    function getErrorCode() {
-        return $this->error->code;
-    }
-    function getErrorMessage() {
-        return $this->error->message;
-    }
+	}
+	function query() {
+		$args = func_get_args();
+		$method = array_shift($args);
+		$request = new IXR_Request($method, $args);
+		$length = $request->getLength();
+		$xml = $request->getXml();
+		$r = "\r\n";
+		$request  = "POST {$this->path} HTTP/1.0$r";
+		$request .= "Host: {$this->server}$r";
+		$request .= "Content-Type: text/xml$r";
+		$request .= "User-Agent: {$this->useragent}$r";
+		$request .= "Content-length: {$length}$r$r";
+		$request .= $xml;
+		// Now send the request
+		if ($this->debug) {
+			echo '<pre>'.htmlspecialchars($request)."\n</pre>\n\n";
+		}
+		if ($this->timeout) {
+			$fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
+		} else {
+			$fp = @fsockopen($this->server, $this->port, $errno, $errstr);
+		}
+		if (!$fp) {
+			$this->error = new IXR_Error(-32300, "transport error - could not open socket: $errno $errstr");
+			return false;
+		}
+		fputs($fp, $request);
+		$contents = '';
+		$gotFirstLine = false;
+		$gettingHeaders = true;
+		while (!feof($fp)) {
+			$line = fgets($fp, 4096);
+			if (!$gotFirstLine) {
+				// Check line for '200'
+				if (strstr($line, '200') === false) {
+					$this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200');
+					return false;
+				}
+				$gotFirstLine = true;
+			}
+			if (trim($line) == '') {
+				$gettingHeaders = false;
+			}
+			if (!$gettingHeaders) {
+				$contents .= trim($line)."\n";
+			}
+		}
+		if ($this->debug) {
+			echo '<pre>'.htmlspecialchars($contents)."\n</pre>\n\n";
+		}
+		// Now parse what we've got back
+		$this->message = new IXR_Message($contents);
+		if (!$this->message->parse()) {
+			// XML error
+			$this->error = new IXR_Error(-32700, 'parse error. not well formed');
+			return false;
+		}
+		// Is the message a fault?
+		if ($this->message->messageType == 'fault') {
+			$this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
+			return false;
+		}
+		// Message must be OK
+		return true;
+	}
+	function getResponse() {
+		// methodResponses can only have one param - return that
+		return $this->message->params[0];
+	}
+	function isError() {
+		return (is_object($this->error));
+	}
+	function getErrorCode() {
+		return $this->error->code;
+	}
+	function getErrorMessage() {
+		return $this->error->message;
+	}
 }
 
 
 class IXR_Error {
-    var $code;
-    var $message;
-    function IXR_Error($code, $message) {
-        $this->code = $code;
-        $this->message = $message;
-    }
-    function getXml() {
-        $xml = <<<EOD
+	var $code;
+	var $message;
+	function IXR_Error($code, $message) {
+		$this->code = $code;
+		$this->message = $message;
+	}
+	function getXml() {
+		$xml = <<<EOD
 <methodResponse>
-  <fault>
-    <value>
-      <struct>
-        <member>
-          <name>faultCode</name>
-          <value><int>{$this->code}</int></value>
-        </member>
-        <member>
-          <name>faultString</name>
-          <value><string>{$this->message}</string></value>
-        </member>
-      </struct>
-    </value>
-  </fault>
-</methodResponse> 
+	<fault>
+		<value>
+			<struct>
+				<member>
+					<name>faultCode</name>
+					<value><int>{$this->code}</int></value>
+				</member>
+				<member>
+					<name>faultString</name>
+					<value><string>{$this->message}</string></value>
+				</member>
+			</struct>
+		</value>
+	</fault>
+</methodResponse>
 
 EOD;
-        return $xml;
-    }
+		return $xml;
+	}
 }
 
 
 class IXR_Date {
-    var $year;
-    var $month;
-    var $day;
-    var $hour;
-    var $minute;
-    var $second;
-    function IXR_Date($time) {
-        // $time can be a PHP timestamp or an ISO one
-        if (is_numeric($time)) {
-            $this->parseTimestamp($time);
-        } else {
-            $this->parseIso($time);
-        }
-    }
-    function parseTimestamp($timestamp) {
-        $this->year = date('Y', $timestamp);
-        $this->month = date('m', $timestamp);
-        $this->day = date('d', $timestamp);
-        $this->hour = date('H', $timestamp);
-        $this->minute = date('i', $timestamp);
-        $this->second = date('s', $timestamp);
-    }
-    function parseIso($iso) {
-        $this->year = substr($iso, 0, 4);
-        $this->month = substr($iso, 4, 2);
-        $this->day = substr($iso, 6, 2);
-        $this->hour = substr($iso, 9, 2);
-        $this->minute = substr($iso, 12, 2);
-        $this->second = substr($iso, 15, 2);
-        $this->timezone = substr($iso, 17);
-    }
-    function getIso() {
-        return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
-    }
-    function getXml() {
-        return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
-    }
-    function getTimestamp() {
-        return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
-    }
+	var $year;
+	var $month;
+	var $day;
+	var $hour;
+	var $minute;
+	var $second;
+	function IXR_Date($time) {
+		// $time can be a PHP timestamp or an ISO one
+		if (is_numeric($time)) {
+			$this->parseTimestamp($time);
+		} else {
+			$this->parseIso($time);
+		}
+	}
+	function parseTimestamp($timestamp) {
+		$this->year = date('Y', $timestamp);
+		$this->month = date('m', $timestamp);
+		$this->day = date('d', $timestamp);
+		$this->hour = date('H', $timestamp);
+		$this->minute = date('i', $timestamp);
+		$this->second = date('s', $timestamp);
+	}
+	function parseIso($iso) {
+		$this->year = substr($iso, 0, 4);
+		$this->month = substr($iso, 4, 2);
+		$this->day = substr($iso, 6, 2);
+		$this->hour = substr($iso, 9, 2);
+		$this->minute = substr($iso, 12, 2);
+		$this->second = substr($iso, 15, 2);
+		$this->timezone = substr($iso, 17);
+	}
+	function getIso() {
+		return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
+	}
+	function getXml() {
+		return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
+	}
+	function getTimestamp() {
+		return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
+	}
 }
 
 
 class IXR_Base64 {
-    var $data;
-    function IXR_Base64($data) {
-        $this->data = $data;
-    }
-    function getXml() {
-        return '<base64>'.base64_encode($this->data).'</base64>';
-    }
+	var $data;
+	function IXR_Base64($data) {
+		$this->data = $data;
+	}
+	function getXml() {
+		return '<base64>'.base64_encode($this->data).'</base64>';
+	}
 }
 
 
 class IXR_IntrospectionServer extends IXR_Server {
-    var $signatures;
-    var $help;
-    function IXR_IntrospectionServer() {
-        $this->setCallbacks();
-        $this->setCapabilities();
-        $this->capabilities['introspection'] = array(
-            'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html',
-            'specVersion' => 1
-        );
-        $this->addCallback(
-            'system.methodSignature', 
-            'this:methodSignature', 
-            array('array', 'string'), 
-            'Returns an array describing the return type and required parameters of a method'
-        );
-        $this->addCallback(
-            'system.getCapabilities', 
-            'this:getCapabilities', 
-            array('struct'), 
-            'Returns a struct describing the XML-RPC specifications supported by this server'
-        );
-        $this->addCallback(
-            'system.listMethods', 
-            'this:listMethods', 
-            array('array'), 
-            'Returns an array of available methods on this server'
-        );
-        $this->addCallback(
-            'system.methodHelp', 
-            'this:methodHelp', 
-            array('string', 'string'), 
-            'Returns a documentation string for the specified method'
-        );
-    }
-    function addCallback($method, $callback, $args, $help) {
-        $this->callbacks[$method] = $callback;
-        $this->signatures[$method] = $args;
-        $this->help[$method] = $help;
-    }
-    function call($methodname, $args) {
-        // Make sure it's in an array
-        if ($args && !is_array($args)) {
-            $args = array($args);
-        }
-        // Over-rides default call method, adds signature check
-        if (!$this->hasMethod($methodname)) {
-            return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.');
-        }
-        $method = $this->callbacks[$methodname];
-        $signature = $this->signatures[$methodname];
-        $returnType = array_shift($signature);
-        // Check the number of arguments
-        if (count($args) != count($signature)) {
-            return new IXR_Error(-32602, 'server error. wrong number of method parameters');
-        }
-        // Check the argument types
-        $ok = true;
-        $argsbackup = $args;
-        for ($i = 0, $j = count($args); $i < $j; $i++) {
-            $arg = array_shift($args);
-            $type = array_shift($signature);
-            switch ($type) {
-                case 'int':
-                case 'i4':
-                    if (is_array($arg) || !is_int($arg)) {
-                        $ok = false;
-                    }
-                    break;
-                case 'base64':
-                case 'string':
-                    if (!is_string($arg)) {
-                        $ok = false;
-                    }
-                    break;
-                case 'boolean':
-                    if ($arg !== false && $arg !== true) {
-                        $ok = false;
-                    }
-                    break;
-                case 'float':
-                case 'double':
-                    if (!is_float($arg)) {
-                        $ok = false;
-                    }
-                    break;
-                case 'date':
-                case 'dateTime.iso8601':
-                    if (!is_a($arg, 'IXR_Date')) {
-                        $ok = false;
-                    }
-                    break;
-            }
-            if (!$ok) {
-                return new IXR_Error(-32602, 'server error. invalid method parameters');
-            }
-        }
-        // It passed the test - run the "real" method call
-        return parent::call($methodname, $argsbackup);
-    }
-    function methodSignature($method) {
-        if (!$this->hasMethod($method)) {
-            return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.');
-        }
-        // We should be returning an array of types
-        $types = $this->signatures[$method];
-        $return = array();
-        foreach ($types as $type) {
-            switch ($type) {
-                case 'string':
-                    $return[] = 'string';
-                    break;
-                case 'int':
-                case 'i4':
-                    $return[] = 42;
-                    break;
-                case 'double':
-                    $return[] = 3.1415;
-                    break;
-                case 'dateTime.iso8601':
-                    $return[] = new IXR_Date(time());
-                    break;
-                case 'boolean':
-                    $return[] = true;
-                    break;
-                case 'base64':
-                    $return[] = new IXR_Base64('base64');
-                    break;
-                case 'array':
-                    $return[] = array('array');
-                    break;
-                case 'struct':
-                    $return[] = array('struct' => 'struct');
-                    break;
-            }
-        }
-        return $return;
-    }
-    function methodHelp($method) {
-        return $this->help[$method];
-    }
+	var $signatures;
+	var $help;
+	function IXR_IntrospectionServer() {
+		$this->setCallbacks();
+		$this->setCapabilities();
+		$this->capabilities['introspection'] = array(
+			'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html',
+			'specVersion' => 1
+		);
+		$this->addCallback(
+			'system.methodSignature',
+			'this:methodSignature',
+				array('array', 'string'),
+					'Returns an array describing the return type and required parameters of a method'
+					);
+				$this->addCallback(
+					'system.getCapabilities',
+					'this:getCapabilities',
+					array('struct'),
+						'Returns a struct describing the XML-RPC specifications supported by this server'
+				);
+				$this->addCallback(
+						'system.listMethods',
+						'this:listMethods',
+						array('array'),
+						'Returns an array of available methods on this server'
+				);
+				$this->addCallback(
+						'system.methodHelp',
+						'this:methodHelp',
+						array('string', 'string'),
+						'Returns a documentation string for the specified method'
+		);
+	}
+	function addCallback($method, $callback, $args, $help) {
+		$this->callbacks[$method] = $callback;
+		$this->signatures[$method] = $args;
+		$this->help[$method] = $help;
+	}
+	function call($methodname, $args) {
+		// Make sure it's in an array
+		if ($args && !is_array($args)) {
+			$args = array($args);
+		}
+		// Over-rides default call method, adds signature check
+		if (!$this->hasMethod($methodname)) {
+			return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.');
+		}
+		$method = $this->callbacks[$methodname];
+		$signature = $this->signatures[$methodname];
+		$returnType = array_shift($signature);
+		// Check the number of arguments
+		if (count($args) != count($signature)) {
+			return new IXR_Error(-32602, 'server error. wrong number of method parameters');
+		}
+		// Check the argument types
+		$ok = true;
+		$argsbackup = $args;
+		for ($i = 0, $j = count($args); $i < $j; $i++) {
+			$arg = array_shift($args);
+			$type = array_shift($signature);
+			switch ($type) {
+				case 'int':
+				case 'i4':
+					if (is_array($arg) || !is_int($arg)) {
+						$ok = false;
+					}
+					break;
+				case 'base64':
+				case 'string':
+					if (!is_string($arg)) {
+						$ok = false;
+					}
+					break;
+				case 'boolean':
+					if ($arg !== false && $arg !== true) {
+						$ok = false;
+					}
+					break;
+				case 'float':
+				case 'double':
+					if (!is_float($arg)) {
+						$ok = false;
+					}
+					break;
+				case 'date':
+				case 'dateTime.iso8601':
+					if (!is_a($arg, 'IXR_Date')) {
+						$ok = false;
+					}
+					break;
+			}
+			if (!$ok) {
+				return new IXR_Error(-32602, 'server error. invalid method parameters');
+			}
+		}
+		// It passed the test - run the "real" method call
+		return parent::call($methodname, $argsbackup);
+	}
+	function methodSignature($method) {
+		if (!$this->hasMethod($method)) {
+			return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.');
+		}
+		// We should be returning an array of types
+		$types = $this->signatures[$method];
+		$return = array();
+		foreach ($types as $type) {
+			switch ($type) {
+				case 'string':
+					$return[] = 'string';
+					break;
+				case 'int':
+				case 'i4':
+					$return[] = 42;
+					break;
+				case 'double':
+					$return[] = 3.1415;
+					break;
+				case 'dateTime.iso8601':
+					$return[] = new IXR_Date(time());
+					break;
+				case 'boolean':
+					$return[] = true;
+					break;
+				case 'base64':
+					$return[] = new IXR_Base64('base64');
+					break;
+				case 'array':
+					$return[] = array('array');
+					break;
+				case 'struct':
+					$return[] = array('struct' => 'struct');
+					break;
+			}
+		}
+		return $return;
+	}
+	function methodHelp($method) {
+		return $this->help[$method];
+	}
 }
 
 
 class IXR_ClientMulticall extends IXR_Client {
-    var $calls = array();
-    function IXR_ClientMulticall($server, $path = false, $port = 80) {
-        parent::IXR_Client($server, $path, $port);
-        $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
-    }
-    function addCall() {
-        $args = func_get_args();
-        $methodName = array_shift($args);
-        $struct = array(
-            'methodName' => $methodName,
-            'params' => $args
-        );
-        $this->calls[] = $struct;
-    }
-    function query() {
-        // Prepare multicall, then call the parent::query() method
-        return parent::query('system.multicall', $this->calls);
-    }
+	var $calls = array();
+	function IXR_ClientMulticall($server, $path = false, $port = 80) {
+		parent::IXR_Client($server, $path, $port);
+		$this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
+	}
+	function addCall() {
+		$args = func_get_args();
+		$methodName = array_shift($args);
+		$struct = array(
+			'methodName' => $methodName,
+			'params' => $args
+		);
+		$this->calls[] = $struct;
+	}
+	function query() {
+		// Prepare multicall, then call the parent::query() method
+		return parent::query('system.multicall', $this->calls);
+	}
 }
 
 ?>
\ No newline at end of file
Index: wp-includes/class-pop3.php
===================================================================
--- wp-includes/class-pop3.php	(revision 3978)
+++ wp-includes/class-pop3.php	(working copy)
@@ -1,680 +1,680 @@
-<?php 
+<?php
 
-   /**
-    * mail_fetch/setup.php
-    *
-    * Copyright (c) 1999-2002 The SquirrelMail Project Team
-    *
-    * Copyright (c) 1999 CDI (cdi@thewebmasters.net) All Rights Reserved
-    * Modified by Philippe Mingo 2001 mingo@rotedic.com
-    * An RFC 1939 compliant wrapper class for the POP3 protocol.
-    *
-    * Licensed under the GNU GPL. For full terms see the file COPYING.
-    *
-    * pop3 class
-    *
-    * $Id$
-    */
+	 /**
+		* mail_fetch/setup.php
+		*
+		* Copyright (c) 1999-2002 The SquirrelMail Project Team
+		*
+		* Copyright (c) 1999 CDI (cdi@thewebmasters.net) All Rights Reserved
+		* Modified by Philippe Mingo 2001 mingo@rotedic.com
+		* An RFC 1939 compliant wrapper class for the POP3 protocol.
+		*
+		* Licensed under the GNU GPL. For full terms see the file COPYING.
+		*
+		* pop3 class
+		*
+		* $Id$
+		*/
 
 class POP3 {
-    var $ERROR      = '';       //  Error string.
+		var $ERROR      = '';       //  Error string.
 
-    var $TIMEOUT    = 60;       //  Default timeout before giving up on a
-                                //  network operation.
+		var $TIMEOUT    = 60;       //  Default timeout before giving up on a
+																//  network operation.
 
-    var $COUNT      = -1;       //  Mailbox msg count
+		var $COUNT      = -1;       //  Mailbox msg count
 
-    var $BUFFER     = 512;      //  Socket buffer for socket fgets() calls.
-                                //  Per RFC 1939 the returned line a POP3
-                                //  server can send is 512 bytes.
+		var $BUFFER     = 512;      //  Socket buffer for socket fgets() calls.
+																//  Per RFC 1939 the returned line a POP3
+																//  server can send is 512 bytes.
 
-    var $FP         = '';       //  The connection to the server's
-                                //  file descriptor
+		var $FP         = '';       //  The connection to the server's
+																//  file descriptor
 
-    var $MAILSERVER = '';       // Set this to hard code the server name
+		var $MAILSERVER = '';       // Set this to hard code the server name
 
-    var $DEBUG      = FALSE;    // set to true to echo pop3
-                                // commands and responses to error_log
-                                // this WILL log passwords!
+		var $DEBUG      = FALSE;    // set to true to echo pop3
+																// commands and responses to error_log
+																// this WILL log passwords!
 
-    var $BANNER     = '';       //  Holds the banner returned by the
-                                //  pop server - used for apop()
+		var $BANNER     = '';       //  Holds the banner returned by the
+																//  pop server - used for apop()
 
-    var $RFC1939    = TRUE;     //  Set by noop(). See rfc1939.txt
-                                //
+		var $RFC1939    = TRUE;     //  Set by noop(). See rfc1939.txt
+																//
 
-    var $ALLOWAPOP  = FALSE;    //  Allow or disallow apop()
-                                //  This must be set to true
-                                //  manually
+		var $ALLOWAPOP  = FALSE;    //  Allow or disallow apop()
+																//  This must be set to true
+																//  manually
 
-    function POP3 ( $server = '', $timeout = '' ) {
-        settype($this->BUFFER,"integer");
-        if( !empty($server) ) {
-            // Do not allow programs to alter MAILSERVER
-            // if it is already specified. They can get around
-            // this if they -really- want to, so don't count on it.
-            if(empty($this->MAILSERVER))
-                $this->MAILSERVER = $server;
-        }
-        if(!empty($timeout)) {
-            settype($timeout,"integer");
-            $this->TIMEOUT = $timeout;
-            set_time_limit($timeout);
-        }
-        return true;
-    }
+		function POP3 ( $server = '', $timeout = '' ) {
+				settype($this->BUFFER,"integer");
+				if( !empty($server) ) {
+						// Do not allow programs to alter MAILSERVER
+						// if it is already specified. They can get around
+						// this if they -really- want to, so don't count on it.
+						if(empty($this->MAILSERVER))
+								$this->MAILSERVER = $server;
+				}
+				if(!empty($timeout)) {
+						settype($timeout,"integer");
+						$this->TIMEOUT = $timeout;
+						set_time_limit($timeout);
+				}
+				return true;
+		}
 
-    function update_timer () {
-        set_time_limit($this->TIMEOUT);
-        return true;
-    }
+		function update_timer () {
+				set_time_limit($this->TIMEOUT);
+				return true;
+		}
 
-    function connect ($server, $port = 110)  {
-        //  Opens a socket to the specified server. Unless overridden,
-        //  port defaults to 110. Returns true on success, false on fail
+		function connect ($server, $port = 110)  {
+				//  Opens a socket to the specified server. Unless overridden,
+				//  port defaults to 110. Returns true on success, false on fail
 
-        // If MAILSERVER is set, override $server with it's value
+				// If MAILSERVER is set, override $server with it's value
 
-        if(!empty($this->MAILSERVER))
-            $server = $this->MAILSERVER;
+				if(!empty($this->MAILSERVER))
+						$server = $this->MAILSERVER;
 
-        if(empty($server)){
-            $this->ERROR = _("POP3 connect:") . ' ' . _("No server specified");
-            unset($this->FP);
-            return false;
-        }
+				if(empty($server)){
+						$this->ERROR = _("POP3 connect:") . ' ' . _("No server specified");
+						unset($this->FP);
+						return false;
+				}
 
-        $fp = fsockopen("$server", $port, $errno, $errstr);
+				$fp = fsockopen("$server", $port, $errno, $errstr);
 
-        if(!$fp) {
-            $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$errno] [$errstr]";
-            unset($this->FP);
-            return false;
-        }
+				if(!$fp) {
+						$this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$errno] [$errstr]";
+						unset($this->FP);
+						return false;
+				}
 
-        socket_set_blocking($fp,-1);
-        $this->update_timer();
-        $reply = fgets($fp,$this->BUFFER);
-        $reply = $this->strip_clf($reply);
-        if($this->DEBUG)
-            error_log("POP3 SEND [connect: $server] GOT [$reply]",0);
-        if(!$this->is_ok($reply)) {
-            $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$reply]";
-            unset($this->FP);
-            return false;
-        }
-        $this->FP = $fp;
-        $this->BANNER = $this->parse_banner($reply);
-        $this->RFC1939 = $this->noop();
-        if($this->RFC1939) {
-            $this->ERROR = _("POP3: premature NOOP OK, NOT an RFC 1939 Compliant server");
-            $this->quit();
-            return false;
-        } else
-            return true;
-    }
+				socket_set_blocking($fp,-1);
+				$this->update_timer();
+				$reply = fgets($fp,$this->BUFFER);
+				$reply = $this->strip_clf($reply);
+				if($this->DEBUG)
+						error_log("POP3 SEND [connect: $server] GOT [$reply]",0);
+				if(!$this->is_ok($reply)) {
+						$this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$reply]";
+						unset($this->FP);
+						return false;
+				}
+				$this->FP = $fp;
+				$this->BANNER = $this->parse_banner($reply);
+				$this->RFC1939 = $this->noop();
+				if($this->RFC1939) {
+						$this->ERROR = _("POP3: premature NOOP OK, NOT an RFC 1939 Compliant server");
+						$this->quit();
+						return false;
+				} else
+						return true;
+		}
 
-    function noop () {
-    
-        if(!isset($this->FP)) {
-            $this->ERROR = _("POP3 noop:") . ' ' . _("No connection to server");
-            return false;
-        } else {
-            $cmd = "NOOP";
-            $reply = $this->send_cmd( $cmd );
-            return( $this->is_ok( $reply ) );
-        }
-    }
+		function noop () {
 
-    function user ($user = "") {
-        // Sends the USER command, returns true or false
+				if(!isset($this->FP)) {
+						$this->ERROR = _("POP3 noop:") . ' ' . _("No connection to server");
+						return false;
+				} else {
+						$cmd = "NOOP";
+						$reply = $this->send_cmd( $cmd );
+						return( $this->is_ok( $reply ) );
+				}
+		}
 
-        if( empty($user) ) {
-            $this->ERROR = _("POP3 user:") . ' ' . _("no login ID submitted");
-            return false;
-        } elseif(!isset($this->FP)) {
-            $this->ERROR = _("POP3 user:") . ' ' . _("connection not established");
-            return false;
-        } else {
-            $reply = $this->send_cmd("USER $user");
-            if(!$this->is_ok($reply)) {
-                $this->ERROR = _("POP3 user:") . ' ' . _("Error ") . "[$reply]";
-                return false;
-            } else
-                return true;
-        }
-    }
+		function user ($user = "") {
+				// Sends the USER command, returns true or false
 
-    function pass ($pass = "")     {
-        // Sends the PASS command, returns # of msgs in mailbox,
-        // returns false (undef) on Auth failure
+				if( empty($user) ) {
+						$this->ERROR = _("POP3 user:") . ' ' . _("no login ID submitted");
+						return false;
+				} elseif(!isset($this->FP)) {
+						$this->ERROR = _("POP3 user:") . ' ' . _("connection not established");
+						return false;
+				} else {
+						$reply = $this->send_cmd("USER $user");
+						if(!$this->is_ok($reply)) {
+								$this->ERROR = _("POP3 user:") . ' ' . _("Error ") . "[$reply]";
+								return false;
+						} else
+								return true;
+				}
+		}
 
-        if(empty($pass)) {
-            $this->ERROR = _("POP3 pass:") . ' ' . _("No password submitted");
-            return false;
-        } elseif(!isset($this->FP)) {
-            $this->ERROR = _("POP3 pass:") . ' ' . _("connection not established");
-            return false;
-        } else {
-            $reply = $this->send_cmd("PASS $pass");
-            if(!$this->is_ok($reply)) {
-                $this->ERROR = _("POP3 pass:") . ' ' . _("authentication failed ") . "[$reply]";
-                $this->quit();
-                return false;
-            } else {
-                //  Auth successful.
-                $count = $this->last("count");
-                $this->COUNT = $count;
-                $this->RFC1939 = $this->noop();
-                if(!$this->RFC1939) {
-                    $this->ERROR = _("POP3 pass:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant");
-                    $this->quit();
-                    return false;
-                } else
-                    return $count;
-            }
-        }
-    }
+		function pass ($pass = "")     {
+				// Sends the PASS command, returns # of msgs in mailbox,
+				// returns false (undef) on Auth failure
 
-    function apop ($login,$pass) {
-        //  Attempts an APOP login. If this fails, it'll
-        //  try a standard login. YOUR SERVER MUST SUPPORT
-        //  THE USE OF THE APOP COMMAND!
-        //  (apop is optional per rfc1939)
+				if(empty($pass)) {
+						$this->ERROR = _("POP3 pass:") . ' ' . _("No password submitted");
+						return false;
+				} elseif(!isset($this->FP)) {
+						$this->ERROR = _("POP3 pass:") . ' ' . _("connection not established");
+						return false;
+				} else {
+						$reply = $this->send_cmd("PASS $pass");
+						if(!$this->is_ok($reply)) {
+								$this->ERROR = _("POP3 pass:") . ' ' . _("authentication failed ") . "[$reply]";
+								$this->quit();
+								return false;
+						} else {
+								//  Auth successful.
+								$count = $this->last("count");
+								$this->COUNT = $count;
+								$this->RFC1939 = $this->noop();
+								if(!$this->RFC1939) {
+										$this->ERROR = _("POP3 pass:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant");
+										$this->quit();
+										return false;
+								} else
+										return $count;
+						}
+				}
+		}
 
-        if(!isset($this->FP)) {
-            $this->ERROR = _("POP3 apop:") . ' ' . _("No connection to server");
-            return false;
-        } elseif(!$this->ALLOWAPOP) {
-            $retVal = $this->login($login,$pass);
-            return $retVal;
-        } elseif(empty($login)) {
-            $this->ERROR = _("POP3 apop:") . ' ' . _("No login ID submitted");
-            return false;
-        } elseif(empty($pass)) {
-            $this->ERROR = _("POP3 apop:") . ' ' . _("No password submitted");
-            return false;
-        } else {
-            $banner = $this->BANNER;
-            if( (!$banner) or (empty($banner)) ) {
-                $this->ERROR = _("POP3 apop:") . ' ' . _("No server banner") . ' - ' . _("abort");
-                $retVal = $this->login($login,$pass);
-                return $retVal;
-            } else {
-                $AuthString = $banner;
-                $AuthString .= $pass;
-                $APOPString = md5($AuthString);
-                $cmd = "APOP $login $APOPString";
-                $reply = $this->send_cmd($cmd);
-                if(!$this->is_ok($reply)) {
-                    $this->ERROR = _("POP3 apop:") . ' ' . _("apop authentication failed") . ' - ' . _("abort");
-                    $retVal = $this->login($login,$pass);
-                    return $retVal;
-                } else {
-                    //  Auth successful.
-                    $count = $this->last("count");
-                    $this->COUNT = $count;
-                    $this->RFC1939 = $this->noop();
-                    if(!$this->RFC1939) {
-                        $this->ERROR = _("POP3 apop:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant");
-                        $this->quit();
-                        return false;
-                    } else
-                        return $count;
-                }
-            }
-        }
-    }
+		function apop ($login,$pass) {
+				//  Attempts an APOP login. If this fails, it'll
+				//  try a standard login. YOUR SERVER MUST SUPPORT
+				//  THE USE OF THE APOP COMMAND!
+				//  (apop is optional per rfc1939)
 
-    function login ($login = "", $pass = "") {
-        // Sends both user and pass. Returns # of msgs in mailbox or
-        // false on failure (or -1, if the error occurs while getting
-        // the number of messages.)
+				if(!isset($this->FP)) {
+						$this->ERROR = _("POP3 apop:") . ' ' . _("No connection to server");
+						return false;
+				} elseif(!$this->ALLOWAPOP) {
+						$retVal = $this->login($login,$pass);
+						return $retVal;
+				} elseif(empty($login)) {
+						$this->ERROR = _("POP3 apop:") . ' ' . _("No login ID submitted");
+						return false;
+				} elseif(empty($pass)) {
+						$this->ERROR = _("POP3 apop:") . ' ' . _("No password submitted");
+						return false;
+				} else {
+						$banner = $this->BANNER;
+						if( (!$banner) or (empty($banner)) ) {
+								$this->ERROR = _("POP3 apop:") . ' ' . _("No server banner") . ' - ' . _("abort");
+								$retVal = $this->login($login,$pass);
+								return $retVal;
+						} else {
+								$AuthString = $banner;
+								$AuthString .= $pass;
+								$APOPString = md5($AuthString);
+								$cmd = "APOP $login $APOPString";
+								$reply = $this->send_cmd($cmd);
+								if(!$this->is_ok($reply)) {
+										$this->ERROR = _("POP3 apop:") . ' ' . _("apop authentication failed") . ' - ' . _("abort");
+										$retVal = $this->login($login,$pass);
+										return $retVal;
+								} else {
+										//  Auth successful.
+										$count = $this->last("count");
+										$this->COUNT = $count;
+										$this->RFC1939 = $this->noop();
+										if(!$this->RFC1939) {
+												$this->ERROR = _("POP3 apop:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant");
+												$this->quit();
+												return false;
+										} else
+												return $count;
+								}
+						}
+				}
+		}
 
-        if( !isset($this->FP) ) {
-            $this->ERROR = _("POP3 login:") . ' ' . _("No connection to server");
-            return false;
-        } else {
-            $fp = $this->FP;
-            if( !$this->user( $login ) ) {
-                //  Preserve the error generated by user()
-                return false;
-            } else {
-                $count = $this->pass($pass);
-                if( (!$count) || ($count == -1) ) {
-                    //  Preserve the error generated by last() and pass()
-                    return false;
-                } else
-                    return $count;
-            }
-        }
-    }
+		function login ($login = "", $pass = "") {
+				// Sends both user and pass. Returns # of msgs in mailbox or
+				// false on failure (or -1, if the error occurs while getting
+				// the number of messages.)
 
-    function top ($msgNum, $numLines = "0") {
-        //  Gets the header and first $numLines of the msg body
-        //  returns data in an array with each returned line being
-        //  an array element. If $numLines is empty, returns
-        //  only the header information, and none of the body.
+				if( !isset($this->FP) ) {
+						$this->ERROR = _("POP3 login:") . ' ' . _("No connection to server");
+						return false;
+				} else {
+						$fp = $this->FP;
+						if( !$this->user( $login ) ) {
+								//  Preserve the error generated by user()
+								return false;
+						} else {
+								$count = $this->pass($pass);
+								if( (!$count) || ($count == -1) ) {
+										//  Preserve the error generated by last() and pass()
+										return false;
+								} else
+										return $count;
+						}
+				}
+		}
 
-        if(!isset($this->FP)) {
-            $this->ERROR = _("POP3 top:") . ' ' . _("No connection to server");
-            return false;
-        }
-        $this->update_timer();
+		function top ($msgNum, $numLines = "0") {
+				//  Gets the header and first $numLines of the msg body
+				//  returns data in an array with each returned line being
+				//  an array element. If $numLines is empty, returns
+				//  only the header information, and none of the body.
 
-        $fp = $this->FP;
-        $buffer = $this->BUFFER;
-        $cmd = "TOP $msgNum $numLines";
-        fwrite($fp, "TOP $msgNum $numLines\r\n");
-        $reply = fgets($fp, $buffer);
-        $reply = $this->strip_clf($reply);
-        if($this->DEBUG) {
-            @error_log("POP3 SEND [$cmd] GOT [$reply]",0);
-        }
-        if(!$this->is_ok($reply))
-        {
-            $this->ERROR = _("POP3 top:") . ' ' . _("Error ") . "[$reply]";
-            return false;
-        }
+				if(!isset($this->FP)) {
+						$this->ERROR = _("POP3 top:") . ' ' . _("No connection to server");
+						return false;
+				}
+				$this->update_timer();
 
-        $count = 0;
-        $MsgArray = array();
+				$fp = $this->FP;
+				$buffer = $this->BUFFER;
+				$cmd = "TOP $msgNum $numLines";
+				fwrite($fp, "TOP $msgNum $numLines\r\n");
+				$reply = fgets($fp, $buffer);
+				$reply = $this->strip_clf($reply);
+				if($this->DEBUG) {
+						@error_log("POP3 SEND [$cmd] GOT [$reply]",0);
+				}
+				if(!$this->is_ok($reply))
+				{
+						$this->ERROR = _("POP3 top:") . ' ' . _("Error ") . "[$reply]";
+						return false;
+				}
 
-        $line = fgets($fp,$buffer);
-        while ( !ereg("^\.\r\n",$line))
-        {
-            $MsgArray[$count] = $line;
-            $count++;
-            $line = fgets($fp,$buffer);
-            if(empty($line))    { break; }
-        }
+				$count = 0;
+				$MsgArray = array();
 
-        return $MsgArray;
-    }
+				$line = fgets($fp,$buffer);
+				while ( !ereg("^\.\r\n",$line))
+				{
+						$MsgArray[$count] = $line;
+						$count++;
+						$line = fgets($fp,$buffer);
+						if(empty($line))    { break; }
+				}
 
-    function pop_list ($msgNum = "") {
-        //  If called with an argument, returns that msgs' size in octets
-        //  No argument returns an associative array of undeleted
-        //  msg numbers and their sizes in octets
+				return $MsgArray;
+		}
 
-        if(!isset($this->FP))
-        {
-            $this->ERROR = _("POP3 pop_list:") . ' ' . _("No connection to server");
-            return false;
-        }
-        $fp = $this->FP;
-        $Total = $this->COUNT;
-        if( (!$Total) or ($Total == -1) )
-        {
-            return false;
-        }
-        if($Total == 0)
-        {
-            return array("0","0");
-            // return -1;   // mailbox empty
-        }
+		function pop_list ($msgNum = "") {
+				//  If called with an argument, returns that msgs' size in octets
+				//  No argument returns an associative array of undeleted
+				//  msg numbers and their sizes in octets
 
-        $this->update_timer();
+				if(!isset($this->FP))
+				{
+						$this->ERROR = _("POP3 pop_list:") . ' ' . _("No connection to server");
+						return false;
+				}
+				$fp = $this->FP;
+				$Total = $this->COUNT;
+				if( (!$Total) or ($Total == -1) )
+				{
+						return false;
+				}
+				if($Total == 0)
+				{
+						return array("0","0");
+						// return -1;   // mailbox empty
+				}
 
-        if(!empty($msgNum))
-        {
-            $cmd = "LIST $msgNum";
-            fwrite($fp,"$cmd\r\n");
-            $reply = fgets($fp,$this->BUFFER);
-            $reply = $this->strip_clf($reply);
-            if($this->DEBUG) {
-                @error_log("POP3 SEND [$cmd] GOT [$reply]",0);
-            }
-            if(!$this->is_ok($reply))
-            {
-                $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]";
-                return false;
-            }
-            list($junk,$num,$size) = explode(" ",$reply);
-            return $size;
-        }
-        $cmd = "LIST";
-        $reply = $this->send_cmd($cmd);
-        if(!$this->is_ok($reply))
-        {
-            $reply = $this->strip_clf($reply);
-            $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") .  "[$reply]";
-            return false;
-        }
-        $MsgArray = array();
-        $MsgArray[0] = $Total;
-        for($msgC=1;$msgC <= $Total; $msgC++)
-        {
-            if($msgC > $Total) { break; }
-            $line = fgets($fp,$this->BUFFER);
-            $line = $this->strip_clf($line);
-            if(ereg("^\.",$line))
-            {
-                $this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list");
-                return false;
-            }
-            list($thisMsg,$msgSize) = explode(" ",$line);
-            settype($thisMsg,"integer");
-            if($thisMsg != $msgC)
-            {
-                $MsgArray[$msgC] = "deleted";
-            }
-            else
-            {
-                $MsgArray[$msgC] = $msgSize;
-            }
-        }
-        return $MsgArray;
-    }
+				$this->update_timer();
 
-    function get ($msgNum) {
-        //  Retrieve the specified msg number. Returns an array
-        //  where each line of the msg is an array element.
+				if(!empty($msgNum))
+				{
+						$cmd = "LIST $msgNum";
+						fwrite($fp,"$cmd\r\n");
+						$reply = fgets($fp,$this->BUFFER);
+						$reply = $this->strip_clf($reply);
+						if($this->DEBUG) {
+								@error_log("POP3 SEND [$cmd] GOT [$reply]",0);
+						}
+						if(!$this->is_ok($reply))
+						{
+								$this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]";
+								return false;
+						}
+						list($junk,$num,$size) = explode(" ",$reply);
+						return $size;
+				}
+				$cmd = "LIST";
+				$reply = $this->send_cmd($cmd);
+				if(!$this->is_ok($reply))
+				{
+						$reply = $this->strip_clf($reply);
+						$this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") .  "[$reply]";
+						return false;
+				}
+				$MsgArray = array();
+				$MsgArray[0] = $Total;
+				for($msgC=1;$msgC <= $Total; $msgC++)
+				{
+						if($msgC > $Total) { break; }
+						$line = fgets($fp,$this->BUFFER);
+						$line = $this->strip_clf($line);
+						if(ereg("^\.",$line))
+						{
+								$this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list");
+								return false;
+						}
+						list($thisMsg,$msgSize) = explode(" ",$line);
+						settype($thisMsg,"integer");
+						if($thisMsg != $msgC)
+						{
+								$MsgArray[$msgC] = "deleted";
+						}
+						else
+						{
+								$MsgArray[$msgC] = $msgSize;
+						}
+				}
+				return $MsgArray;
+		}
 
-        if(!isset($this->FP))
-        {
-            $this->ERROR = _("POP3 get:") . ' ' . _("No connection to server");
-            return false;
-        }
+		function get ($msgNum) {
+				//  Retrieve the specified msg number. Returns an array
+				//  where each line of the msg is an array element.
 
-        $this->update_timer();
+				if(!isset($this->FP))
+				{
+						$this->ERROR = _("POP3 get:") . ' ' . _("No connection to server");
+						return false;
+				}
 
-        $fp = $this->FP;
-        $buffer = $this->BUFFER;
-        $cmd = "RETR $msgNum";
-        $reply = $this->send_cmd($cmd);
+				$this->update_timer();
 
-        if(!$this->is_ok($reply))
-        {
-            $this->ERROR = _("POP3 get:") . ' ' . _("Error ") . "[$reply]";
-            return false;
-        }
+				$fp = $this->FP;
+				$buffer = $this->BUFFER;
+				$cmd = "RETR $msgNum";
+				$reply = $this->send_cmd($cmd);
 
-        $count = 0;
-        $MsgArray = array();
+				if(!$this->is_ok($reply))
+				{
+						$this->ERROR = _("POP3 get:") . ' ' . _("Error ") . "[$reply]";
+						return false;
+				}
 
-        $line = fgets($fp,$buffer);
-        while ( !ereg("^\.\r\n",$line))
-        {
-            $MsgArray[$count] = $line;
-            $count++;
-            $line = fgets($fp,$buffer);
-            if(empty($line))    { break; }
-        }
-        return $MsgArray;
-    }
+				$count = 0;
+				$MsgArray = array();
 
-    function last ( $type = "count" ) {
-        //  Returns the highest msg number in the mailbox.
-        //  returns -1 on error, 0+ on success, if type != count
-        //  results in a popstat() call (2 element array returned)
+				$line = fgets($fp,$buffer);
+				while ( !ereg("^\.\r\n",$line))
+				{
+						$MsgArray[$count] = $line;
+						$count++;
+						$line = fgets($fp,$buffer);
+						if(empty($line))    { break; }
+				}
+				return $MsgArray;
+		}
 
-        $last = -1;
-        if(!isset($this->FP))
-        {
-            $this->ERROR = _("POP3 last:") . ' ' . _("No connection to server");
-            return $last;
-        }
+		function last ( $type = "count" ) {
+				//  Returns the highest msg number in the mailbox.
+				//  returns -1 on error, 0+ on success, if type != count
+				//  results in a popstat() call (2 element array returned)
 
-        $reply = $this->send_cmd("STAT");
-        if(!$this->is_ok($reply))
-        {
-            $this->ERROR = _("POP3 last:") . ' ' . _("Error ") . "[$reply]";
-            return $last;
-        }
+				$last = -1;
+				if(!isset($this->FP))
+				{
+						$this->ERROR = _("POP3 last:") . ' ' . _("No connection to server");
+						return $last;
+				}
 
-        $Vars = explode(" ",$reply);
-        $count = $Vars[1];
-        $size = $Vars[2];
-        settype($count,"integer");
-        settype($size,"integer");
-        if($type != "count")
-        {
-            return array($count,$size);
-        }
-        return $count;
-    }
+				$reply = $this->send_cmd("STAT");
+				if(!$this->is_ok($reply))
+				{
+						$this->ERROR = _("POP3 last:") . ' ' . _("Error ") . "[$reply]";
+						return $last;
+				}
 
-    function reset () {
-        //  Resets the status of the remote server. This includes
-        //  resetting the status of ALL msgs to not be deleted.
-        //  This method automatically closes the connection to the server.
+				$Vars = explode(" ",$reply);
+				$count = $Vars[1];
+				$size = $Vars[2];
+				settype($count,"integer");
+				settype($size,"integer");
+				if($type != "count")
+				{
+						return array($count,$size);
+				}
+				return $count;
+		}
 
-        if(!isset($this->FP))
-        {
-            $this->ERROR = _("POP3 reset:") . ' ' . _("No connection to server");
-            return false;
-        }
-        $reply = $this->send_cmd("RSET");
-        if(!$this->is_ok($reply))
-        {
-            //  The POP3 RSET command -never- gives a -ERR
-            //  response - if it ever does, something truely
-            //  wild is going on.
+		function reset () {
+				//  Resets the status of the remote server. This includes
+				//  resetting the status of ALL msgs to not be deleted.
+				//  This method automatically closes the connection to the server.
 
-            $this->ERROR = _("POP3 reset:") . ' ' . _("Error ") . "[$reply]";
-            @error_log("POP3 reset: ERROR [$reply]",0);
-        }
-        $this->quit();
-        return true;
-    }
+				if(!isset($this->FP))
+				{
+						$this->ERROR = _("POP3 reset:") . ' ' . _("No connection to server");
+						return false;
+				}
+				$reply = $this->send_cmd("RSET");
+				if(!$this->is_ok($reply))
+				{
+						//  The POP3 RSET command -never- gives a -ERR
+						//  response - if it ever does, something truely
+						//  wild is going on.
 
-    function send_cmd ( $cmd = "" )
-    {
-        //  Sends a user defined command string to the
-        //  POP server and returns the results. Useful for
-        //  non-compliant or custom POP servers.
-        //  Do NOT includ the \r\n as part of your command
-        //  string - it will be appended automatically.
+						$this->ERROR = _("POP3 reset:") . ' ' . _("Error ") . "[$reply]";
+						@error_log("POP3 reset: ERROR [$reply]",0);
+				}
+				$this->quit();
+				return true;
+		}
 
-        //  The return value is a standard fgets() call, which
-        //  will read up to $this->BUFFER bytes of data, until it
-        //  encounters a new line, or EOF, whichever happens first.
+		function send_cmd ( $cmd = "" )
+		{
+				//  Sends a user defined command string to the
+				//  POP server and returns the results. Useful for
+				//  non-compliant or custom POP servers.
+				//  Do NOT includ the \r\n as part of your command
+				//  string - it will be appended automatically.
 
-        //  This method works best if $cmd responds with only
-        //  one line of data.
+				//  The return value is a standard fgets() call, which
+				//  will read up to $this->BUFFER bytes of data, until it
+				//  encounters a new line, or EOF, whichever happens first.
 
-        if(!isset($this->FP))
-        {
-            $this->ERROR = _("POP3 send_cmd:") . ' ' . _("No connection to server");
-            return false;
-        }
+				//  This method works best if $cmd responds with only
+				//  one line of data.
 
-        if(empty($cmd))
-        {
-            $this->ERROR = _("POP3 send_cmd:") . ' ' . _("Empty command string");
-            return "";
-        }
+				if(!isset($this->FP))
+				{
+						$this->ERROR = _("POP3 send_cmd:") . ' ' . _("No connection to server");
+						return false;
+				}
 
-        $fp = $this->FP;
-        $buffer = $this->BUFFER;
-        $this->update_timer();
-        fwrite($fp,"$cmd\r\n");
-        $reply = fgets($fp,$buffer);
-        $reply = $this->strip_clf($reply);
-        if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
-        return $reply;
-    }
+				if(empty($cmd))
+				{
+						$this->ERROR = _("POP3 send_cmd:") . ' ' . _("Empty command string");
+						return "";
+				}
 
-    function quit() {
-        //  Closes the connection to the POP3 server, deleting
-        //  any msgs marked as deleted.
+				$fp = $this->FP;
+				$buffer = $this->BUFFER;
+				$this->update_timer();
+				fwrite($fp,"$cmd\r\n");
+				$reply = fgets($fp,$buffer);
+				$reply = $this->strip_clf($reply);
+				if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
+				return $reply;
+		}
 
-        if(!isset($this->FP))
-        {
-            $this->ERROR = _("POP3 quit:") . ' ' . _("connection does not exist");
-            return false;
-        }
-        $fp = $this->FP;
-        $cmd = "QUIT";
-        fwrite($fp,"$cmd\r\n");
-        $reply = fgets($fp,$this->BUFFER);
-        $reply = $this->strip_clf($reply);
-        if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
-        fclose($fp);
-        unset($this->FP);
-        return true;
-    }
+		function quit() {
+				//  Closes the connection to the POP3 server, deleting
+				//  any msgs marked as deleted.
 
-    function popstat () {
-        //  Returns an array of 2 elements. The number of undeleted
-        //  msgs in the mailbox, and the size of the mbox in octets.
+				if(!isset($this->FP))
+				{
+						$this->ERROR = _("POP3 quit:") . ' ' . _("connection does not exist");
+						return false;
+				}
+				$fp = $this->FP;
+				$cmd = "QUIT";
+				fwrite($fp,"$cmd\r\n");
+				$reply = fgets($fp,$this->BUFFER);
+				$reply = $this->strip_clf($reply);
+				if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
+				fclose($fp);
+				unset($this->FP);
+				return true;
+		}
 
-        $PopArray = $this->last("array");
+		function popstat () {
+				//  Returns an array of 2 elements. The number of undeleted
+				//  msgs in the mailbox, and the size of the mbox in octets.
 
-        if($PopArray == -1) { return false; }
+				$PopArray = $this->last("array");
 
-        if( (!$PopArray) or (empty($PopArray)) )
-        {
-            return false;
-        }
-        return $PopArray;
-    }
+				if($PopArray == -1) { return false; }
 
-    function uidl ($msgNum = "")
-    {
-        //  Returns the UIDL of the msg specified. If called with
-        //  no arguments, returns an associative array where each
-        //  undeleted msg num is a key, and the msg's uidl is the element
-        //  Array element 0 will contain the total number of msgs
+				if( (!$PopArray) or (empty($PopArray)) )
+				{
+						return false;
+				}
+				return $PopArray;
+		}
 
-        if(!isset($this->FP)) {
-            $this->ERROR = _("POP3 uidl:") . ' ' . _("No connection to server");
-            return false;
-        }
+		function uidl ($msgNum = "")
+		{
+				//  Returns the UIDL of the msg specified. If called with
+				//  no arguments, returns an associative array where each
+				//  undeleted msg num is a key, and the msg's uidl is the element
+				//  Array element 0 will contain the total number of msgs
 
-        $fp = $this->FP;
-        $buffer = $this->BUFFER;
+				if(!isset($this->FP)) {
+						$this->ERROR = _("POP3 uidl:") . ' ' . _("No connection to server");
+						return false;
+				}
 
-        if(!empty($msgNum)) {
-            $cmd = "UIDL $msgNum";
-            $reply = $this->send_cmd($cmd);
-            if(!$this->is_ok($reply))
-            {
-                $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
-                return false;
-            }
-            list ($ok,$num,$myUidl) = explode(" ",$reply);
-            return $myUidl;
-        } else {
-            $this->update_timer();
+				$fp = $this->FP;
+				$buffer = $this->BUFFER;
 
-            $UIDLArray = array();
-            $Total = $this->COUNT;
-            $UIDLArray[0] = $Total;
+				if(!empty($msgNum)) {
+						$cmd = "UIDL $msgNum";
+						$reply = $this->send_cmd($cmd);
+						if(!$this->is_ok($reply))
+						{
+								$this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
+								return false;
+						}
+						list ($ok,$num,$myUidl) = explode(" ",$reply);
+						return $myUidl;
+				} else {
+						$this->update_timer();
 
-            if ($Total < 1)
-            {
-                return $UIDLArray;
-            }
-            $cmd = "UIDL";
-            fwrite($fp, "UIDL\r\n");
-            $reply = fgets($fp, $buffer);
-            $reply = $this->strip_clf($reply);
-            if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
-            if(!$this->is_ok($reply))
-            {
-                $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
-                return false;
-            }
+						$UIDLArray = array();
+						$Total = $this->COUNT;
+						$UIDLArray[0] = $Total;
 
-            $line = "";
-            $count = 1;
-            $line = fgets($fp,$buffer);
-            while ( !ereg("^\.\r\n",$line)) {
-                if(ereg("^\.\r\n",$line)) {
-                    break;
-                }
-                list ($msg,$msgUidl) = explode(" ",$line);
-                $msgUidl = $this->strip_clf($msgUidl);
-                if($count == $msg) {
-                    $UIDLArray[$msg] = $msgUidl;
-                }
-                else
-                {
-                    $UIDLArray[$count] = 'deleted';
-                }
-                $count++;
-                $line = fgets($fp,$buffer);
-            }
-        }
-        return $UIDLArray;
-    }
+						if ($Total < 1)
+						{
+								return $UIDLArray;
+						}
+						$cmd = "UIDL";
+						fwrite($fp, "UIDL\r\n");
+						$reply = fgets($fp, $buffer);
+						$reply = $this->strip_clf($reply);
+						if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
+						if(!$this->is_ok($reply))
+						{
+								$this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
+								return false;
+						}
 
-    function delete ($msgNum = "") {
-        //  Flags a specified msg as deleted. The msg will not
-        //  be deleted until a quit() method is called.
+						$line = "";
+						$count = 1;
+						$line = fgets($fp,$buffer);
+						while ( !ereg("^\.\r\n",$line)) {
+								if(ereg("^\.\r\n",$line)) {
+										break;
+								}
+								list ($msg,$msgUidl) = explode(" ",$line);
+								$msgUidl = $this->strip_clf($msgUidl);
+								if($count == $msg) {
+										$UIDLArray[$msg] = $msgUidl;
+								}
+								else
+								{
+										$UIDLArray[$count] = 'deleted';
+								}
+								$count++;
+								$line = fgets($fp,$buffer);
+						}
+				}
+				return $UIDLArray;
+		}
 
-        if(!isset($this->FP))
-        {
-            $this->ERROR = _("POP3 delete:") . ' ' . _("No connection to server");
-            return false;
-        }
-        if(empty($msgNum))
-        {
-            $this->ERROR = _("POP3 delete:") . ' ' . _("No msg number submitted");
-            return false;
-        }
-        $reply = $this->send_cmd("DELE $msgNum");
-        if(!$this->is_ok($reply))
-        {
-            $this->ERROR = _("POP3 delete:") . ' ' . _("Command failed ") . "[$reply]";
-            return false;
-        }
-        return true;
-    }
+		function delete ($msgNum = "") {
+				//  Flags a specified msg as deleted. The msg will not
+				//  be deleted until a quit() method is called.
 
-    //  *********************************************************
+				if(!isset($this->FP))
+				{
+						$this->ERROR = _("POP3 delete:") . ' ' . _("No connection to server");
+						return false;
+				}
+				if(empty($msgNum))
+				{
+						$this->ERROR = _("POP3 delete:") . ' ' . _("No msg number submitted");
+						return false;
+				}
+				$reply = $this->send_cmd("DELE $msgNum");
+				if(!$this->is_ok($reply))
+				{
+						$this->ERROR = _("POP3 delete:") . ' ' . _("Command failed ") . "[$reply]";
+						return false;
+				}
+				return true;
+		}
 
-    //  The following methods are internal to the class.
+		//  *********************************************************
 
-    function is_ok ($cmd = "") {
-        //  Return true or false on +OK or -ERR
+		//  The following methods are internal to the class.
 
-        if( empty($cmd) )
-            return false;
-        else
-            return( ereg ("^\+OK", $cmd ) );
-    }
+		function is_ok ($cmd = "") {
+				//  Return true or false on +OK or -ERR
 
-    function strip_clf ($text = "") {
-        // Strips \r\n from server responses
+				if( empty($cmd) )
+						return false;
+				else
+						return( ereg ("^\+OK", $cmd ) );
+		}
 
-        if(empty($text))
-            return $text;
-        else {
-            $stripped = str_replace("\r",'',$text);
-            $stripped = str_replace("\n",'',$stripped);
-            return $stripped;
-        }
-    }
+		function strip_clf ($text = "") {
+				// Strips \r\n from server responses
 
-    function parse_banner ( $server_text ) {
-        $outside = true;
-        $banner = "";
-        $length = strlen($server_text);
-        for($count =0; $count < $length; $count++)
-        {
-            $digit = substr($server_text, $count, 1);
-            if ( false !== $digit ) {
-                if( (!$outside) && ($digit != '<') && ($digit != '>') )
-                {
-                    $banner .= $digit;
-                }
-                if ($digit == '<')
-                {
-                    $outside = false;
-                }
-                if($digit == '>')
-                {
-                    $outside = true;
-                }
-            }
-        }
-        $banner = $this->strip_clf($banner);    // Just in case
-        return "<$banner>";
-    }
+				if(empty($text))
+						return $text;
+				else {
+						$stripped = str_replace("\r",'',$text);
+						$stripped = str_replace("\n",'',$stripped);
+						return $stripped;
+				}
+		}
 
+		function parse_banner ( $server_text ) {
+				$outside = true;
+				$banner = "";
+				$length = strlen($server_text);
+				for($count =0; $count < $length; $count++)
+				{
+						$digit = substr($server_text, $count, 1);
+						if ( false !== $digit ) {
+								if( (!$outside) && ($digit != '<') && ($digit != '>') )
+								{
+										$banner .= $digit;
+								}
+								if ($digit == '<')
+								{
+										$outside = false;
+								}
+								if($digit == '>')
+								{
+										$outside = true;
+								}
+						}
+				}
+				$banner = $this->strip_clf($banner);    // Just in case
+				return "<$banner>";
+		}
+
 }   // End class
 
 ?>
Index: wp-includes/class-snoopy.php
===================================================================
--- wp-includes/class-snoopy.php	(revision 3978)
+++ wp-includes/class-snoopy.php	(working copy)
@@ -206,8 +206,8 @@
 				if(!$this->curl_path)
 					return false;
 				if(function_exists("is_executable"))
-				    if (!is_executable($this->curl_path))
-				        return false;
+						if (!is_executable($this->curl_path))
+								return false;
 				$this->host = $URI_PARTS["host"];
 				if(!empty($URI_PARTS["port"]))
 					$this->port = $URI_PARTS["port"];
@@ -365,8 +365,8 @@
 				if(!$this->curl_path)
 					return false;
 				if(function_exists("is_executable"))
-				    if (!is_executable($this->curl_path))
-				        return false;
+						if (!is_executable($this->curl_path))
+								return false;
 				$this->host = $URI_PARTS["host"];
 				if(!empty($URI_PARTS["port"]))
 					$this->port = $URI_PARTS["port"];
@@ -816,7 +816,7 @@
 				$cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; ";
 				}
 				$headers .= substr($cookie_headers,0,-2) . "\r\n";
-			} 
+			}
 		}
 		if(!empty($this->rawheaders))
 		{
@@ -886,10 +886,10 @@
 
 			if(preg_match("|^HTTP/|",$currentHeader))
 			{
-                if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status))
+								if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status))
 				{
 					$this->status= $status[1];
-                }
+								}
 				$this->response_code = $currentHeader;
 			}
 
@@ -898,11 +898,11 @@
 
 		$results = '';
 		do {
-    		$_data = fread($fp, $this->maxlength);
-    		if (strlen($_data) == 0) {
-        		break;
-    		}
-    		$results .= $_data;
+				$_data = fread($fp, $this->maxlength);
+				if (strlen($_data) == 0) {
+						break;
+				}
+				$results .= $_data;
 		} while(true);
 
 		if ($this->read_timeout > 0 && $this->_check_timeout($fp))
Index: wp-includes/classes.php
===================================================================
--- wp-includes/classes.php	(revision 3978)
+++ wp-includes/classes.php	(working copy)
@@ -84,7 +84,7 @@
 	var $matched_rule;
 	var $matched_query;
 	var $did_permalink = false;
-	
+
 	function add_query_var($qv) {
 		$this->public_query_vars[] = $qv;
 	}
@@ -160,7 +160,7 @@
 					preg_match("!^$match!", urldecode($request_match), $matches)) {
 					// Got a match.
 					$this->matched_rule = $match;
-					
+
 					// Trim the query of everything up to the '?'.
 					$query = preg_replace("!^.+\?!", '', $query);
 
@@ -219,7 +219,7 @@
 		for ($i=0; $i<count($this->private_query_vars); $i += 1) {
 			$wpvar = $this->private_query_vars[$i];
 			if (isset($this->extra_query_vars[$wpvar]))
-				$this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];		
+				$this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];
 		}
 
 		if ( isset($error) )
@@ -241,14 +241,14 @@
 			// We're showing a feed, so WP is indeed the only thing that last changed
 			if ( $this->query_vars['withcomments'] )
 				$wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
-			else 
+			else
 				$wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
 			$wp_etag = '"' . md5($wp_last_modified) . '"';
 			@header("Last-Modified: $wp_last_modified");
 			@header("ETag: $wp_etag");
 
 			// Support for Conditional GET
-			if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) 
+			if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
 				$client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
 			else $client_etag = false;
 
@@ -315,7 +315,7 @@
 	function query_posts() {
 		$this->build_query_string();
 		query_posts($this->query_string);
- 	}
+	}
 
 	function handle_404() {
 		global $wp_query;
@@ -367,7 +367,7 @@
 		if ( empty($codes) )
 			return '';
 
-		return $codes[0];	
+		return $codes[0];
 	}
 
 	function get_error_messages($code = '') {
@@ -383,7 +383,7 @@
 		if ( isset($this->errors[$code]) )
 			return $this->errors[$code];
 		else
-			return array();	
+			return array();
 	}
 
 	function get_error_message($code = '') {
@@ -396,7 +396,7 @@
 	}
 
 	function add($code, $message) {
-		$this->errors[$code][] = $message;	
+		$this->errors[$code][] = $message;
 	}
 }
 
@@ -409,29 +409,29 @@
 
 // A class for displaying various tree-like structures. Extend the Walker class to use it, see examples at the bottom
 
-class Walker {	
+class Walker {
 	var $tree_type;
 	var $db_fields;
-	
+
 	//abstract callbacks
 	function start_lvl($output) { return $output; }
 	function end_lvl($output)   { return $output; }
 	function start_el($output)  { return $output; }
 	function end_el($output)    { return $output; }
-	
+
 	function walk($elements, $to_depth) {
 		$args = array_slice(func_get_args(), 2); $parents = array(); $depth = 1; $previous_element = ''; $output = '';
-	
+
 		//padding at the end
 		$last_element->post_parent = 0;
 		$last_element->post_id = 0;
 		$elements[] = $last_element;
-	
+
 		$id_field = $this->db_fields['id'];
 		$parent_field = $this->db_fields['parent'];
-	
+
 		$flat = ($to_depth == -1) ? true : false;
-	
+
 		foreach ( $elements as $element ) {
 			// If flat, start and end the element and skip the level checks.
 			if ( $flat) {
@@ -440,16 +440,16 @@
 					$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 ( $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.
@@ -471,7 +471,7 @@
 					$cb_args = array_merge( array($output, $previous_element, $depth - 1), $args);
 					$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
 				}
-	
+
 				while ( $parent = array_shift($parents) ) {
 					$depth--;
 					if ( !$to_depth || ($depth < $to_depth) ) {
@@ -491,7 +491,7 @@
 					$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
 				}
 			}
-	
+
 			// Start the element.
 			if ( !$to_depth || ($depth <= $to_depth) ) {
 				if ( $element->$id_field != 0 ) {
@@ -499,10 +499,10 @@
 					$output = call_user_func_array(array(&$this, 'start_el'), $cb_args);
 				}
 			}
-	
+
 			$previous_element = $element;
 		}
-		
+
 		return $output;
 	}
 }
@@ -510,19 +510,19 @@
 class Walker_Page extends Walker {
 	var $tree_type = 'page';
 	var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this
-	
+
 	function start_lvl($output, $depth) {
 		$indent = str_repeat("\t", $depth);
 		$output .= "$indent<ul>\n";
 		return $output;
 	}
-	
+
 	function end_lvl($output, $depth) {
 		$indent = str_repeat("\t", $depth);
 		$output .= "$indent</ul>\n";
 		return $output;
 	}
-	
+
 	function start_el($output, $page, $depth, $current_page, $show_date, $date_format) {
 		if ( $depth )
 			$indent = str_repeat("\t", $depth);
@@ -532,19 +532,19 @@
 			$css_class .= ' current_page_item';
 
 		$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . wp_specialchars($page->post_title) . '">' . $page->post_title . '</a>';
-	
+
 		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 .= "</li>\n";
 
@@ -558,45 +558,45 @@
 	var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this
 
 	function start_el($output, $page, $depth, $args) {
-        $pad = str_repeat('&nbsp;', $depth * 3);
+				$pad = str_repeat('&nbsp;', $depth * 3);
 
-        $output .= "\t<option value=\"$page->ID\"";
-        if ( $page->ID == $args['selected'] )
-                $output .= ' selected="selected"';
-        $output .= '>';
-        $title = wp_specialchars($page->post_title);
-        $output .= "$pad$title";
-        $output .= "</option>\n";
+				$output .= "\t<option value=\"$page->ID\"";
+				if ( $page->ID == $args['selected'] )
+								$output .= ' selected="selected"';
+				$output .= '>';
+				$title = wp_specialchars($page->post_title);
+				$output .= "$pad$title";
+				$output .= "</option>\n";
 
-        return $output;
+				return $output;
 	}
 }
 
 class Walker_Category extends Walker {
 	var $tree_type = 'category';
 	var $db_fields = array ('parent' => 'category_parent', 'id' => 'cat_ID'); //TODO: decouple this
-	
+
 	function start_lvl($output, $depth, $args) {
 		if ( 'list' != $args['style'] )
 			return $output;
-	
+
 		$indent = str_repeat("\t", $depth);
 		$output .= "$indent<ul class='children'>\n";
 		return $output;
 	}
-	
+
 	function end_lvl($output, $depth, $args) {
 		if ( 'list' != $args['style'] )
 			return $output;
-	
+
 		$indent = str_repeat("\t", $depth);
 		$output .= "$indent</ul>\n";
 		return $output;
 	}
-	
+
 	function start_el($output, $category, $depth, $args) {
 		extract($args);
-	
+
 		$link = '<a href="' . get_category_link($category->cat_ID) . '" ';
 		if ( $use_desc_for_title == 0 || empty($category->category_description) )
 			$link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name)) . '"';
@@ -604,24 +604,24 @@
 			$link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category)) . '"';
 		$link .= '>';
 		$link .= apply_filters('list_cats', $category->cat_name, $category).'</a>';
-	
+
 		if ( (! empty($feed_image)) || (! empty($feed)) ) {
 			$link .= ' ';
-	
+
 			if ( empty($feed_image) )
 				$link .= '(';
-	
+
 			$link .= '<a href="' . get_category_rss_link(0, $category->cat_ID, $category->category_nicename) . '"';
-	
+
 			if ( !empty($feed) ) {
 				$title = ' title="' . $feed . '"';
 				$alt = ' alt="' . $feed . '"';
 				$name = $feed;
 				$link .= $title;
 			}
-	
+
 			$link .= '>';
-	
+
 			if ( !empty($feed_image) )
 				$link .= "<img src='$feed_image' $alt$title" . ' />';
 			else
@@ -630,14 +630,14 @@
 			if (empty($feed_image))
 				$link .= ')';
 		}
-	
+
 		if ( $show_count )
 			$link .= ' ('.intval($category->category_count).')';
-	
+
 		if ( $show_date ) {
 			$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
 		}
-	
+
 		if ( 'list' == $args['style'] ) {
 			$output .= "\t<li";
 			if ( ($category->cat_ID == $current_category) && is_category() )
@@ -646,14 +646,14 @@
 		} else {
 			$output .= "\t$link<br />\n";
 		}
-	
+
 		return $output;
 	}
-	
+
 	function end_el($output, $page, $depth, $args) {
 		if ( 'list' != $args['style'] )
 			return $output;
-	
+
 		$output .= "</li>\n";
 		return $output;
 	}
@@ -663,10 +663,10 @@
 class Walker_CategoryDropdown extends Walker {
 	var $tree_type = 'category';
 	var $db_fields = array ('parent' => 'category_parent', 'id' => 'cat_ID'); //TODO: decouple this
-	
-	function start_el($output, $category, $depth, $args) { 
+
+	function start_el($output, $category, $depth, $args) {
 		$pad = str_repeat('&nbsp;', $depth * 3);
-		
+
 		$cat_name = apply_filters('list_cats', $category->cat_name, $category);
 		$output .= "\t<option value=\"".$category->cat_ID."\"";
 		if ( $category->cat_ID == $args['selected'] )
@@ -680,7 +680,7 @@
 			$output .= '&nbsp;&nbsp;' . gmdate($format, $category->last_update_timestamp);
 		}
 		$output .= "</option>\n";
-		
+
 		return $output;
 	}
 }
Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 3978)
+++ wp-includes/comment-template.php	(working copy)
@@ -142,7 +142,7 @@
 }
 
 function comments_link( $file = '', $echo = true ) {
-    echo get_comments_link();
+		echo get_comments_link();
 }
 
 function get_comments_number( $post_id = 0 ) {
@@ -239,9 +239,9 @@
 function trackback_rdf($timezone = 0) {
 	global $id;
 	if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) {
-	echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-	    xmlns:dc="http://purl.org/dc/elements/1.1/"
-	    xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
+	echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+			xmlns:dc="http://purl.org/dc/elements/1.1/"
+			xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
 		<rdf:Description rdf:about="';
 	the_permalink();
 	echo '"'."\n";
@@ -264,7 +264,7 @@
 
 function pings_open() {
 	global $post;
-	if ( 'open' == $post->ping_status ) 
+	if ( 'open' == $post->ping_status )
 		return true;
 	else
 		return false;
@@ -298,7 +298,7 @@
 }
 
 function comments_popup_script($width=400, $height=400, $file='') {
-    global $wpcommentspopupfile, $wptrackbackpopupfile, $wppingbackpopupfile, $wpcommentsjavascript;
+		global $wpcommentspopupfile, $wptrackbackpopupfile, $wppingbackpopupfile, $wpcommentsjavascript;
 
 		if (empty ($file)) {
 			$wpcommentspopupfile = '';  // Use the index.
@@ -306,9 +306,9 @@
 			$wpcommentspopupfile = $file;
 		}
 
-    $wpcommentsjavascript = 1;
-    $javascript = "<script type='text/javascript'>\nfunction wpopen (macagna) {\n    window.open(macagna, '_blank', 'width=$width,height=$height,scrollbars=yes,status=yes');\n}\n</script>\n";
-    echo $javascript;
+		$wpcommentsjavascript = 1;
+		$javascript = "<script type='text/javascript'>\nfunction wpopen (macagna) {\n    window.open(macagna, '_blank', 'width=$width,height=$height,scrollbars=yes,status=yes');\n}\n</script>\n";
+		echo $javascript;
 }
 
 function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 3978)
+++ wp-includes/comment.php	(working copy)
@@ -18,11 +18,11 @@
 			// Skip empty lines
 			if (empty($word)) { continue; }
 
-			// Do some escaping magic so that '#' chars in the 
+			// Do some escaping magic so that '#' chars in the
 			// spam words don't break things:
 			$word = preg_quote($word, '#');
 
-			$pattern = "#$word#i"; 
+			$pattern = "#$word#i";
 			if ( preg_match($pattern, $author) ) return false;
 			if ( preg_match($pattern, $email) ) return false;
 			if ( preg_match($pattern, $url) ) return false;
@@ -103,9 +103,9 @@
 	if ($no_cache) {
 		$query = "SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_ID'";
 		if (false == $include_unapproved) {
-		    $query .= " AND comment_approved = '1'";
+				$query .= " AND comment_approved = '1'";
 		}
-    		$myrow = $wpdb->get_row($query, ARRAY_A);
+				$myrow = $wpdb->get_row($query, ARRAY_A);
 	} else {
 		$myrow['comment_ID'] = $postc->comment_ID;
 		$myrow['comment_post_ID'] = $postc->comment_post_ID;
@@ -157,7 +157,7 @@
 	if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ) {
 		$comment_author_email = apply_filters('pre_comment_author_email', $_COOKIE['comment_author_email_'.COOKIEHASH]);
 		$comment_author_email = stripslashes($comment_author_email);
-		$comment_author_email = wp_specialchars($comment_author_email, true);	
+		$comment_author_email = wp_specialchars($comment_author_email, true);
 		$_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
 	}
 
@@ -244,11 +244,11 @@
 		// Skip empty lines
 		if ( empty($word) ) { continue; }
 
-		// Do some escaping magic so that '#' chars in the 
+		// Do some escaping magic so that '#' chars in the
 		// spam words don't break things:
 		$word = preg_quote($word, '#');
 
-		$pattern = "#$word#i"; 
+		$pattern = "#$word#i";
 		if ( preg_match($pattern, $author    ) ) return true;
 		if ( preg_match($pattern, $email     ) ) return true;
 		if ( preg_match($pattern, $url       ) ) return true;
@@ -333,9 +333,9 @@
 	if ( ! isset($user_id) )
 		$user_id = 0;
 
-	$result = $wpdb->query("INSERT INTO $wpdb->comments 
+	$result = $wpdb->query("INSERT INTO $wpdb->comments
 	(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id)
-	VALUES 
+	VALUES
 	('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id')
 	");
 
@@ -394,26 +394,26 @@
 }
 
 function wp_set_comment_status($comment_id, $comment_status) {
-    global $wpdb;
+		global $wpdb;
 
-    switch($comment_status) {
+		switch($comment_status) {
 		case 'hold':
 			$query = "UPDATE $wpdb->comments SET comment_approved='0' WHERE comment_ID='$comment_id' LIMIT 1";
 		break;
 		case 'approve':
 			$query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1";
 		break;
- 		case 'spam':
- 			$query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";
- 		break;
+		case 'spam':
+			$query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";
+		break;
 		case 'delete':
 			return wp_delete_comment($comment_id);
 		break;
 		default:
 			return false;
-    }
-    
-    if ($wpdb->query($query)) {
+		}
+
+		if ($wpdb->query($query)) {
 		do_action('wp_set_comment_status', $comment_id, $comment_status);
 
 		$comment = get_comment($comment_id);
@@ -422,9 +422,9 @@
 		if( is_object( $c ) )
 			$wpdb->query( "UPDATE $wpdb->posts SET comment_count = '$c->c' WHERE ID = '$comment_post_ID'" );
 		return true;
-    } else {
+		} else {
 		return false;
-    }
+		}
 }
 
 function wp_update_comment($commentarr) {
@@ -579,7 +579,7 @@
 		$wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';");
 		pingback($ping->post_content, $ping->ID);
 	}
-	
+
 	// Do Enclosures
 	while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) {
 		$wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';");
@@ -616,7 +616,7 @@
 	$excerpt = str_replace(']]>', ']]&gt;', $excerpt);
 	$excerpt = strip_tags($excerpt);
 	if ( function_exists('mb_strcut') ) // For international trackbacks
-    	$excerpt = mb_strcut($excerpt, 0, 252, get_settings('blog_charset')) . '...';
+			$excerpt = mb_strcut($excerpt, 0, 252, get_settings('blog_charset')) . '...';
 	else
 		$excerpt = substr($excerpt, 0, 252) . '...';
 
@@ -702,7 +702,7 @@
 		$pingback_server_url = discover_pingback_server_uri($pagelinkedto, 2048);
 
 		if ($pingback_server_url) {
-			@ set_time_limit( 60 ); 
+			@ set_time_limit( 60 );
 			 // Now, the RPC call
 			debug_fwrite($log, "Page Linked To: $pagelinkedto \n");
 			debug_fwrite($log, 'Page Linked From: ');
Index: wp-includes/compat.php
===================================================================
--- wp-includes/compat.php	(revision 3978)
+++ wp-includes/compat.php	(working copy)
@@ -36,13 +36,13 @@
 /* Added in PHP 4.3.0 */
 
 function printr($var, $do_not_echo = false) {
-	// from php.net/print_r user contributed notes 
+	// from php.net/print_r user contributed notes
 	ob_start();
 	print_r($var);
 	$code =  htmlentities(ob_get_contents());
 	ob_clean();
 	if (!$do_not_echo) {
-	  echo "<pre>$code</pre>";
+		echo "<pre>$code</pre>";
 	}
 	ob_end_clean();
 	return $code;
@@ -57,11 +57,11 @@
 }
 
 if (!defined('CASE_LOWER')) {
-    define('CASE_LOWER', 0);
+		define('CASE_LOWER', 0);
 }
 
 if (!defined('CASE_UPPER')) {
-    define('CASE_UPPER', 1);
+		define('CASE_UPPER', 1);
 }
 
 
@@ -78,38 +78,38 @@
  * @require     PHP 4.0.0 (user_error)
  */
 if (!function_exists('array_change_key_case')) {
-    function array_change_key_case($input, $case = CASE_LOWER)
-    {
-        if (!is_array($input)) {
-            user_error('array_change_key_case(): The argument should be an array',
-                E_USER_WARNING);
-            return false;
-        }
+		function array_change_key_case($input, $case = CASE_LOWER)
+		{
+				if (!is_array($input)) {
+						user_error('array_change_key_case(): The argument should be an array',
+								E_USER_WARNING);
+						return false;
+				}
 
-        $output   = array ();
-        $keys     = array_keys($input);
-        $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper';
+				$output   = array ();
+				$keys     = array_keys($input);
+				$casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper';
 
-        foreach ($keys as $key) {
-            $output[$casefunc($key)] = $input[$key];
-        }
+				foreach ($keys as $key) {
+						$output[$casefunc($key)] = $input[$key];
+				}
 
-        return $output;
-    }
+				return $output;
+		}
 }
 
 // From php.net
 if(!function_exists('http_build_query')) {
-   function http_build_query( $formdata, $numeric_prefix = null, $key = null ) {
-       $res = array();
-       foreach ((array)$formdata as $k=>$v) {
-           $tmp_key = urlencode(is_int($k) ? $numeric_prefix.$k : $k);
-           if ($key) $tmp_key = $key.'['.$tmp_key.']';
-           $res[] = ( ( is_array($v) || is_object($v) ) ? http_build_query($v, null, $tmp_key) : $tmp_key."=".urlencode($v) );
-       }
-       $separator = ini_get('arg_separator.output');
-       return implode($separator, $res);
-   }
+	 function http_build_query( $formdata, $numeric_prefix = null, $key = null ) {
+			 $res = array();
+			 foreach ((array)$formdata as $k=>$v) {
+					 $tmp_key = urlencode(is_int($k) ? $numeric_prefix.$k : $k);
+					 if ($key) $tmp_key = $key.'['.$tmp_key.']';
+					 $res[] = ( ( is_array($v) || is_object($v) ) ? http_build_query($v, null, $tmp_key) : $tmp_key."=".urlencode($v) );
+			 }
+			 $separator = ini_get('arg_separator.output');
+			 return implode($separator, $res);
+	 }
 }
 
 if ( !function_exists('_') ) {
Index: wp-includes/cron.php
===================================================================
--- wp-includes/cron.php	(revision 3978)
+++ wp-includes/cron.php	(working copy)
@@ -66,10 +66,10 @@
 
 function spawn_cron() {
 	$crons = get_option( 'cron' );
-	
+
 	if ( !is_array($crons) )
 		return;
-	
+
 	$keys = array_keys( $crons );
 	if ( array_shift( $keys ) > time() )
 		return;
@@ -80,14 +80,14 @@
 	$argyle = @ fsockopen( $parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01 );
 	if ( $argyle )
 		fputs( $argyle,
-			  "GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n"
+				"GET {$parts['path']}?check=" . md5(DB_PASS . '187425') . " HTTP/1.0\r\n"
 			. "Host: {$_SERVER['HTTP_HOST']}\r\n\r\n"
 		);
 }
 
 function wp_cron() {
 	$crons = get_option( 'cron' );
-	
+
 	if ( !is_array($crons) )
 		return;
 
Index: wp-includes/deprecated.php
===================================================================
--- wp-includes/deprecated.php	(revision 3978)
+++ wp-includes/deprecated.php	(working copy)
@@ -129,8 +129,8 @@
 	$post_author_data = get_userdata($post->post_author);
 
 	if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' &&  $author_data->user_level < 2))
-	     || ($author_data->user_level > $post_author_data->user_level)
-	     || ($author_data->user_level >= 10) ) {
+			 || ($author_data->user_level > $post_author_data->user_level)
+			 || ($author_data->user_level >= 10) ) {
 		return true;
 	} else {
 		return false;
@@ -199,19 +199,19 @@
  **   show_updated (default 0) - whether to show last updated timestamp
  */
 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />',
-                         $between = " ", $show_images = true, $orderby = 'id',
-                         $show_description = true, $show_rating = false,
-                         $limit = -1, $show_updated = 0) {
-    global $wpdb;
-    $cat_id = -1;
-    $results = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$cat_name'");
-    if ($results) {
-        foreach ($results as $result) {
-            $cat_id = $result->cat_ID;
-        }
-    }
-    get_links($cat_id, $before, $after, $between, $show_images, $orderby,
-              $show_description, $show_rating, $limit, $show_updated);
+												 $between = " ", $show_images = true, $orderby = 'id',
+												 $show_description = true, $show_rating = false,
+												 $limit = -1, $show_updated = 0) {
+		global $wpdb;
+		$cat_id = -1;
+		$results = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$cat_name'");
+		if ($results) {
+				foreach ($results as $result) {
+						$cat_id = $result->cat_ID;
+				}
+		}
+		get_links($cat_id, $before, $after, $between, $show_images, $orderby,
+							$show_description, $show_rating, $limit, $show_updated);
 }
 
 /** function wp_get_linksbyname()
@@ -252,16 +252,16 @@
  **/
 // Deprecate in favor of get_linkz().
 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
-    global $wpdb;
-    $cat_id = -1;
-    //$results = $wpdb->get_results("SELECT cat_id FROM $wpdb->linkcategories WHERE cat_name='$cat_name'");
-    // TODO: Fix me.
-    if ($results) {
-        foreach ($results as $result) {
-            $cat_id = $result->cat_id;
-        }
-    }
-    return get_linkobjects($cat_id, $orderby, $limit);
+		global $wpdb;
+		$cat_id = -1;
+		//$results = $wpdb->get_results("SELECT cat_id FROM $wpdb->linkcategories WHERE cat_name='$cat_name'");
+		// TODO: Fix me.
+		if ($results) {
+				foreach ($results as $result) {
+						$cat_id = $result->cat_id;
+				}
+		}
+		return get_linkobjects($cat_id, $orderby, $limit);
 }
 
 /** function get_linkobjects()
@@ -301,40 +301,40 @@
  **/
 // Deprecate in favor of get_linkz().
 function get_linkobjects($category = -1, $orderby = 'name', $limit = -1) {
-    global $wpdb;
+		global $wpdb;
 
-    $sql = "SELECT * FROM $wpdb->links WHERE link_visible = 'Y'";
-    if ($category != -1) {
-        $sql .= " AND link_category = $category ";
-    }
-    if ($orderby == '')
-        $orderby = 'id';
-    if (substr($orderby,0,1) == '_') {
-        $direction = ' DESC';
-        $orderby = substr($orderby,1);
-    }
-    if (strcasecmp('rand',$orderby) == 0) {
-        $orderby = 'rand()';
-    } else {
-        $orderby = " link_" . $orderby;
-    }
-    $sql .= ' ORDER BY ' . $orderby;
-    $sql .= $direction;
-    /* The next 2 lines implement LIMIT TO processing */
-    if ($limit != -1)
-        $sql .= " LIMIT $limit";
+		$sql = "SELECT * FROM $wpdb->links WHERE link_visible = 'Y'";
+		if ($category != -1) {
+				$sql .= " AND link_category = $category ";
+		}
+		if ($orderby == '')
+				$orderby = 'id';
+		if (substr($orderby,0,1) == '_') {
+				$direction = ' DESC';
+				$orderby = substr($orderby,1);
+		}
+		if (strcasecmp('rand',$orderby) == 0) {
+				$orderby = 'rand()';
+		} else {
+				$orderby = " link_" . $orderby;
+		}
+		$sql .= ' ORDER BY ' . $orderby;
+		$sql .= $direction;
+		/* The next 2 lines implement LIMIT TO processing */
+		if ($limit != -1)
+				$sql .= " LIMIT $limit";
 
-    $results = $wpdb->get_results($sql);
-    if ($results) {
-        foreach ($results as $result) {
-            $result->link_url         = $result->link_url;
-            $result->link_name        = $result->link_name;
-            $result->link_description = $result->link_description;
-            $result->link_notes       = $result->link_notes;
-            $newresults[] = $result;
-        }
-    }
-    return $newresults;
+		$results = $wpdb->get_results($sql);
+		if ($results) {
+				foreach ($results as $result) {
+						$result->link_url         = $result->link_url;
+						$result->link_name        = $result->link_name;
+						$result->link_description = $result->link_description;
+						$result->link_notes       = $result->link_notes;
+						$newresults[] = $result;
+				}
+		}
+		return $newresults;
 }
 
 /** function get_linksbyname_withrating()
@@ -359,12 +359,12 @@
  **   show_updated (default 0) - whether to show last updated timestamp
  */
 function get_linksbyname_withrating($cat_name = "noname", $before = '',
-                                    $after = '<br />', $between = " ",
-                                    $show_images = true, $orderby = 'id',
-                                    $show_description = true, $limit = -1, $show_updated = 0) {
+																		$after = '<br />', $between = " ",
+																		$show_images = true, $orderby = 'id',
+																		$show_description = true, $limit = -1, $show_updated = 0) {
 
-    get_linksbyname($cat_name, $before, $after, $between, $show_images,
-                    $orderby, $show_description, true, $limit, $show_updated);
+		get_linksbyname($cat_name, $before, $after, $between, $show_images,
+										$orderby, $show_description, true, $limit, $show_updated);
 }
 
 /** function get_links_withrating()
@@ -389,12 +389,12 @@
  **   show_updated (default 0) - whether to show last updated timestamp
  */
 function get_links_withrating($category = -1, $before = '', $after = '<br />',
-                              $between = " ", $show_images = true,
-                              $orderby = 'id', $show_description = true,
-                              $limit = -1, $show_updated = 0) {
+															$between = " ", $show_images = true,
+															$orderby = 'id', $show_description = true,
+															$limit = -1, $show_updated = 0) {
 
-    get_links($category, $before, $after, $between, $show_images, $orderby,
-              $show_description, true, $limit, $show_updated);
+		get_links($category, $before, $after, $between, $show_images, $orderby,
+							$show_description, true, $limit, $show_updated);
 }
 
 /** function get_get_autotoggle()
@@ -403,7 +403,7 @@
  **                uses 0
  */
 function get_autotoggle($id = 0) {
-	return 0;  
+	return 0;
 }
 
 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=FALSE) {
@@ -433,7 +433,7 @@
 		$r['style'] = 'break';
 	$r['title_li'] = '';
 
-	return wp_list_categories($r);	
+	return wp_list_categories($r);
 }
 
 function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc',
Index: wp-includes/feed.php
===================================================================
--- wp-includes/feed.php	(revision 3978)
+++ wp-includes/feed.php	(working copy)
@@ -59,7 +59,7 @@
 }
 
 function permalink_single_rss($file = '') {
-    echo get_permalink();
+		echo get_permalink();
 }
 
 function comment_link() {
@@ -96,50 +96,50 @@
 }
 
 function get_author_rss_link($echo = false, $author_id, $author_nicename) {
-       $auth_ID = $author_id;
-       $permalink_structure = get_settings('permalink_structure');
+			 $auth_ID = $author_id;
+			 $permalink_structure = get_settings('permalink_structure');
 
-       if ('' == $permalink_structure) {
+			 if ('' == $permalink_structure) {
 				 $link = get_settings('home') . '?feed=rss2&amp;author=' . $author_id;
-       } else {
+			 } else {
 				 $link = get_author_link(0, $author_id, $author_nicename);
 				 $link = $link . "feed/";
-       }
-			 
+			 }
+
 			 $link = apply_filters('author_feed_link', $link);
 
-       if ($echo) echo $link;
-       return $link;
+			 if ($echo) echo $link;
+			 return $link;
 }
 
 function get_category_rss_link($echo = false, $cat_ID, $category_nicename) {
-       $permalink_structure = get_settings('permalink_structure');
+			 $permalink_structure = get_settings('permalink_structure');
 
-       if ('' == $permalink_structure) {
+			 if ('' == $permalink_structure) {
 				 $link = get_settings('home') . '?feed=rss2&amp;cat=' . $cat_ID;
-       } else {
+			 } else {
 				 $link = get_category_link($cat_ID);
 				 $link = $link . "feed/";
-       }
+			 }
 
 			 $link = apply_filters('category_feed_link', $link);
 
-       if ($echo) echo $link;
-       return $link;
+			 if ($echo) echo $link;
+			 return $link;
 }
 
 function the_category_rss($type = 'rss') {
-    $categories = get_the_category();
-    $the_list = '';
-    foreach ($categories as $category) {
-        $category->cat_name = convert_chars($category->cat_name);
-        if ('rdf' == $type) {
-            $the_list .= "\n\t<dc:subject>$category->cat_name</dc:subject>";
-        } else {
-            $the_list .= "\n\t<category>$category->cat_name</category>";
-        }
-    }
-    echo apply_filters('the_category_rss', $the_list, $type);
+		$categories = get_the_category();
+		$the_list = '';
+		foreach ($categories as $category) {
+				$category->cat_name = convert_chars($category->cat_name);
+				if ('rdf' == $type) {
+						$the_list .= "\n\t<dc:subject>$category->cat_name</dc:subject>";
+				} else {
+						$the_list .= "\n\t<category>$category->cat_name</category>";
+				}
+		}
+		echo apply_filters('the_category_rss', $the_list, $type);
 }
 
 function rss_enclosure() {
@@ -148,7 +148,7 @@
 
 	$custom_fields = get_post_custom();
 	if( is_array( $custom_fields ) ) {
-		while( list( $key, $val ) = each( $custom_fields ) ) { 
+		while( list( $key, $val ) = each( $custom_fields ) ) {
 			if( $key == 'enclosure' ) {
 				if (is_array($val)) {
 					foreach($val as $enc) {
Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 3978)
+++ wp-includes/formatting.php	(working copy)
@@ -58,18 +58,18 @@
 	$pee = $pee . "\n"; // just to make things a little easier, pad the end
 	$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
 	// Space things out a little
-	$pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "\n$1", $pee); 
+	$pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "\n$1", $pee);
 	$pee = preg_replace('!(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)!', "$1\n\n", $pee);
-	$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines 
+	$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
 	$pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
-	$pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end 
-	$pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace 
+	$pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end
+	$pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
 	$pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag
 	$pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists
 	$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
 	$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
 	$pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "$1", $pee);
-	$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); 
+	$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee);
 	if ($br) {
 		$pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);
 		$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
@@ -79,7 +79,7 @@
 	$pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
 	$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') .  stripslashes(clean_pre('$2'))  . '</pre>' ", $pee);
 
-	return $pee; 
+	return $pee;
 }
 
 
@@ -117,35 +117,35 @@
 }
 
 function utf8_uri_encode( $utf8_string ) {
-  $unicode = '';        
-  $values = array();
-  $num_octets = 1;
-        
-  for ($i = 0; $i < strlen( $utf8_string ); $i++ ) {
+	$unicode = '';
+	$values = array();
+	$num_octets = 1;
 
-    $value = ord( $utf8_string[ $i ] );
-            
-    if ( $value < 128 ) {
-      $unicode .= chr($value);
-    } else {
-      if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3;
-                
-      $values[] = $value;
-      
-      if ( count( $values ) == $num_octets ) {
+	for ($i = 0; $i < strlen( $utf8_string ); $i++ ) {
+
+		$value = ord( $utf8_string[ $i ] );
+
+		if ( $value < 128 ) {
+			$unicode .= chr($value);
+		} else {
+			if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3;
+
+			$values[] = $value;
+
+			if ( count( $values ) == $num_octets ) {
 	if ($num_octets == 3) {
-	  $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]);
+		$unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]);
 	} else {
-	  $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]);
+		$unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]);
 	}
 
 	$values = array();
 	$num_octets = 1;
-      }
-    }
-  }
+			}
+		}
+	}
 
-  return $unicode;    
+	return $unicode;
 }
 
 function remove_accents($string) {
@@ -325,7 +325,7 @@
 	return $title;
 }
 
-function convert_chars($content, $flag = 'obsolete') { 
+function convert_chars($content, $flag = 'obsolete') {
 	// Translation of invalid Unicode references range to valid range
 	$wp_htmltranswinuni = array(
 	'&#128;' => '&#8364;', // the Euro sign
@@ -391,22 +391,22 @@
 
 /*
  balanceTags
- 
+
  Balances Tags of string using a modified stack.
- 
+
  @param text      Text to be balanced
  @return          Returns balanced text
  @author          Leonard Lin (leonard@acm.org)
  @version         v1.1
  @date            November 4, 2001
  @license         GPL v2.0
- @notes           
- @changelog       
+ @notes
+ @changelog
  ---  Modified by Scott Reilly (coffee2code) 02 Aug 2004
-             1.2  ***TODO*** Make better - change loop condition to $text
-             1.1  Fixed handling of append/stack pop order of end text
-                  Added Cleaning Hooks
-             1.0  First Version
+						 1.2  ***TODO*** Make better - change loop condition to $text
+						 1.1  Fixed handling of append/stack pop order of end text
+									Added Cleaning Hooks
+						 1.0  First Version
 */
 function balanceTags($text, $is_comment = 0, $force = false) {
 
@@ -432,7 +432,7 @@
 		if ($regex[1][0] == "/") { // End Tag
 			$tag = strtolower(substr($regex[1],1));
 			// if too many closing tags
-			if($stacksize <= 0) { 
+			if($stacksize <= 0) {
 				$tag = '';
 				//or close to be safe $tag = '/' . $tag;
 			}
@@ -489,7 +489,7 @@
 		}
 		$newtext .= substr($text,0,$i) . $tag;
 		$text = substr($text,$i+$l);
-	}  
+	}
 
 	// Clear Tag Queue
 	$newtext .= $tagqueue;
@@ -538,10 +538,10 @@
 }
 
 function trailingslashit($string) {
-    if ( '/' != substr($string, -1)) {
-        $string .= '/';
-    }
-    return $string;
+		if ( '/' != substr($string, -1)) {
+				$string .= '/';
+		}
+		return $string;
 }
 
 function addslashes_gpc($gpc) {
@@ -557,11 +557,11 @@
 
 function stripslashes_deep($value)
 {
-   $value = is_array($value) ?
-               array_map('stripslashes_deep', $value) :
-               stripslashes($value);
+	 $value = is_array($value) ?
+							 array_map('stripslashes_deep', $value) :
+							 stripslashes($value);
 
-   return $value;
+	 return $value;
 }
 
 function antispambot($emailaddy, $mailto=0) {
@@ -601,7 +601,7 @@
 
 function convert_smilies($text) {
 	global $wp_smiliessearch, $wp_smiliesreplace;
-    $output = '';
+		$output = '';
 	if (get_settings('use_smilies')) {
 		// HTML loop taken from texturize function, could possible be consolidated
 		$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
@@ -636,64 +636,64 @@
 
 // used by wp-mail to handle charsets in email subjects
 function wp_iso_descrambler($string) {
-  /* this may only work with iso-8859-1, I'm afraid */
-  if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
-    return $string;
-  } else {
-    $subject = str_replace('_', ' ', $matches[2]);
-    $subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject);
-    return $subject;
-  }
+	/* this may only work with iso-8859-1, I'm afraid */
+	if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
+		return $string;
+	} else {
+		$subject = str_replace('_', ' ', $matches[2]);
+		$subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject);
+		return $subject;
+	}
 }
 
 
 // give it a date, it will give you the same date as GMT
 function get_gmt_from_date($string) {
-  // note: this only substracts $time_difference from the given date
-  preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);
-  $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
-  $string_gmt = gmdate('Y-m-d H:i:s', $string_time - get_settings('gmt_offset') * 3600);
-  return $string_gmt;
+	// note: this only substracts $time_difference from the given date
+	preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);
+	$string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
+	$string_gmt = gmdate('Y-m-d H:i:s', $string_time - get_settings('gmt_offset') * 3600);
+	return $string_gmt;
 }
 
 // give it a GMT date, it will give you the same date with $time_difference added
 function get_date_from_gmt($string) {
-  // note: this only adds $time_difference to the given date
-  preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);
-  $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
-  $string_localtime = gmdate('Y-m-d H:i:s', $string_time + get_settings('gmt_offset')*3600);
-  return $string_localtime;
+	// note: this only adds $time_difference to the given date
+	preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);
+	$string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
+	$string_localtime = gmdate('Y-m-d H:i:s', $string_time + get_settings('gmt_offset')*3600);
+	return $string_localtime;
 }
 
 // computes an offset in seconds from an iso8601 timezone
 function iso8601_timezone_to_offset($timezone) {
-  // $timezone is either 'Z' or '[+|-]hhmm'
-  if ($timezone == 'Z') {
-    $offset = 0;
-  } else {
-    $sign    = (substr($timezone, 0, 1) == '+') ? 1 : -1;
-    $hours   = intval(substr($timezone, 1, 2));
-    $minutes = intval(substr($timezone, 3, 4)) / 60;
-    $offset  = $sign * 3600 * ($hours + $minutes);
-  }
-  return $offset;
+	// $timezone is either 'Z' or '[+|-]hhmm'
+	if ($timezone == 'Z') {
+		$offset = 0;
+	} else {
+		$sign    = (substr($timezone, 0, 1) == '+') ? 1 : -1;
+		$hours   = intval(substr($timezone, 1, 2));
+		$minutes = intval(substr($timezone, 3, 4)) / 60;
+		$offset  = $sign * 3600 * ($hours + $minutes);
+	}
+	return $offset;
 }
 
 // converts an iso8601 date to MySQL DateTime format used by post_date[_gmt]
 function iso8601_to_datetime($date_string, $timezone = USER) {
-  if ($timezone == GMT) {
-    preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits);
-    if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset
-      $offset = iso8601_timezone_to_offset($date_bits[7]);
-    } else { // we don't have a timezone, so we assume user local timezone (not server's!)
-      $offset = 3600 * get_settings('gmt_offset');
-    }
-    $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]);
-    $timestamp -= $offset;
-    return gmdate('Y-m-d H:i:s', $timestamp);
-  } elseif ($timezone == USER) {
-    return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string);
-  }
+	if ($timezone == GMT) {
+		preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits);
+		if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset
+			$offset = iso8601_timezone_to_offset($date_bits[7]);
+		} else { // we don't have a timezone, so we assume user local timezone (not server's!)
+			$offset = 3600 * get_settings('gmt_offset');
+		}
+		$timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]);
+		$timestamp -= $offset;
+		return gmdate('Y-m-d H:i:s', $timestamp);
+	} elseif ($timezone == USER) {
+		return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string);
+	}
 }
 
 function popuplinks($text) {
@@ -708,7 +708,7 @@
 	return preg_replace('/[^a-z0-9+_.@-]/i', '', $email);
 }
 
-function human_time_diff( $from, $to = '' ) {     
+function human_time_diff( $from, $to = '' ) {
 	if ( empty($to) )
 		$to = time();
 	$diff = (int) abs($to - $from);
@@ -722,7 +722,7 @@
 		$hours = round($diff / 3600);
 		if ($hours <= 1)
 			$since = __('1 hour');
-		else 
+		else
 			$since = sprintf( __('%s hours'), $hours );
 	} elseif ($diff >= 86400) {
 		$days = round($diff / 86400);
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 3978)
+++ wp-includes/functions.php	(working copy)
@@ -12,7 +12,7 @@
 
 	if( 'U' == $dateformatstring )
 		return $i;
-	
+
 	if ( -1 == $i || false == $i )
 		$i = 0;
 
@@ -438,7 +438,7 @@
 	@set_time_limit( 60 );
 
 	if ( $red > 5 )
-	   return false;
+		 return false;
 
 	$parts = parse_url( $url );
 	$file = $parts['path'] . ($parts['query'] ? '?'.$parts['query'] : '');
@@ -467,9 +467,9 @@
 	preg_match('/.*([0-9]{3}).*/', $response, $return);
 	$headers['response'] = $return[1]; // HTTP response code eg 204, 200, 404
 
-    $code = $headers['response'];
-    if ( ('302' == $code || '301' == $code) && isset($headers['location']) )
-        return wp_get_http_headers( $headers['location'], ++$red );
+		$code = $headers['response'];
+		if ( ('302' == $code || '301' == $code) && isset($headers['location']) )
+				return wp_get_http_headers( $headers['location'], ++$red );
 
 	return $headers;
 }
@@ -743,8 +743,8 @@
 }
 
 function bool_from_yn($yn) {
-    if ($yn == 'Y') return 1;
-    return 0;
+		if ($yn == 'Y') return 1;
+		return 0;
 }
 
 function do_feed() {
@@ -754,12 +754,12 @@
 	$feed = preg_replace('/^_+/', '', $feed);
 
 	if ($feed == '' || $feed == 'feed')
-    	$feed = 'rss2';
+			$feed = 'rss2';
 
 	$for_comments = false;
 	if ( is_single() || (get_query_var('withcomments') == 1) ) {
 		$feed = 'rss2';
-		$for_comments = true;	
+		$for_comments = true;
 	}
 
 	$hook = 'do_feed_' . $feed;
@@ -899,7 +899,7 @@
 		return array('error' => $message);
 	}
 
-    $uploads = array('path' => $dir, 'url' => $url, 'error' => false);
+		$uploads = array('path' => $dir, 'url' => $url, 'error' => false);
 	return apply_filters('upload_dir', $uploads);
 }
 
Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 3978)
+++ wp-includes/general-template.php	(working copy)
@@ -438,7 +438,7 @@
 		FROM $wpdb->posts
 		WHERE post_date >	'$thisyear-$thismonth-01'
 		AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' )
-		AND post_type = 'post' AND post_status = 'publish' 
+		AND post_type = 'post' AND post_status = 'publish'
 			ORDER	BY post_date ASC
 			LIMIT 1");
 
@@ -741,7 +741,7 @@
 					var i = tinyMCE.selectedInstance;
 					if(typeof i ==  'undefined')
 						return true;
-	                                tinyMCE.execCommand("mceStartTyping");
+																	tinyMCE.execCommand("mceStartTyping");
 					this.blur();
 					i.contentWindow.focus();
 					e.returnValue = false;
@@ -756,7 +756,7 @@
 					var i = tinyMCE.selectedInstance;
 					if(typeof i ==  'undefined')
 						return true;
-	                                tinyMCE.execCommand("mceStartTyping");
+																	tinyMCE.execCommand("mceStartTyping");
 					this.blur();
 					i.contentWindow.focus();
 					e.returnValue = false;
Index: wp-includes/gettext.php
===================================================================
--- wp-includes/gettext.php	(revision 3978)
+++ wp-includes/gettext.php	(working copy)
@@ -1,32 +1,32 @@
 <?php
 /*
-   Copyright (c) 2003 Danilo Segan <danilo@kvota.net>.
-   Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
-   
-   This file is part of PHP-gettext.
+	 Copyright (c) 2003 Danilo Segan <danilo@kvota.net>.
+	 Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
 
-   PHP-gettext is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
+	 This file is part of PHP-gettext.
 
-   PHP-gettext is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+	 PHP-gettext is free software; you can redistribute it and/or modify
+	 it under the terms of the GNU General Public License as published by
+	 the Free Software Foundation; either version 2 of the License, or
+	 (at your option) any later version.
 
-   You should have received a copy of the GNU General Public License
-   along with PHP-gettext; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+	 PHP-gettext is distributed in the hope that it will be useful,
+	 but WITHOUT ANY WARRANTY; without even the implied warranty of
+	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	 GNU General Public License for more details.
 
+	 You should have received a copy of the GNU General Public License
+	 along with PHP-gettext; if not, write to the Free Software
+	 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
 */
- 
+
 /**
  * Provides a simple gettext replacement that works independently from
  * the system's gettext abilities.
  * It can read MO files and use them for translating strings.
  * The files are passed to gettext_reader as a Stream (see streams.php)
- * 
+ *
  * This version has the ability to cache all strings and translations to
  * speed up the string lookup.
  * While the cache is enabled by default, it can be switched off with the
@@ -34,328 +34,328 @@
  * that you don't want to keep in memory)
  */
 class gettext_reader {
-  //public:
-   var $error = 0; // public variable that holds error code (0 if no error)
-   
-   //private:
-  var $BYTEORDER = 0;        // 0: low endian, 1: big endian
-  var $STREAM = NULL;
-  var $short_circuit = false;
-  var $enable_cache = false;
-  var $originals = NULL;      // offset of original table
-  var $translations = NULL;    // offset of translation table
-  var $pluralheader = NULL;    // cache header field for plural forms
-  var $total = 0;          // total string count
-  var $table_originals = NULL;  // table for original strings (offsets)
-  var $table_translations = NULL;  // table for translated strings (offsets)
-  var $cache_translations = NULL;  // original -> translation mapping
+	//public:
+	 var $error = 0; // public variable that holds error code (0 if no error)
 
+	 //private:
+	var $BYTEORDER = 0;        // 0: low endian, 1: big endian
+	var $STREAM = NULL;
+	var $short_circuit = false;
+	var $enable_cache = false;
+	var $originals = NULL;      // offset of original table
+	var $translations = NULL;    // offset of translation table
+	var $pluralheader = NULL;    // cache header field for plural forms
+	var $total = 0;          // total string count
+	var $table_originals = NULL;  // table for original strings (offsets)
+	var $table_translations = NULL;  // table for translated strings (offsets)
+	var $cache_translations = NULL;  // original -> translation mapping
 
-  /* Methods */
-  
-    
-  /**
-   * Reads a 32bit Integer from the Stream
-   * 
-   * @access private
-   * @return Integer from the Stream
-   */
-  function readint() {
-      $stream = $this->STREAM->read(4);
-      if ($this->BYTEORDER == 0) {
-        // low endian
-        $unpacked = unpack('V',$stream);
-        return array_shift($unpacked);
-      } else {
-        // big endian
-        $unpacked = unpack('N',$stream);
-        return array_shift($unpacked);
-      }
-    }
 
-  /**
-   * Reads an array of Integers from the Stream
-   * 
-   * @param int count How many elements should be read
-   * @return Array of Integers
-   */
-  function readintarray($count) {
-    if ($this->BYTEORDER == 0) {
-        // low endian
-        return unpack('V'.$count, $this->STREAM->read(4 * $count));
-      } else {
-        // big endian
-        return unpack('N'.$count, $this->STREAM->read(4 * $count));
-      }
-  }
-  
-  /**
-   * Constructor
-   * 
-   * @param object Reader the StreamReader object
-   * @param boolean enable_cache Enable or disable caching of strings (default on)
-   */
-  function gettext_reader($Reader, $enable_cache = true) {
-    // If there isn't a StreamReader, turn on short circuit mode.
-    if (! $Reader) {
-      $this->short_circuit = true;
-      return;
-    }
-    
-    // Caching can be turned off
-    $this->enable_cache = $enable_cache;
+	/* Methods */
 
-    // $MAGIC1 = (int)0x950412de; //bug in PHP 5
-    $MAGIC1 = (int) - 1794895138;
-    // $MAGIC2 = (int)0xde120495; //bug
-    $MAGIC2 = (int) - 569244523;
 
-    $this->STREAM = $Reader;
-    $magic = $this->readint();
-    if ($magic == $MAGIC1) {
-      $this->BYTEORDER = 0;
-    } elseif ($magic == $MAGIC2) {
-      $this->BYTEORDER = 1;
-    } else {
-      $this->error = 1; // not MO file
-      return false;
-    }
-    
-    // FIXME: Do we care about revision? We should.
-    $revision = $this->readint();
-    
-    $this->total = $this->readint();
-    $this->originals = $this->readint();
-    $this->translations = $this->readint();
-  }
-  
-  /**
-   * Loads the translation tables from the MO file into the cache
-   * If caching is enabled, also loads all strings into a cache
-   * to speed up translation lookups
-   * 
-   * @access private
-   */
-  function load_tables() {
-    if (is_array($this->cache_translations) &&
-      is_array($this->table_originals) &&
-      is_array($this->table_translations))
-      return;
-    
-    /* get original and translations tables */
-    $this->STREAM->seekto($this->originals);
-    $this->table_originals = $this->readintarray($this->total * 2);
-    $this->STREAM->seekto($this->translations);
-    $this->table_translations = $this->readintarray($this->total * 2);
-    
-    if ($this->enable_cache) {
-      $this->cache_translations = array ();
-      /* read all strings in the cache */
-      for ($i = 0; $i < $this->total; $i++) {
-        $this->STREAM->seekto($this->table_originals[$i * 2 + 2]);
-        $original = $this->STREAM->read($this->table_originals[$i * 2 + 1]);
-        $this->STREAM->seekto($this->table_translations[$i * 2 + 2]);
-        $translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]);
-        $this->cache_translations[$original] = $translation;
-      }
-    }
-  }
-  
-  /**
-   * Returns a string from the "originals" table
-   * 
-   * @access private
-   * @param int num Offset number of original string
-   * @return string Requested string if found, otherwise ''
-   */
-  function get_original_string($num) {
-    $length = $this->table_originals[$num * 2 + 1];
-    $offset = $this->table_originals[$num * 2 + 2];
-    if (! $length)
-      return '';
-    $this->STREAM->seekto($offset);
-    $data = $this->STREAM->read($length);
-    return (string)$data;
-  }
-  
-  /**
-   * Returns a string from the "translations" table
-   * 
-   * @access private
-   * @param int num Offset number of original string
-   * @return string Requested string if found, otherwise ''
-   */
-  function get_translation_string($num) {
-    $length = $this->table_translations[$num * 2 + 1];
-    $offset = $this->table_translations[$num * 2 + 2];
-    if (! $length)
-      return '';
-    $this->STREAM->seekto($offset);
-    $data = $this->STREAM->read($length);
-    return (string)$data;
-  }
-  
-  /**
-   * Binary search for string
-   * 
-   * @access private
-   * @param string string
-   * @param int start (internally used in recursive function)
-   * @param int end (internally used in recursive function)
-   * @return int string number (offset in originals table)
-   */
-  function find_string($string, $start = -1, $end = -1) {
-    if (($start == -1) or ($end == -1)) {
-      // find_string is called with only one parameter, set start end end
-      $start = 0;
-      $end = $this->total;
-    }
-    if (abs($start - $end) <= 1) {
-      // We're done, now we either found the string, or it doesn't exist
-      $txt = $this->get_original_string($start);
-      if ($string == $txt)
-        return $start;
-      else
-        return -1;
-    } else if ($start > $end) {
-      // start > end -> turn around and start over
-      return $this->find_string($string, $end, $start);
-    } else {
-      // Divide table in two parts
-      $half = (int)(($start + $end) / 2);
-      $cmp = strcmp($string, $this->get_original_string($half));
-      if ($cmp == 0)
-        // string is exactly in the middle => return it
-        return $half;
-      else if ($cmp < 0)
-        // The string is in the upper half
-        return $this->find_string($string, $start, $half);
-      else
-        // The string is in the lower half
-        return $this->find_string($string, $half, $end);
-    }
-  }
-  
-  /**
-   * Translates a string
-   * 
-   * @access public
-   * @param string string to be translated
-   * @return string translated string (or original, if not found)
-   */
-  function translate($string) {
-    if ($this->short_circuit)
-      return $string;
-    $this->load_tables();     
-    
-    if ($this->enable_cache) {
-      // Caching enabled, get translated string from cache
-      if (array_key_exists($string, $this->cache_translations))
-        return $this->cache_translations[$string];
-      else
-        return $string;
-    } else {
-      // Caching not enabled, try to find string
-      $num = $this->find_string($string);
-      if ($num == -1)
-        return $string;
-      else
-        return $this->get_translation_string($num);
-    }
-  }
+	/**
+	 * Reads a 32bit Integer from the Stream
+	 *
+	 * @access private
+	 * @return Integer from the Stream
+	 */
+	function readint() {
+			$stream = $this->STREAM->read(4);
+			if ($this->BYTEORDER == 0) {
+				// low endian
+				$unpacked = unpack('V',$stream);
+				return array_shift($unpacked);
+			} else {
+				// big endian
+				$unpacked = unpack('N',$stream);
+				return array_shift($unpacked);
+			}
+		}
 
-  /**
-   * Get possible plural forms from MO header
-   * 
-   * @access private
-   * @return string plural form header
-   */
-  function get_plural_forms() {
-    // lets assume message number 0 is header  
-    // this is true, right?
-    $this->load_tables();
-    
-    // cache header field for plural forms
-    if (! is_string($this->pluralheader)) {
-      if ($this->enable_cache) {
-        $header = $this->cache_translations[""];
-      } else {
-        $header = $this->get_translation_string(0);
-      }
-      if (eregi("plural-forms: (.*)\n", $header, $regs))
-        $expr = $regs[1];
-      else
-        $expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
-      $this->pluralheader = $expr;
-    }
-    return $this->pluralheader;
-  }
+	/**
+	 * Reads an array of Integers from the Stream
+	 *
+	 * @param int count How many elements should be read
+	 * @return Array of Integers
+	 */
+	function readintarray($count) {
+		if ($this->BYTEORDER == 0) {
+				// low endian
+				return unpack('V'.$count, $this->STREAM->read(4 * $count));
+			} else {
+				// big endian
+				return unpack('N'.$count, $this->STREAM->read(4 * $count));
+			}
+	}
 
-  /**
-   * Detects which plural form to take
-   * 
-   * @access private
-   * @param n count
-   * @return int array index of the right plural form
-   */
-  function select_string($n) {
-    $string = $this->get_plural_forms();
-    $string = str_replace('nplurals',"\$total",$string);
-    $string = str_replace("n",$n,$string);
-    $string = str_replace('plural',"\$plural",$string);
-    
-    $total = 0;
-    $plural = 0;
+	/**
+	 * Constructor
+	 *
+	 * @param object Reader the StreamReader object
+	 * @param boolean enable_cache Enable or disable caching of strings (default on)
+	 */
+	function gettext_reader($Reader, $enable_cache = true) {
+		// If there isn't a StreamReader, turn on short circuit mode.
+		if (! $Reader) {
+			$this->short_circuit = true;
+			return;
+		}
 
-    eval("$string");
-    if ($plural >= $total) $plural = 0;
-    return $plural;
-  }
+		// Caching can be turned off
+		$this->enable_cache = $enable_cache;
 
-  /**
-   * Plural version of gettext
-   * 
-   * @access public
-   * @param string single
-   * @param string plural
-   * @param string number
-   * @return translated plural form
-   */
-  function ngettext($single, $plural, $number) {
-    if ($this->short_circuit) {
-      if ($number != 1)
-        return $plural;
-      else
-        return $single;
-    }
+		// $MAGIC1 = (int)0x950412de; //bug in PHP 5
+		$MAGIC1 = (int) - 1794895138;
+		// $MAGIC2 = (int)0xde120495; //bug
+		$MAGIC2 = (int) - 569244523;
 
-    // find out the appropriate form
-    $select = $this->select_string($number); 
-    
-    // this should contains all strings separated by NULLs
-    $key = $single.chr(0).$plural;
-    
-    
-    if ($this->enable_cache) {
-      if (! array_key_exists($key, $this->cache_translations)) {
-        return ($number != 1) ? $plural : $single;
-      } else {
-        $result = $this->cache_translations[$key];
-        $list = explode(chr(0), $result);
-        return $list[$select];
-      }
-    } else {
-      $num = $this->find_string($key);
-      if ($num == -1) {
-        return ($number != 1) ? $plural : $single;
-      } else {
-        $result = $this->get_translation_string($num);
-        $list = explode(chr(0), $result);
-        return $list[$select];
-      }
-    }
-  }
+		$this->STREAM = $Reader;
+		$magic = $this->readint();
+		if ($magic == $MAGIC1) {
+			$this->BYTEORDER = 0;
+		} elseif ($magic == $MAGIC2) {
+			$this->BYTEORDER = 1;
+		} else {
+			$this->error = 1; // not MO file
+			return false;
+		}
 
+		// FIXME: Do we care about revision? We should.
+		$revision = $this->readint();
+
+		$this->total = $this->readint();
+		$this->originals = $this->readint();
+		$this->translations = $this->readint();
+	}
+
+	/**
+	 * Loads the translation tables from the MO file into the cache
+	 * If caching is enabled, also loads all strings into a cache
+	 * to speed up translation lookups
+	 *
+	 * @access private
+	 */
+	function load_tables() {
+		if (is_array($this->cache_translations) &&
+			is_array($this->table_originals) &&
+			is_array($this->table_translations))
+			return;
+
+		/* get original and translations tables */
+		$this->STREAM->seekto($this->originals);
+		$this->table_originals = $this->readintarray($this->total * 2);
+		$this->STREAM->seekto($this->translations);
+		$this->table_translations = $this->readintarray($this->total * 2);
+
+		if ($this->enable_cache) {
+			$this->cache_translations = array ();
+			/* read all strings in the cache */
+			for ($i = 0; $i < $this->total; $i++) {
+				$this->STREAM->seekto($this->table_originals[$i * 2 + 2]);
+				$original = $this->STREAM->read($this->table_originals[$i * 2 + 1]);
+				$this->STREAM->seekto($this->table_translations[$i * 2 + 2]);
+				$translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]);
+				$this->cache_translations[$original] = $translation;
+			}
+		}
+	}
+
+	/**
+	 * Returns a string from the "originals" table
+	 *
+	 * @access private
+	 * @param int num Offset number of original string
+	 * @return string Requested string if found, otherwise ''
+	 */
+	function get_original_string($num) {
+		$length = $this->table_originals[$num * 2 + 1];
+		$offset = $this->table_originals[$num * 2 + 2];
+		if (! $length)
+			return '';
+		$this->STREAM->seekto($offset);
+		$data = $this->STREAM->read($length);
+		return (string)$data;
+	}
+
+	/**
+	 * Returns a string from the "translations" table
+	 *
+	 * @access private
+	 * @param int num Offset number of original string
+	 * @return string Requested string if found, otherwise ''
+	 */
+	function get_translation_string($num) {
+		$length = $this->table_translations[$num * 2 + 1];
+		$offset = $this->table_translations[$num * 2 + 2];
+		if (! $length)
+			return '';
+		$this->STREAM->seekto($offset);
+		$data = $this->STREAM->read($length);
+		return (string)$data;
+	}
+
+	/**
+	 * Binary search for string
+	 *
+	 * @access private
+	 * @param string string
+	 * @param int start (internally used in recursive function)
+	 * @param int end (internally used in recursive function)
+	 * @return int string number (offset in originals table)
+	 */
+	function find_string($string, $start = -1, $end = -1) {
+		if (($start == -1) or ($end == -1)) {
+			// find_string is called with only one parameter, set start end end
+			$start = 0;
+			$end = $this->total;
+		}
+		if (abs($start - $end) <= 1) {
+			// We're done, now we either found the string, or it doesn't exist
+			$txt = $this->get_original_string($start);
+			if ($string == $txt)
+				return $start;
+			else
+				return -1;
+		} else if ($start > $end) {
+			// start > end -> turn around and start over
+			return $this->find_string($string, $end, $start);
+		} else {
+			// Divide table in two parts
+			$half = (int)(($start + $end) / 2);
+			$cmp = strcmp($string, $this->get_original_string($half));
+			if ($cmp == 0)
+				// string is exactly in the middle => return it
+				return $half;
+			else if ($cmp < 0)
+				// The string is in the upper half
+				return $this->find_string($string, $start, $half);
+			else
+				// The string is in the lower half
+				return $this->find_string($string, $half, $end);
+		}
+	}
+
+	/**
+	 * Translates a string
+	 *
+	 * @access public
+	 * @param string string to be translated
+	 * @return string translated string (or original, if not found)
+	 */
+	function translate($string) {
+		if ($this->short_circuit)
+			return $string;
+		$this->load_tables();
+
+		if ($this->enable_cache) {
+			// Caching enabled, get translated string from cache
+			if (array_key_exists($string, $this->cache_translations))
+				return $this->cache_translations[$string];
+			else
+				return $string;
+		} else {
+			// Caching not enabled, try to find string
+			$num = $this->find_string($string);
+			if ($num == -1)
+				return $string;
+			else
+				return $this->get_translation_string($num);
+		}
+	}
+
+	/**
+	 * Get possible plural forms from MO header
+	 *
+	 * @access private
+	 * @return string plural form header
+	 */
+	function get_plural_forms() {
+		// lets assume message number 0 is header
+		// this is true, right?
+		$this->load_tables();
+
+		// cache header field for plural forms
+		if (! is_string($this->pluralheader)) {
+			if ($this->enable_cache) {
+				$header = $this->cache_translations[""];
+			} else {
+				$header = $this->get_translation_string(0);
+			}
+			if (eregi("plural-forms: (.*)\n", $header, $regs))
+				$expr = $regs[1];
+			else
+				$expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
+			$this->pluralheader = $expr;
+		}
+		return $this->pluralheader;
+	}
+
+	/**
+	 * Detects which plural form to take
+	 *
+	 * @access private
+	 * @param n count
+	 * @return int array index of the right plural form
+	 */
+	function select_string($n) {
+		$string = $this->get_plural_forms();
+		$string = str_replace('nplurals',"\$total",$string);
+		$string = str_replace("n",$n,$string);
+		$string = str_replace('plural',"\$plural",$string);
+
+		$total = 0;
+		$plural = 0;
+
+		eval("$string");
+		if ($plural >= $total) $plural = 0;
+		return $plural;
+	}
+
+	/**
+	 * Plural version of gettext
+	 *
+	 * @access public
+	 * @param string single
+	 * @param string plural
+	 * @param string number
+	 * @return translated plural form
+	 */
+	function ngettext($single, $plural, $number) {
+		if ($this->short_circuit) {
+			if ($number != 1)
+				return $plural;
+			else
+				return $single;
+		}
+
+		// find out the appropriate form
+		$select = $this->select_string($number);
+
+		// this should contains all strings separated by NULLs
+		$key = $single.chr(0).$plural;
+
+
+		if ($this->enable_cache) {
+			if (! array_key_exists($key, $this->cache_translations)) {
+				return ($number != 1) ? $plural : $single;
+			} else {
+				$result = $this->cache_translations[$key];
+				$list = explode(chr(0), $result);
+				return $list[$select];
+			}
+		} else {
+			$num = $this->find_string($key);
+			if ($num == -1) {
+				return ($number != 1) ? $plural : $single;
+			} else {
+				$result = $this->get_translation_string($num);
+				$list = explode(chr(0), $result);
+				return $list[$select];
+			}
+		}
+	}
+
 }
 
 ?>
Index: wp-includes/l10n.php
===================================================================
--- wp-includes/l10n.php	(revision 3978)
+++ wp-includes/l10n.php	(working copy)
@@ -23,7 +23,7 @@
 	return $locale;
 }
 
-// Return a translated string.    
+// Return a translated string.
 function __($text, $domain = 'default') {
 	global $l10n;
 
Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 3978)
+++ wp-includes/link-template.php	(working copy)
@@ -63,7 +63,7 @@
 		$authordata = get_userdata($post->post_author);
 		$author = $authordata->user_nicename;
 		$date = explode(" ",date('Y m d H i s', $unixtime));
-		$rewritereplace = 
+		$rewritereplace =
 		array(
 			$date[0],
 			$date[1],
@@ -266,7 +266,7 @@
 		for ( $i = 1; $i < (count($cat_array)); $i++ ) {
 			$join .= ' OR category_id = ' . intval($cat_array[$i]->cat_ID);
 		}
-		$join .= ')'; 
+		$join .= ')';
 	}
 
 	$sql_exclude_cats = '';
@@ -299,7 +299,7 @@
 		for ( $i = 1; $i < (count($cat_array)); $i++ ) {
 			$join .= ' OR category_id = ' . intval($cat_array[$i]->cat_ID);
 		}
-		$join .= ')'; 
+		$join .= ')';
 	}
 
 	$sql_exclude_cats = '';
@@ -334,7 +334,7 @@
 
 	$format = str_replace('%link', $link, $format);
 
-	echo $format;	    
+	echo $format;
 }
 
 function next_post_link($format='%link &raquo;', $link='%title', $in_same_cat = false, $excluded_categories = '') {
@@ -349,7 +349,7 @@
 	$link = $string . $link . '</a>';
 	$format = str_replace('%link', $link, $format);
 
-	echo $format;	    
+	echo $format;
 }
 
 function get_pagenum_link($pagenum = 1) {
@@ -357,7 +357,7 @@
 
 	$qstr = wp_specialchars($_SERVER['REQUEST_URI']);
 
-	$page_querystring = "paged"; 
+	$page_querystring = "paged";
 	$page_modstring = "page/";
 	$page_modregex = "page/?";
 	$permalink = 0;
@@ -474,9 +474,9 @@
 function _max_num_pages() {
 	static $max_num_pages;
 	global $wpdb, $wp_query;
-	
+
 	if (isset($max_num_pages)) return $max_num_pages;
-	
+
 	if ( 'posts' == get_query_var('what_to_show') ) {
 		preg_match('#FROM\s(.*)\sORDER BY#siU', $wp_query->request, $matches);
 		$fromwhere = $matches[1];
@@ -496,7 +496,7 @@
 	if ( !is_single() ) {
 		$max_num_pages = _max_num_pages();
 		$paged = get_query_var('paged');
-		
+
 		//only have sep if there's both prev and next results
 		if ($paged < 2 || $paged >= $max_num_pages) {
 			$sep = '';
Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php	(revision 3978)
+++ wp-includes/pluggable.php	(working copy)
@@ -46,7 +46,7 @@
 	if ( ! empty($current_user) )
 		return;
 
-	if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) || 
+	if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ||
 		!wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true) ) {
 		wp_set_current_user(0);
 		return false;
@@ -162,7 +162,7 @@
 function wp_mail($to, $subject, $message, $headers = '') {
 	if( $headers == '' ) {
 		$headers = "MIME-Version: 1.0\n" .
-			"From: wordpress@" . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . "\n" . 
+			"From: wordpress@" . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . "\n" .
 			"Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
 	}
 
@@ -216,7 +216,7 @@
 if ( !function_exists('auth_redirect') ) :
 function auth_redirect() {
 	// Checks if a user is logged in, if not redirects them to the login page
-	if ( (!empty($_COOKIE[USER_COOKIE]) && 
+	if ( (!empty($_COOKIE[USER_COOKIE]) &&
 				!wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true)) ||
 			 (empty($_COOKIE[USER_COOKIE])) ) {
 		nocache_headers();
@@ -327,7 +327,7 @@
 if ( ! function_exists('wp_notify_postauthor') ) :
 function wp_notify_postauthor($comment_id, $comment_type='') {
 	global $wpdb;
-    
+
 	$comment = get_comment($comment_id);
 	$post    = get_post($comment->comment_post_ID);
 	$user    = get_userdata( $post->post_author );
@@ -374,11 +374,11 @@
 		$from = "From: \"$blogname\" <$wp_email>";
 		if ( '' != $comment->comment_author_email )
 			$reply_to = "Reply-To: $comment->comment_author_email";
- 	} else {
+	} else {
 		$from = "From: \"$comment->comment_author\" <$wp_email>";
 		if ( '' != $comment->comment_author_email )
 			$reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
- 	}
+	}
 
 	$message_headers = "MIME-Version: 1.0\n"
 		. "$from\n"
@@ -392,23 +392,23 @@
 	$message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id);
 
 	@wp_mail($user->user_email, $subject, $notify_message, $message_headers);
-   
+
 	return true;
 }
 endif;
 
 /* wp_notify_moderator
-   notifies the moderator of the blog (usually the admin)
-   about a new comment that waits for approval
-   always returns true
+	 notifies the moderator of the blog (usually the admin)
+	 about a new comment that waits for approval
+	 always returns true
  */
 if ( !function_exists('wp_notify_moderator') ) :
 function wp_notify_moderator($comment_id) {
 	global $wpdb;
 
 	if( get_settings( "moderation_notify" ) == 0 )
-		return true; 
-    
+		return true;
+
 	$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
 	$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
 
@@ -435,7 +435,7 @@
 	$subject = apply_filters('comment_moderation_subject', $subject, $comment_id);
 
 	@wp_mail($admin_email, $subject, $notify_message);
-    
+
 	return true;
 }
 endif;
@@ -485,7 +485,7 @@
 	$uid = $user->id;
 
 	$i = ceil(time() / 43200);
-	
+
 	return substr(wp_hash($i . $action . $uid), -12, 10);
 }
 endif;
Index: wp-includes/plugin.php
===================================================================
--- wp-includes/plugin.php	(revision 3978)
+++ wp-includes/plugin.php	(working copy)
@@ -103,8 +103,8 @@
 function do_action($tag, $arg = '') {
 	global $wp_filter;
 	$extra_args = array_slice(func_get_args(), 2);
- 	if ( is_array($arg) )
- 		$args = array_merge($arg, $extra_args);
+	if ( is_array($arg) )
+		$args = array_merge($arg, $extra_args);
 	else
 		$args = array_merge(array($arg), $extra_args);
 
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 3978)
+++ wp-includes/post.php	(working copy)
@@ -160,8 +160,8 @@
 	$inclusions = '';
 	if ( !empty($include) ) {
 		$offset = 0;	//ignore offset, category, exclude, meta_key, and meta_value params if using include
-		$category = ''; 
-		$exclude = '';  
+		$category = '';
+		$exclude = '';
 		$meta_key = '';
 		$meta_value = '';
 		$incposts = preg_split('/[\s,]+/',$include);
@@ -175,8 +175,8 @@
 			}
 		}
 	}
-	if (!empty($inclusions)) 
-		$inclusions .= ')';	
+	if (!empty($inclusions))
+		$inclusions .= ')';
 
 	$exclusions = '';
 	if ( !empty($exclude) ) {
@@ -190,12 +190,12 @@
 			}
 		}
 	}
-	if (!empty($exclusions)) 
+	if (!empty($exclusions))
 		$exclusions .= ')';
 
 	$query ="SELECT DISTINCT * FROM $wpdb->posts " ;
-	$query .= ( empty( $category ) ? "" : ", $wpdb->post2cat " ) ; 
-	$query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ; 
+	$query .= ( empty( $category ) ? "" : ", $wpdb->post2cat " ) ;
+	$query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ;
 	$query .= " WHERE (post_type = 'post' AND post_status = 'publish') $exclusions $inclusions " ;
 	$query .= ( empty( $category ) ? "" : "AND ($wpdb->posts.ID = $wpdb->post2cat.post_id AND $wpdb->post2cat.category_id = " . $category. ") " ) ;
 	$query .= ( empty( $meta_key ) | empty($meta_value)  ? "" : " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )" ) ;
@@ -429,9 +429,9 @@
 
 	$post_ID = (int) $post_ID;
 
-	$sql = "SELECT category_id 
-		FROM $wpdb->post2cat 
-		WHERE post_id = '$post_ID' 
+	$sql = "SELECT category_id
+		FROM $wpdb->post2cat
+		WHERE post_id = '$post_ID'
 		ORDER BY category_id";
 
 	$result = $wpdb->get_col($sql);
@@ -464,7 +464,7 @@
 	// Set categories
 	if($mode == OBJECT) {
 		$post->post_category = wp_get_post_categories($postid);
-	} 
+	}
 	else {
 		$post['post_category'] = wp_get_post_categories($postid);
 	}
@@ -657,13 +657,13 @@
 		if ( !defined('WP_IMPORTING') ) {
 			if ( $post_pingback )
 				$result = $wpdb->query("
-					INSERT INTO $wpdb->postmeta 
-					(post_id,meta_key,meta_value) 
+					INSERT INTO $wpdb->postmeta
+					(post_id,meta_key,meta_value)
 					VALUES ('$post_ID','_pingme','1')
 				");
 			$result = $wpdb->query("
-				INSERT INTO $wpdb->postmeta 
-				(post_id,meta_key,meta_value) 
+				INSERT INTO $wpdb->postmeta
+				(post_id,meta_key,meta_value)
 				VALUES ('$post_ID','_encloseme','1')
 			");
 			wp_schedule_single_event(time(), 'do_pings');
@@ -675,7 +675,7 @@
 		if ( !empty($page_template) )
 			if ( ! update_post_meta($post_ID, '_wp_page_template',  $page_template))
 				add_post_meta($post_ID, '_wp_page_template',  $page_template, true);
-				
+
 		if ( $post_status == 'publish' )
 			do_action('publish_page', $post_ID);
 	}
@@ -683,7 +683,7 @@
 	if ( 'future' == $post_status ) {
 		wp_schedule_single_event(mysql2date('U', $post_date), 'publish_future_post', $post_ID);
 	}
-		
+
 	do_action('save_post', $post_ID);
 	do_action('wp_insert_post', $post_ID);
 
@@ -703,22 +703,22 @@
 	$post = add_magic_quotes($post);
 
 	// Passed post category list overwrites existing category list if not empty.
- 	if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
+	if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
 			 && 0 != count($postarr['post_category']) )
- 		$post_cats = $postarr['post_category'];
- 	else 
- 		$post_cats = $post['post_category'];
+		$post_cats = $postarr['post_category'];
+	else
+		$post_cats = $post['post_category'];
 
 	// Drafts shouldn't be assigned a date unless explicitly done so by the user
-	if ( 'draft' == $post['post_status'] && empty($postarr['edit_date']) && empty($postarr['post_date']) && 
-	     ('0000-00-00 00:00:00' == $post['post_date']) )
+	if ( 'draft' == $post['post_status'] && empty($postarr['edit_date']) && empty($postarr['post_date']) &&
+			 ('0000-00-00 00:00:00' == $post['post_date']) )
 		$clear_date = true;
 	else
 		$clear_date = false;
 
- 	// Merge old and new fields with new fields overwriting old ones.
- 	$postarr = array_merge($post, $postarr);
- 	$postarr['post_category'] = $post_cats;
+	// Merge old and new fields with new fields overwriting old ones.
+	$postarr = array_merge($post, $postarr);
+	$postarr['post_category'] = $post_cats;
 	if ( $clear_date ) {
 		$postarr['post_date'] = '';
 		$postarr['post_date_gmt'] = '';
@@ -739,7 +739,7 @@
 	if ( 'publish' == $post->post_status )
 		return;
 
-	return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id));	
+	return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id));
 }
 
 function wp_set_post_categories($post_ID = 0, $post_categories = array()) {
@@ -752,8 +752,8 @@
 
 	// First the old categories
 	$old_categories = $wpdb->get_col("
-		SELECT category_id 
-		FROM $wpdb->post2cat 
+		SELECT category_id
+		FROM $wpdb->post2cat
 		WHERE post_id = $post_ID");
 
 	if (!$old_categories) {
@@ -768,9 +768,9 @@
 	if ($delete_cats) {
 		foreach ($delete_cats as $del) {
 			$wpdb->query("
-				DELETE FROM $wpdb->post2cat 
-				WHERE category_id = $del 
-					AND post_id = $post_ID 
+				DELETE FROM $wpdb->post2cat
+				WHERE category_id = $del
+					AND post_id = $post_ID
 				");
 		}
 	}
@@ -781,7 +781,7 @@
 	if ($add_cats) {
 		foreach ($add_cats as $new_cat) {
 			$wpdb->query("
-				INSERT INTO $wpdb->post2cat (post_id, category_id) 
+				INSERT INTO $wpdb->post2cat (post_id, category_id)
 				VALUES ($post_ID, $new_cat)");
 		}
 	}
@@ -866,10 +866,10 @@
 
 		$trackback_urls = explode(',', $tb_list);
 		foreach($trackback_urls as $tb_url) {
-		    $tb_url = trim($tb_url);
-		    trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);
+				$tb_url = trim($tb_url);
+				trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);
 		}
-    }
+		}
 }
 
 //
@@ -946,7 +946,7 @@
 
 	$pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path' AND post_type='page'");
 
-	if ( empty($pages) ) 
+	if ( empty($pages) )
 		return NULL;
 
 	foreach ($pages as $page) {
@@ -1026,8 +1026,8 @@
 
 	$inclusions = '';
 	if ( !empty($include) ) {
-		$child_of = 0; //ignore child_of, exclude, meta_key, and meta_value params if using include 
-		$exclude = '';  
+		$child_of = 0; //ignore child_of, exclude, meta_key, and meta_value params if using include
+		$exclude = '';
 		$meta_key = '';
 		$meta_value = '';
 		$incpages = preg_split('/[\s,]+/',$include);
@@ -1040,8 +1040,8 @@
 			}
 		}
 	}
-	if (!empty($inclusions)) 
-		$inclusions .= ')';	
+	if (!empty($inclusions))
+		$inclusions .= ')';
 
 	$exclusions = '';
 	if ( !empty($exclude) ) {
@@ -1055,11 +1055,11 @@
 			}
 		}
 	}
-	if (!empty($exclusions)) 
+	if (!empty($exclusions))
 		$exclusions .= ')';
 
 	$query = "SELECT * FROM $wpdb->posts " ;
-	$query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ; 
+	$query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ;
 	$query .= " WHERE (post_type = 'page' AND post_status = 'publish') $exclusions $inclusions " ;
 	$query .= ( empty( $meta_key ) | empty($meta_value)  ? "" : " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )" ) ;
 	$query .= " ORDER BY " . $sort_column . " " . $sort_order ;
@@ -1177,7 +1177,7 @@
 
 	if (empty($post_date))
 		$post_date = current_time('mysql');
-	if (empty($post_date_gmt)) 
+	if (empty($post_date_gmt))
 		$post_date_gmt = current_time('mysql', 1);
 
 	if ( empty($comment_status) ) {
Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 3978)
+++ wp-includes/query.php	(working copy)
@@ -3,7 +3,7 @@
 /*
  * The Big Query.
  */
- 
+
 function get_query_var($var) {
 	global $wp_query;
 
@@ -217,7 +217,7 @@
 /*
  * The Loop.  Post loop control.
  */
- 
+
 function have_posts() {
 	global $wp_query;
 
@@ -359,8 +359,8 @@
 		} elseif ( $qv['p'] ) {
 			$this->is_single = true;
 		} elseif (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
-			// If year, month, day, hour, minute, and second are set, a single 
-			// post is being queried.        
+			// If year, month, day, hour, minute, and second are set, a single
+			// post is being queried.
 			$this->is_single = true;
 		} elseif ('' != $qv['static'] || '' != $qv['pagename'] || '' != $qv['page_id']) {
 			$this->is_page = true;
@@ -436,7 +436,7 @@
 			if ('' != $qv['category_name']) {
 				$this->is_category = true;
 			}
-            
+
 			if ((empty($qv['author'])) || ($qv['author'] == '0')) {
 				$this->is_author = false;
 			} else {
@@ -700,7 +700,7 @@
 
 		// Category stuff
 
-		if ((empty($q['cat'])) || ($q['cat'] == '0') || 
+		if ((empty($q['cat'])) || ($q['cat'] == '0') ||
 				// Bypass cat checks if fetching specific posts
 				( $this->is_single || $this->is_page )) {
 			$whichcat='';
@@ -717,7 +717,7 @@
 				if ( $in )
 					$in_cats .= "$cat, " . get_category_children($cat, '', ', ');
 				else
-					$out_cats .= "$cat, " . get_category_children($cat, '', ', ');				
+					$out_cats .= "$cat, " . get_category_children($cat, '', ', ');
 			}
 			$in_cats = substr($in_cats, 0, -2);
 			$out_cats = substr($out_cats, 0, -2);
@@ -762,7 +762,7 @@
 				$reqcat = 0;
 
 			$q['cat'] = $reqcat;
-				
+
 			$tables = ", $wpdb->post2cat, $wpdb->categories";
 			$join = " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) LEFT JOIN $wpdb->categories ON ($wpdb->post2cat.category_id = $wpdb->categories.cat_ID) ";
 			$whichcat = " AND category_id IN ({$q['cat']}, ";
@@ -853,7 +853,7 @@
 
 			if ( is_admin() )
 				$where .= " OR post_status = 'future' OR post_status = 'draft'";
-	
+
 			if ( is_user_logged_in() ) {
 				if ( 'post' == $post_type )
 					$cap = 'edit_private_posts';
@@ -963,7 +963,7 @@
 	}
 
 	function next_post() {
-        
+
 		$this->current_post++;
 
 		$this->post = $this->posts[$this->current_post];
@@ -999,7 +999,7 @@
 			$this->post = $this->posts[0];
 		}
 	}
-    
+
 	function &query($query) {
 		$this->parse_query($query);
 		return $this->get_posts();
Index: wp-includes/registration.php
===================================================================
--- wp-includes/registration.php	(revision 3978)
+++ wp-includes/registration.php	(working copy)
@@ -85,9 +85,9 @@
 		$wpdb->query( $query );
 		$user_id = $ID;
 	} else {
-		$query = "INSERT INTO $wpdb->users 
+		$query = "INSERT INTO $wpdb->users
 		(user_login, user_pass, user_email, user_url, user_registered, user_nicename, display_name)
-	VALUES 
+	VALUES
 		('$user_login', '$user_pass', '$user_email', '$user_url', '$user_registered', '$user_nicename', '$display_name')";
 		$query = apply_filters('create_user_query', $query);
 		$wpdb->query( $query );
Index: wp-includes/rewrite.php
===================================================================
--- wp-includes/rewrite.php	(revision 3978)
+++ wp-includes/rewrite.php	(working copy)
@@ -16,15 +16,15 @@
 	if (strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%') {
 		return;
 	}
-	
+
 	$qv = trim($tagname, '%');
-	
+
 	global $wp_rewrite, $wp;
 	$wp->add_query_var($qv);
 	$wp_rewrite->add_rewrite_tag($tagname, $regex, $qv . '=');
 }
 
-//Add a new feed type like /atom1/ 
+//Add a new feed type like /atom1/
 function add_feed($feedname, $function) {
 	global $wp_rewrite;
 	if (!in_array($feedname, $wp_rewrite->feeds)) { //override the file if it is
@@ -169,7 +169,7 @@
 	var $non_wp_rules; //rules that don't redirect to WP's index.php
 	var $endpoints;
 	var $use_verbose_rules = false;
-	var $rewritecode = 
+	var $rewritecode =
 		array(
 					'%year%',
 					'%monthnum%',
@@ -185,7 +185,7 @@
 					'%search%'
 					);
 
-	var $rewritereplace = 
+	var $rewritereplace =
 		array(
 					'([0-9]{4})',
 					'([0-9]{1,2})',
@@ -201,7 +201,7 @@
 					'(.+)'
 					);
 
-	var $queryreplace = 
+	var $queryreplace =
 		array (
 					'year=',
 					'monthnum=',
@@ -218,7 +218,7 @@
 					);
 
 	var $feeds = array ( 'feed', 'rdf', 'rss', 'rss2', 'atom' );
-	
+
 	function using_permalinks() {
 		if (empty($this->permalink_structure))
 			return false;
@@ -235,7 +235,7 @@
 		if (preg_match('#^/*' . $this->index . '#', $this->permalink_structure)) {
 			return true;
 		}
-    
+
 		return false;
 	}
 
@@ -251,11 +251,11 @@
 		$match_suffix = '';
 
 		if (! empty($this->matches)) {
-			$match_prefix = '$' . $this->matches . '['; 
+			$match_prefix = '$' . $this->matches . '[';
 			$match_suffix = ']';
-		}        
+		}
 
-		return "$match_prefix$number$match_suffix";        
+		return "$match_prefix$number$match_suffix";
 	}
 
 	function page_rewrite_rules() {
@@ -301,13 +301,13 @@
 				$date_endian= $endian;
 				break;
 			}
-		} 
+		}
 
 		if ( empty($date_endian) )
 			$date_endian = '%year%/%monthnum%/%day%';
 
 		// Do not allow the date tags and %post_id% to overlap in the permalink
-		// structure. If they do, move the date tags to $front/date/.  
+		// structure. If they do, move the date tags to $front/date/.
 		$front = $this->front;
 		preg_match_all('/%.+?%/', $this->permalink_structure, $tokens);
 		$tok_index = 1;
@@ -481,11 +481,11 @@
 		//build a regex to match the trackback and page/xx parts of URLs
 		$trackbackregex = 'trackback/?$';
 		$pageregex = 'page/?([0-9]{1,})/?$';
-		
+
 		//build up an array of endpoint regexes to append => queries to append
 		if ($endpoints) {
 			$ep_query_append = array ();
-			foreach ($this->endpoints as $endpoint) { 
+			foreach ($this->endpoints as $endpoint) {
 				//match everything after the endpoint name, but allow for nothing to appear there
 				$epmatch = $endpoint[1] . '(/(.*))?/?$';
 				//this will be appended on to the rest of the query for each dir
@@ -510,7 +510,7 @@
 			if (0 < $i) {
 				$queries[$i] = $queries[$i - 1] . '&';
 			}
-             
+
 			$query_token = str_replace($this->rewritecode, $this->queryreplace, $tokens[0][$i]) . $this->preg_index($i+1);
 			$queries[$i] .= $query_token;
 		}
@@ -547,7 +547,7 @@
 			$num_toks = preg_match_all('/%.+?%/', $struct, $toks);
 			//get the 'tagname=$matches[i]'
 			$query = $queries[$num_toks - 1];
-			
+
 			//set up $ep_mask_specific which is used to match more specific URL types
 			switch ($dirs[$j]) {
 				case '%year%': $ep_mask_specific = EP_YEAR; break;
@@ -579,15 +579,15 @@
 				$rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2);
 			if ($paged) //...and /page/xx ones
 				$rewrite = array_merge($rewrite, array($pagematch => $pagequery));
-			
+
 			//if we've got some tags in this dir
 			if ($num_toks) {
 				$post = false;
 				$page = false;
-				
-				//check to see if this dir is permalink-level: i.e. the structure specifies an 
+
+				//check to see if this dir is permalink-level: i.e. the structure specifies an
 				//individual post. Do this by checking it contains at least one of 1) post name,
-				//2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and 
+				//2) post ID, 3) page name, 4) timestamp (year, month, day, hour, second and
 				//minute all present). Set these flags now as we need them for the endpoints.
 				if (strstr($struct, '%postname%') || strstr($struct, '%post_id%')
 						|| strstr($struct, '%pagename%')
@@ -596,7 +596,7 @@
 					if  ( strstr($struct, '%pagename%') )
 						$page = true;
 				}
-				
+
 				//do endpoints
 				if ($endpoints) {
 					foreach ($ep_query_append as $regex => $ep) {
@@ -606,7 +606,7 @@
 						}
 					}
 				}
-				
+
 				//if we're creating rules for a permalink, do all the endpoints like attachments etc
 				if ($post) {
 					$post = true;
@@ -617,7 +617,7 @@
 					$match = rtrim($match, '/');
 					//get rid of brackets
 					$submatchbase = str_replace(array('(',')'),'',$match);
-					
+
 					//add a rule for at attachments, which take the form of <permalink>/some-text
 					$sub1 = $submatchbase . '/([^/]+)/';
 					$sub1tb = $sub1 . $trackbackregex; //add trackback regex <permalink>/trackback/...
@@ -625,19 +625,19 @@
 					$sub1feed2 = $sub1 . $feedregex2; //and <permalink>/(feed|atom...)
 					//add an ? as we don't have to match that last slash, and finally a $ so we
 					//match to the end of the URL
-					
+
 					//add another rule to match attachments in the explicit form:
 					//<permalink>/attachment/some-text
 					$sub2 = $submatchbase . '/attachment/([^/]+)/';
 					$sub2tb = $sub2 . $trackbackregex; //and add trackbacks <permalink>/attachment/trackback
 					$sub2feed = $sub2 . $feedregex;    //feeds, <permalink>/attachment/feed/(atom|...)
 					$sub2feed2 = $sub2 . $feedregex2;  //and feeds again on to this <permalink>/attachment/(feed|atom...)
-					
+
 					//create queries for these extra tag-ons we've just dealt with
 					$subquery = $index . '?attachment=' . $this->preg_index(1);
 					$subtbquery = $subquery . '&tb=1';
 					$subfeedquery = $subquery . '&feed=' . $this->preg_index(2);
-					
+
 					//do endpoints for attachments
 					if ($endpoint) { foreach ($ep_query_append as $regex => $ep) {
 						if ($ep[0] & EP_ATTACHMENT) {
@@ -645,11 +645,11 @@
 							$rewrite[$sub2 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2);
 						}
 					} }
-					
+
 					//now we've finished with endpoints, finish off the $sub1 and $sub2 matches
 					$sub1 .= '?$';
 					$sub2 .= '?$';
-					
+
 					//allow URLs like <permalink>/2 for <permalink>/page/2
 					$match = $match . '(/[0-9]+)?/?$';
 					$query = $index . '?' . $query . '&page=' . $this->preg_index($num_toks + 1);
@@ -658,7 +658,7 @@
 					$match .= '?$';
 					$query = $index . '?' . $query;
 				}
-				
+
 				//create the final array for this dir by joining the $rewrite array (which currently
 				//only contains rules/queries for trackback, pages etc) to the main regex/query for
 				//this dir
@@ -668,7 +668,7 @@
 				if ($post) {
 					//add trackback
 					$rewrite = array_merge(array($trackbackmatch => $trackbackquery), $rewrite);
-					
+
 					//add regexes/queries for attachments, attachment trackbacks and so on
 					if ( ! $page ) //require <permalink>/attachment/stuff form for pages because of confusion with subpages
 						$rewrite = array_merge($rewrite, array($sub1 => $subquery, $sub1tb => $subtbquery, $sub1feed => $subfeedquery, $sub1feed2 => $subfeedquery));
@@ -762,11 +762,11 @@
 
 		$home_root = parse_url(get_settings('home'));
 		$home_root = trailingslashit($home_root['path']);
-    
+
 		$rules = "<IfModule mod_rewrite.c>\n";
 		$rules .= "RewriteEngine On\n";
 		$rules .= "RewriteBase $home_root\n";
-		
+
 		//add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all)
 		foreach ($this->non_wp_rules as $match => $query) {
 			// Apache 1.3 does not support the reluctant (non-greedy) modifier.
@@ -818,7 +818,7 @@
 
 		return $rules;
 	}
-	
+
 	//Add a straight rewrite rule
 	function add_rule($regex, $redirect) {
 		//get everything up to the first ?
@@ -830,12 +830,12 @@
 			$this->extra_rules[$regex] = $redirect;
 		}
 	}
-	
+
 	//add a rule that doesn't redirect to index.php
 	function add_external_rule($regex, $redirect) {
 		$this->non_wp_rules[$regex] = $redirect;
 	}
-	
+
 	//add an endpoint, like /trackback/, to be inserted after certain URL types (specified in $places)
 	function add_endpoint($name, $places) {
 		global $wp;
Index: wp-includes/rss.php
===================================================================
--- wp-includes/rss.php	(revision 3978)
+++ wp-includes/rss.php	(working copy)
@@ -11,7 +11,7 @@
 define('ATOM', 'Atom');
 define('MAGPIE_USER_AGENT', 'WordPress/' . $wp_version);
 
-class MagpieRSS { 
+class MagpieRSS {
 	var $parser;
 	var $current_item	= array();	// item currently being parsed
 	var $items			= array();	// collection of parsed items
@@ -25,7 +25,7 @@
 	var $stack				= array(); // parser stack
 	var $inchannel			= false;
 	var $initem 			= false;
-	var $incontent			= false; // if in Atom <content mode="xml"> field 
+	var $incontent			= false; // if in Atom <content mode="xml"> field
 	var $intextinput		= false;
 	var $inimage 			= false;
 	var $current_field		= '';
@@ -54,10 +54,10 @@
 		# setup handlers
 		#
 		xml_set_object( $this->parser, $this );
-		xml_set_element_handler($this->parser, 
+		xml_set_element_handler($this->parser,
 				'feed_start_element', 'feed_end_element' );
 
-		xml_set_character_data_handler( $this->parser, 'feed_cdata' ); 
+		xml_set_character_data_handler( $this->parser, 'feed_cdata' );
 
 		$status = xml_parse( $this->parser, $source );
 
@@ -85,7 +85,7 @@
 		// check for a namespace, and split if found
 		$ns	= false;
 		if ( strpos( $element, ':' ) ) {
-			list($ns, $el) = split( ':', $element, 2); 
+			list($ns, $el) = split( ':', $element, 2);
 		}
 		if ( $ns and $ns != 'rdf' ) {
 			$this->current_namespace = $ns;
@@ -111,11 +111,11 @@
 			return;
 		}
 
-		if ( $el == 'channel' ) 
+		if ( $el == 'channel' )
 		{
 			$this->inchannel = true;
 		}
-		elseif ($el == 'item' or $el == 'entry' ) 
+		elseif ($el == 'item' or $el == 'entry' )
 		{
 			$this->initem = true;
 			if ( isset($attrs['rdf:about']) ) {
@@ -125,18 +125,18 @@
 
 		// if we're in the default namespace of an RSS feed,
 		//  record textinput or image fields
-		elseif ( 
-			$this->feed_type == RSS and 
-			$this->current_namespace == '' and 
-			$el == 'textinput' ) 
+		elseif (
+			$this->feed_type == RSS and
+			$this->current_namespace == '' and
+			$el == 'textinput' )
 		{
 			$this->intextinput = true;
 		}
 
 		elseif (
-			$this->feed_type == RSS and 
-			$this->current_namespace == '' and 
-			$el == 'image' ) 
+			$this->feed_type == RSS and
+			$this->current_namespace == '' and
+			$el == 'image' )
 		{
 			$this->inimage = true;
 		}
@@ -155,12 +155,12 @@
 		}
 
 		// if inside an Atom content construct (e.g. content or summary) field treat tags as text
-		elseif ($this->feed_type == ATOM and $this->incontent ) 
+		elseif ($this->feed_type == ATOM and $this->incontent )
 		{
 			// if tags are inlined, then flatten
-			$attrs_str = join(' ', 
-					array_map('map_attrs', 
-					array_keys($attrs), 
+			$attrs_str = join(' ',
+					array_map('map_attrs',
+					array_keys($attrs),
 					array_values($attrs) ) );
 
 			$this->append_content( "<$element $attrs_str>"  );
@@ -172,9 +172,9 @@
 		// Magpie treats link elements of type rel='alternate'
 		// as being equivalent to RSS's simple link element.
 		//
-		elseif ($this->feed_type == ATOM and $el == 'link' ) 
+		elseif ($this->feed_type == ATOM and $el == 'link' )
 		{
-			if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) 
+			if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
 			{
 				$link_el = 'link';
 			}
@@ -194,7 +194,7 @@
 
 	function feed_cdata ($p, $text) {
 
-		if ($this->feed_type == ATOM and $this->incontent) 
+		if ($this->feed_type == ATOM and $this->incontent)
 		{
 			$this->append_content( $text );
 		}
@@ -207,17 +207,17 @@
 	function feed_end_element ($p, $el) {
 		$el = strtolower($el);
 
-		if ( $el == 'item' or $el == 'entry' ) 
+		if ( $el == 'item' or $el == 'entry' )
 		{
 			$this->items[] = $this->current_item;
 			$this->current_item = array();
 			$this->initem = false;
 		}
-		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) 
+		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
 		{
 			$this->intextinput = false;
 		}
-		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) 
+		elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
 		{
 			$this->inimage = false;
 		}
@@ -225,14 +225,14 @@
 		{
 			$this->incontent = false;
 		}
-		elseif ($el == 'channel' or $el == 'feed' ) 
+		elseif ($el == 'channel' or $el == 'feed' )
 		{
 			$this->inchannel = false;
 		}
 		elseif ($this->feed_type == ATOM and $this->incontent  ) {
 			// balance tags properly
 			// note:  i don't think this is actually neccessary
-			if ( $this->stack[0] == $el ) 
+			if ( $this->stack[0] == $el )
 			{
 				$this->append_content("</$el>");
 			}
@@ -270,7 +270,7 @@
 		if (!$el) {
 			return;
 		}
-		if ( $this->current_namespace ) 
+		if ( $this->current_namespace )
 		{
 			if ( $this->initem ) {
 				$this->concat(
@@ -395,7 +395,7 @@
 			// error("Failed to fetch $url and cache is off");
 			return false;
 		}
-	} 
+	}
 	// else cache is ON
 	else {
 		// Flow
@@ -472,7 +472,7 @@
 				if ( $resp->error ) {
 					# compensate for Snoopy's annoying habbit to tacking
 					# on '\n'
-					$http_error = substr($resp->error, 0, -2); 
+					$http_error = substr($resp->error, 0, -2);
 					$errormsg .= "(HTTP Error: $http_error)";
 				}
 				else {
@@ -613,28 +613,28 @@
 	}
 }
 
-function is_info ($sc) { 
-	return $sc >= 100 && $sc < 200; 
+function is_info ($sc) {
+	return $sc >= 100 && $sc < 200;
 }
 
-function is_success ($sc) { 
-	return $sc >= 200 && $sc < 300; 
+function is_success ($sc) {
+	return $sc >= 200 && $sc < 300;
 }
 
-function is_redirect ($sc) { 
-	return $sc >= 300 && $sc < 400; 
+function is_redirect ($sc) {
+	return $sc >= 300 && $sc < 400;
 }
 
-function is_error ($sc) { 
-	return $sc >= 400 && $sc < 600; 
+function is_error ($sc) {
+	return $sc >= 400 && $sc < 600;
 }
 
-function is_client_error ($sc) { 
-	return $sc >= 400 && $sc < 500; 
+function is_client_error ($sc) {
+	return $sc >= 400 && $sc < 500;
 }
 
-function is_server_error ($sc) { 
-	return $sc >= 500 && $sc < 600; 
+function is_server_error ($sc) {
+	return $sc >= 500 && $sc < 600;
 }
 
 class RSSCache {
@@ -685,7 +685,7 @@
 		$cache_option = 'rss_' . $this->file_name( $url );
 
 		if ( ! get_option( $cache_option ) ) {
-			$this->debug( 
+			$this->debug(
 				"Cache doesn't contain: $url (cache option: $cache_option)"
 			);
 			return 0;
@@ -757,7 +757,7 @@
 \*=======================================================================*/
 	function error ($errormsg, $lvl=E_USER_WARNING) {
 		// append PHP's error message if track_errors enabled
-		if ( isset($php_errormsg) ) { 
+		if ( isset($php_errormsg) ) {
 			$errormsg .= " ($php_errormsg)";
 		}
 		$this->ERROR = $errormsg;
@@ -781,7 +781,7 @@
 	$pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
 
 	if ( preg_match( $pat, $date_str, $match ) ) {
-		list( $year, $month, $day, $hours, $minutes, $seconds) = 
+		list( $year, $month, $day, $hours, $minutes, $seconds) =
 			array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
 
 		# calc epoch for current date assuming GMT
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 3978)
+++ wp-includes/script-loader.php	(working copy)
@@ -69,8 +69,8 @@
 			}
 		}
 	}
-				
 
+
 	/**
 	 * Determines dependencies of scripts
 	 *
@@ -155,7 +155,7 @@
 		endswitch;
 		return false;
 	}
-			
+
 }
 
 class _WP_Script {
Index: wp-includes/streams.php
===================================================================
--- wp-includes/streams.php	(revision 3978)
+++ wp-includes/streams.php	(working copy)
@@ -1,22 +1,22 @@
 <?php
 /*
-   Copyright (c) 2003, 2005 Danilo Segan <danilo@kvota.net>.
+	 Copyright (c) 2003, 2005 Danilo Segan <danilo@kvota.net>.
 
-   This file is part of PHP-gettext.
+	 This file is part of PHP-gettext.
 
-   PHP-gettext is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
+	 PHP-gettext is free software; you can redistribute it and/or modify
+	 it under the terms of the GNU General Public License as published by
+	 the Free Software Foundation; either version 2 of the License, or
+	 (at your option) any later version.
 
-   PHP-gettext is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+	 PHP-gettext is distributed in the hope that it will be useful,
+	 but WITHOUT ANY WARRANTY; without even the implied warranty of
+	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	 GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with PHP-gettext; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+	 You should have received a copy of the GNU General Public License
+	 along with PHP-gettext; if not, write to the Free Software
+	 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 */
 
@@ -24,135 +24,135 @@
 // Simple class to wrap file streams, string streams, etc.
 // seek is essential, and it should be byte stream
 class StreamReader {
-  // should return a string [FIXME: perhaps return array of bytes?]
-  function read($bytes) {
-    return false;
-  }
-  
-  // should return new position
-  function seekto($position) {
-    return false;
-  }
-  
-  // returns current position
-  function currentpos() {
-    return false;
-  }
-  
-  // returns length of entire stream (limit for seekto()s)
-  function length() {
-    return false;
-  }
+	// should return a string [FIXME: perhaps return array of bytes?]
+	function read($bytes) {
+		return false;
+	}
+
+	// should return new position
+	function seekto($position) {
+		return false;
+	}
+
+	// returns current position
+	function currentpos() {
+		return false;
+	}
+
+	// returns length of entire stream (limit for seekto()s)
+	function length() {
+		return false;
+	}
 }
 
 class StringReader {
-  var $_pos;
-  var $_str;
+	var $_pos;
+	var $_str;
 
-  function StringReader($str='') {
-    $this->_str = $str;
-    $this->_pos = 0;
-  }
+	function StringReader($str='') {
+		$this->_str = $str;
+		$this->_pos = 0;
+	}
 
-  function read($bytes) {
-    $data = substr($this->_str, $this->_pos, $bytes);
-    $this->_pos += $bytes;
-    if (strlen($this->_str)<$this->_pos)
-      $this->_pos = strlen($this->_str);
+	function read($bytes) {
+		$data = substr($this->_str, $this->_pos, $bytes);
+		$this->_pos += $bytes;
+		if (strlen($this->_str)<$this->_pos)
+			$this->_pos = strlen($this->_str);
 
-    return $data;
-  }
+		return $data;
+	}
 
-  function seekto($pos) {
-    $this->_pos = $pos;
-    if (strlen($this->_str)<$this->_pos)
-      $this->_pos = strlen($this->_str);
-    return $this->_pos;
-  }
+	function seekto($pos) {
+		$this->_pos = $pos;
+		if (strlen($this->_str)<$this->_pos)
+			$this->_pos = strlen($this->_str);
+		return $this->_pos;
+	}
 
-  function currentpos() {
-    return $this->_pos;
-  }
+	function currentpos() {
+		return $this->_pos;
+	}
 
-  function length() {
-    return strlen($this->_str);
-  }
+	function length() {
+		return strlen($this->_str);
+	}
 
 }
 
 
 class FileReader {
-  var $_pos;
-  var $_fd;
-  var $_length;
+	var $_pos;
+	var $_fd;
+	var $_length;
 
-  function FileReader($filename) {
-    if (file_exists($filename)) {
+	function FileReader($filename) {
+		if (file_exists($filename)) {
 
-      $this->_length=filesize($filename);
-      $this->_pos = 0;
-      $this->_fd = fopen($filename,'rb');
-      if (!$this->_fd) {
+			$this->_length=filesize($filename);
+			$this->_pos = 0;
+			$this->_fd = fopen($filename,'rb');
+			if (!$this->_fd) {
 	$this->error = 3; // Cannot read file, probably permissions
 	return false;
-      }
-    } else {
-      $this->error = 2; // File doesn't exist
-      return false;
-    }
-  }
+			}
+		} else {
+			$this->error = 2; // File doesn't exist
+			return false;
+		}
+	}
 
-  function read($bytes) {
-    if ($bytes) {
-      fseek($this->_fd, $this->_pos);
-      $data = fread($this->_fd, $bytes);
-      $this->_pos = ftell($this->_fd);
-      
-      return $data;
-    } else return '';
-  }
+	function read($bytes) {
+		if ($bytes) {
+			fseek($this->_fd, $this->_pos);
+			$data = fread($this->_fd, $bytes);
+			$this->_pos = ftell($this->_fd);
 
-  function seekto($pos) {
-    fseek($this->_fd, $pos);
-    $this->_pos = ftell($this->_fd);
-    return $this->_pos;
-  }
+			return $data;
+		} else return '';
+	}
 
-  function currentpos() {
-    return $this->_pos;
-  }
+	function seekto($pos) {
+		fseek($this->_fd, $pos);
+		$this->_pos = ftell($this->_fd);
+		return $this->_pos;
+	}
 
-  function length() {
-    return $this->_length;
-  }
+	function currentpos() {
+		return $this->_pos;
+	}
 
-  function close() {
-    fclose($this->_fd);
-  }
+	function length() {
+		return $this->_length;
+	}
 
+	function close() {
+		fclose($this->_fd);
+	}
+
 }
 
-// Preloads entire file in memory first, then creates a StringReader 
+// Preloads entire file in memory first, then creates a StringReader
 // over it (it assumes knowledge of StringReader internals)
 class CachedFileReader extends StringReader {
-  function CachedFileReader($filename) {
-    if (file_exists($filename)) {
+	function CachedFileReader($filename) {
+		if (file_exists($filename)) {
 
-      $length=filesize($filename);
-      $fd = fopen($filename,'rb');
+			$length=filesize($filename);
+			$fd = fopen($filename,'rb');
 
-      if (!$fd) {
+			if (!$fd) {
 	$this->error = 3; // Cannot read file, probably permissions
 	return false;
-      }
-      $this->_str = fread($fd, $length);
-      fclose($fd);
+			}
+			$this->_str = fread($fd, $length);
+			fclose($fd);
 
-    } else {
-      $this->error = 2; // File doesn't exist
-      return false;
-    }
-  }
+		} else {
+			$this->error = 2; // File doesn't exist
+			return false;
+		}
+	}
 }
 
 
Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 3978)
+++ wp-includes/theme.php	(working copy)
@@ -1,6 +1,6 @@
 <?php
 /*
- * Theme/template/stylesheet functions.  
+ * Theme/template/stylesheet functions.
  */
 
 function get_stylesheet() {
Index: wp-includes/user.php
===================================================================
--- wp-includes/user.php	(revision 3978)
+++ wp-includes/user.php	(working copy)
@@ -150,7 +150,7 @@
 
 	if ( '' == $user_id )
 		$user = wp_get_current_user();
-	else 
+	else
 		$user = new WP_User($user_id);
 
 	if ( 0 == $user->ID )
Index: wp-includes/vars.php
===================================================================
--- wp-includes/vars.php	(revision 3978)
+++ wp-includes/vars.php	(working copy)
@@ -34,7 +34,7 @@
 $is_apache = ( strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') || strstr($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') ) ? 1 : 0;
 $is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0;
 
-// On OS X Server, $_SERVER['REMOTE_ADDR'] is the server's address. Workaround this 
+// On OS X Server, $_SERVER['REMOTE_ADDR'] is the server's address. Workaround this
 // by using $_SERVER['HTTP_PC_REMOTE_ADDR'], which *is* the remote address.
 if ( isset($_SERVER['HTTP_PC_REMOTE_ADDR']) )
 	$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_PC_REMOTE_ADDR'];
Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 3978)
+++ wp-includes/wp-db.php	(working copy)
@@ -90,7 +90,7 @@
 	function print_error($str = '') {
 		global $EZSQL_ERROR;
 		if (!$str) $str = mysql_error();
-		$EZSQL_ERROR[] = 
+		$EZSQL_ERROR[] =
 		array ('query' => $this->last_query, 'error_str' => $str);
 
 		// Is error output turned on or not..

