Bring tinyspell.php into sync. Props Nazgul. fixes #4368

git-svn-id: http://svn.automattic.com/wordpress/trunk@5614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-05-31 12:22:06 +00:00
parent e836ded63b
commit 01af55cbf7
1 changed files with 30 additions and 8 deletions

View File

@ -33,14 +33,14 @@
// Get input parameters.
$check = urldecode($_REQUEST['check']);
$cmd = sanitize($_REQUEST['cmd']);
$lang = sanitize($_REQUEST['lang'], "strict");
$mode = sanitize($_REQUEST['mode'], "strict");
$spelling = sanitize($_REQUEST['spelling'], "strict");
$jargon = sanitize($_REQUEST['jargon'], "strict");
$encoding = sanitize($_REQUEST['encoding'], "strict");
$sg = sanitize($_REQUEST['sg'], "bool");
$check = urldecode(getRequestParam('check'));
$cmd = sanitize(getRequestParam('cmd'));
$lang = sanitize(getRequestParam('lang'), "strict");
$mode = sanitize(getRequestParam('mode'), "strict");
$spelling = sanitize(getRequestParam('spelling'), "strict");
$jargon = sanitize(getRequestParam('jargon'), "strict");
$encoding = sanitize(getRequestParam('encoding'), "strict");
$sg = sanitize(getRequestParam('sg'), "bool");
$words = array();
$validRequest = true;
@ -83,6 +83,28 @@
return $str;
}
function getRequestParam($name, $default_value = false) {
if (!isset($_REQUEST[$name]))
return $default_value;
if (!isset($_GLOBALS['magic_quotes_gpc']))
$_GLOBALS['magic_quotes_gpc'] = ini_get("magic_quotes_gpc");
if (isset($_GLOBALS['magic_quotes_gpc'])) {
if (is_array($_REQUEST[$name])) {
$newarray = array();
foreach($_REQUEST[$name] as $name => $value)
$newarray[stripslashes($name)] = stripslashes($value);
return $newarray;
}
return stripslashes($_REQUEST[$name]);
}
return $_REQUEST[$name];
}
$result = array();
$tinyspell = new $spellCheckerConfig['class']($spellCheckerConfig, $lang, $mode, $spelling, $jargon, $encoding);