﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
862	SpellerPages for PHP while Safe Mode is On (solution within)	reubenhelms@…		"I've been using the FCKEditor for Joomla plugin, that
mostly uses the PHP side of things.

Because of the usage of shell_exec, it is not possible
to use aspell is Safe Mode is on.

However, I've made a few changes to
print_checker_results() in
editor/dialog/fck_spellerpages/server-scripts/spellchecker.php
that should provide aspell functionality while Safe
Mode is on.

The there are two security settings that will be
required, however.

First, you must allow the operation of proc_open.
Secondly, you must have aspell located or linked into
your safe_mode_exec_dir.

Things to note about these changes:

I'm not primarily a PHP coder, but I've dabbled. There
are probably better ways to do what I've done, but
these get the job done.

I did have a version that streamed the $tempfile
straight out to the read pipe, but decided to read from
the file instead, for simplicity.

Also decided to keep the error file if things didnt go
so well.

Anyway, I hope these changes get added to the next
release. If there is a more formal way I should be
submitting this, like a patch, please let me know.

Here are the changes:
{{{
// from when the tempfile is generated
fclose($fh);

$othertemp = tempnam($tempfiledir, 'aspell_error_');^M
$descarray = array (
0 => array(""file"", $tempfile, ""r""),
1 => array(""pipe"", ""w""),
2 => array(""file"", $othertemp, ""a""));

$process = proc_open($aspell_prog . "" "" . $aspell_opts,
$descarray, $pipes);

if (is_resource($process)) {
$aspellret = '';
while (!feof($pipes[1])) {
$aspellret .= fread($pipes[1], 8192);
}
fclose($pipes[1]);
$rc = proc_close($process);
}

// previous read if( $aspellret = shell_exec( $cmd )) {
if( $rc == 0) {^M
unlink($othertemp); // remove error file if no error
$linesout = explode( ""\n"", $aspellret );^M
// continue process the output as normal
}}}
----
Moved from SF:[[BR]]
http://sourceforge.net/tracker/index.php?func=detail&aid=1417319&group_id=75348&atid=543656"	New Feature	closed	Normal		Server : PHP		wontfix	SF HasPatch	reubenhelms@…
