Make WordPress Core


Ignore:
Timestamp:
11/05/2011 06:32:47 PM (14 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php

    r17625 r19178  
    3939
    4040            // Skip this line.
    41             if (strpos($dstr, "@") === 0)
     41            if ($dstr[0] == "@")
    4242                continue;
    4343
    44             preg_match("/\& ([^ ]+) .*/i", $dstr, $matches);
     44            preg_match("/(\&|#) ([^ ]+) .*/i", $dstr, $matches);
    4545
    46             if (!empty($matches[1]))
    47                 $returnData[] = utf8_encode(trim($matches[1]));
     46            if (!empty($matches[2]))
     47                $returnData[] = utf8_encode(trim($matches[2]));
    4848        }
    4949
     
    8383
    8484            // Skip this line.
    85             if (strpos($dstr, "@") === 0)
     85            if ($dstr[0] == "@")
    8686                continue;
    8787
     
    104104        $this->_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell");
    105105
    106         if(preg_match("#win#i", php_uname()))
    107             return $this->_config['PSpellShell.aspell'] . " -a --lang=". escapeshellarg($lang) . " --encoding=utf-8 -H < " . $this->_tmpfile . " 2>&1";
     106        $file = $this->_tmpfile;
     107        $lang = preg_replace("/[^-_a-z]/", "", strtolower($lang));
     108        $bin  = $this->_config['PSpellShell.aspell'];
    108109
    109         return "cat ". $this->_tmpfile ." | " . $this->_config['PSpellShell.aspell'] . " -a --encoding=utf-8 -H --lang=". escapeshellarg($lang);
     110        if (preg_match("#win#i", php_uname()))
     111            return "$bin -a --lang=$lang --encoding=utf-8 -H < $file 2>&1";
     112
     113        return "cat $file | $bin -a --lang=$lang --encoding=utf-8 -H";
    110114    }
    111115}
Note: See TracChangeset for help on using the changeset viewer.