Update the spellchecker plugin for TinyMCE to 2.0.6, fixes #19105

git-svn-id: https://develop.svn.wordpress.org/trunk@19178 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2011-11-05 18:32:47 +00:00
parent cb40252565
commit d58037ff4a
6 changed files with 25 additions and 12 deletions

View File

@@ -38,13 +38,13 @@ class PSpellShell extends SpellChecker {
$matches = array();
// Skip this line.
if (strpos($dstr, "@") === 0)
if ($dstr[0] == "@")
continue;
preg_match("/\& ([^ ]+) .*/i", $dstr, $matches);
preg_match("/(\&|#) ([^ ]+) .*/i", $dstr, $matches);
if (!empty($matches[1]))
$returnData[] = utf8_encode(trim($matches[1]));
if (!empty($matches[2]))
$returnData[] = utf8_encode(trim($matches[2]));
}
return $returnData;
@@ -82,7 +82,7 @@ class PSpellShell extends SpellChecker {
$matches = array();
// Skip this line.
if (strpos($dstr, "@") === 0)
if ($dstr[0] == "@")
continue;
preg_match("/\&[^:]+:(.*)/i", $dstr, $matches);
@@ -103,10 +103,14 @@ class PSpellShell extends SpellChecker {
function _getCMD($lang) {
$this->_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell");
if(preg_match("#win#i", php_uname()))
return $this->_config['PSpellShell.aspell'] . " -a --lang=". escapeshellarg($lang) . " --encoding=utf-8 -H < " . $this->_tmpfile . " 2>&1";
$file = $this->_tmpfile;
$lang = preg_replace("/[^-_a-z]/", "", strtolower($lang));
$bin = $this->_config['PSpellShell.aspell'];
return "cat ". $this->_tmpfile ." | " . $this->_config['PSpellShell.aspell'] . " -a --encoding=utf-8 -H --lang=". escapeshellarg($lang);
if (preg_match("#win#i", php_uname()))
return "$bin -a --lang=$lang --encoding=utf-8 -H < $file 2>&1";
return "cat $file | $bin -a --lang=$lang --encoding=utf-8 -H";
}
}