- Timestamp:
- 11/05/2011 06:32:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php
r17625 r19178 39 39 40 40 // Skip this line. 41 if ( strpos($dstr, "@") === 0)41 if ($dstr[0] == "@") 42 42 continue; 43 43 44 preg_match("/ \&([^ ]+) .*/i", $dstr, $matches);44 preg_match("/(\&|#) ([^ ]+) .*/i", $dstr, $matches); 45 45 46 if (!empty($matches[ 1]))47 $returnData[] = utf8_encode(trim($matches[ 1]));46 if (!empty($matches[2])) 47 $returnData[] = utf8_encode(trim($matches[2])); 48 48 } 49 49 … … 83 83 84 84 // Skip this line. 85 if ( strpos($dstr, "@") === 0)85 if ($dstr[0] == "@") 86 86 continue; 87 87 … … 104 104 $this->_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell"); 105 105 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']; 108 109 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"; 110 114 } 111 115 }
Note: See TracChangeset
for help on using the changeset viewer.