$ln".
'';
}
// Declaring globals for E_ALL.
global $sqspell_text, $SQSPELL_APP, $sqspell_use_app, $attachment_dir,
$username, $SQSPELL_EREG, $color;
// Now we explode the lines for three reasons:
// 1) So we can ignore lines starting with ">" (reply's)
// 2) So we can stop processing when we get to "--" on a single line,
// which means that the signature is starting
// 3) So we can add an extra space at the beginning of each line. This way
// ispell/aspell don't treat these as command characters.
$sqspell_raw_lines = explode("\n", $sqspell_text);
for ($i=0; $i')
$sqspell_new_lines[$i] = ' ' . $sqspell_raw_lines[$i];
else $sqspell_new_lines[$i] = '';
}
$sqspell_new_text=implode("\n", $sqspell_new_lines);
// Define the command used to spellcheck the document.
$sqspell_command=$SQSPELL_APP[$sqspell_use_app];
// For the simplicity's sake we'll put all text into a file
// in attachment_dir directory, then cat it and pipe it to sqspell_command.
// There are other ways to do it, including popen(), but it's unidirectional
// and no fun at all.
// NOTE: This will probably change in future releases of squirrelspell
// for privacy reasons.
//
$floc = "$attachment_dir/$username_sqspell_data.txt";
$fp=fopen($floc, 'w');
fwrite($fp, $sqspell_new_text);
fclose($fp);
exec("cat $floc | $sqspell_command", $sqspell_output);
unlink($floc);
// Load the user dictionary.
$words=sqspell_getLang(sqspell_getWords(), $sqspell_use_app);
// define some variables.
$current_line=0;
$missed_words=Array();
$misses = Array();
$locations = Array();
$errors=0;
// Now we process the output of sqspell_command (ispell or aspell
// in ispell compatibility mode, whichever).
for ($i=0; $i\n".
"\n".
'' . _("SquirrelSpell Results") . '';
if ($theme_css != '') {
echo "\n";
}
// Load the spelling errors into JavaScript arrays
echo "\n".
"\n".
"\n";
echo "\n".
'