Index: wp-includes/js/tinymce/plugins/spellchecker/classes/WP_GoogleSpell.php
===================================================================
--- wp-includes/js/tinymce/plugins/spellchecker/classes/WP_GoogleSpell.php	(revision 0)
+++ wp-includes/js/tinymce/plugins/spellchecker/classes/WP_GoogleSpell.php	(revision 0)
@@ -0,0 +1,146 @@
+<?php
+/**
+ * Extension of TinyMCE GoogleSpell class for Wordpress
+ * 
+ * WP_GoogleSpell extends TinyMCE's GoogleSpell class. It overrides the way in which the 
+ * http request to google is executed and uses WP_Http instead of curl/fsockopen.
+ *
+ * In order to use this class the "general.engine" value in config.php
+ * (wp-includes/js/tinymce/plugins/spellchecker) needs to be set to "WP_GoogleSpell"
+ * instead of "GoogleSpell".
+ *
+ * @link http://trac.wordpress.org/ticket/9798 Request for proxy support for spellchecking
+ *
+ * @package WordPress
+ * @subpackage TinyMCE
+ * @since 2.8.0
+ * @author Benedikt Forchhammer <b.forchhammer@mind2.de>
+ */
+
+// Wordpress functions and classes
+require_once(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))) . '/wp-load.php');
+
+// The SpellChecking Engine which we want to extend
+require_once(dirname(__FILE__) . '/GoogleSpell.php');
+
+class WP_GoogleSpell extends GoogleSpell {
+
+	function &_getMatches($lang, $str) {
+		if (class_exists('WP_Http')) {
+			$http = new WP_Http();
+			
+			// request url
+			$host = "www.google.com:443";
+			$path = "/tbproxy/spell?lang=" . $lang . "&hl=en";
+			$url = "https://" . $host . $path;
+						
+			// Setup XML request
+			$xml = '<?xml version="1.0" encoding="utf-8" ?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><text>' . $str . '</text></spellrequest>';
+			
+			// set up request arguments.
+			// [bforchhammer] sslverify disabled because it did not work on our server / should possibly be enabled by default?
+			$args = array( 'body' => $xml, 'sslverify' => false );
+
+			$response = $http->post($url, $args);
+			
+			if (is_wp_error($response)) {
+				echo implode("\n", $response->get_error_messages());
+				return array();
+			}
+			else {
+				// Grab and parse content
+				$matches = array();
+				preg_match_all('/<c o="([^"]*)" l="([^"]*)" s="([^"]*)">([^<]*)<\/c>/', $response['body'], $matches, PREG_SET_ORDER);
+			
+				return $matches;
+			}
+		}
+		else {
+			$this->throwError('WP_Http class has not been loaded');
+		}
+	}
+	
+	/**
+	 * Checks if a word is on the exception list of "correctly spelled words".
+	 *
+	 * @param {String} $word The word to check
+	 * @param {Bool} false if the word is on the exception list.
+	 */
+	function isNoWPException($word) {
+		return !in_array($word, $this->getWPExceptionList());
+	}
+	
+	/**
+	 * Returns suggestions of for a specific word using the list of 
+	 * Wordpress Spelling Exceptions
+	 *
+	 * @param {String} $lang Language code like sv or en.
+	 * @param {String} $word Specific word to get suggestions for.
+	 * @return {Array} Array of suggestions for the specified word.
+	 */
+	function getWPSuggestions($lang, $word) {	
+		$exceptions = $this->getWPExceptionList();
+		
+		$suggestions = array();
+		foreach ($exceptions as $suggestion) {
+			$p = 0;
+			similar_text($word, good, $p);
+			if ($p > .8) $suggestions[] = $suggestion;
+		}		
+		return $suggestions;
+	}
+	
+	/**
+	 * Get List of Wordpress Spelling Exceptions
+	 *
+	 * Use filter 'mce_spellcheck_exceptions' to add custom exceptions to this list.
+	 *
+	 * @return {Array} List of Spelling Exceptions
+	 */
+	function getWPExceptionList() {
+		$defaults = array('WordPress');
+		return apply_filters('mce_spellcheck_exceptions', $defaults);
+	}
+	
+	/**
+	 * Spellchecks an array of words.
+	 *
+	 * Ignores words that are on the list of Wordpress Spelling Exceptions.
+	 *
+	 * @param {String} $lang Language code like sv or en.
+	 * @param {Array} $words Array of words to spellcheck.
+	 * @return {Array} Array of misspelled words.
+	 */
+	function &checkWords($lang, $words) {
+		$words = array_filter($words, array($this, 'isNoWPException'));
+		return parent::checkWords($lang, $words);
+	}
+
+	/**
+	 * Returns suggestions of for a specific word.
+	 *
+	 * Merges Wordpress Spelling Exceptions (filter 'mce_spellcheck_exceptions')
+	 * with google's list of suggestions.
+	 *
+	 * @param {String} $lang Language code like sv or en.
+	 * @param {String} $word Specific word to get suggestions for.
+	 * @return {Array} Array of suggestions for the specified word.
+	 */
+	function &getSuggestions($lang, $word) {
+		$wp_suggestions = $this->getWPSuggestions($lang, $word);
+		$google_suggestions = parent::getSuggestions($lang, $word);
+		return array_merge($wp_suggestions, $google_suggestions);
+	}
+	
+	/**
+	 * Use wordpress function unhtmlentities()
+	 *
+	 * @see http://core.trac.wordpress.org/ticket/8689
+	 * @see http://core.trac.wordpress.org/ticket/9805
+	 */
+	function _unhtmlentities($string) {
+		if (function_exists('unhtmlentities')) return unhtmlentities($string);
+		else return parent::_unhtmlentities($string);
+	}
+}
+?>
\ No newline at end of file
Index: wp-includes/js/tinymce/plugins/spellchecker/config.php
===================================================================
--- wp-includes/js/tinymce/plugins/spellchecker/config.php	(revision 11315)
+++ wp-includes/js/tinymce/plugins/spellchecker/config.php	(working copy)
@@ -6,7 +6,8 @@
  * @copyright Copyright © 2007, Moxiecode Systems AB, All rights reserved.
  */
 	// General settings
-	$config['general.engine'] = 'GoogleSpell';
+	//$config['general.engine'] = 'GoogleSpell';
+	$config['general.engine'] = 'WP_GoogleSpell';
 	//$config['general.engine'] = 'PSpell';
 	//$config['general.engine'] = 'PSpellShell';
 	//$config['general.remote_rpc_url'] = 'http://some.other.site/some/url/rpc.php';
