[imp] Re: IMP ISPELL problem with php4.1.2
Christopher Crowley
ccrowley@tulane.edu
Thu, 28 Mar 2002 15:55:00 -0600
I did the other test.
I rebuilt apache using php-4.0.6 (with the upload patch applied, of course)
and the spell checker works correctly now.
Chris
----- Original Message -----
From: "Jacob Rush" <jacobr@mcluckieco.com>
To: <imp@lists.horde.org>
Cc: "Christopher Crowley" <ccrowley@tulane.edu>
Sent: Thursday, March 28, 2002 2:49 PM
Subject: Re: [imp] Re: IMP ISPELL problem with php4.1.2
> Ok I made this work somewhat. Attached is a diff for the spelling
> problem. Its not as elegant as I would like. I had a problem getting
> strtok to reset where it is in a string and wound up using a bunch of
> explode()s. Im still running 2.2.4 so this might not patch directly to
> newer versions. Good luck.
>
> -Jacob
>
----------------------------------------------------------------------------
----
> --- spelling.old Thu Mar 28 09:13:57 2002
> +++ spelling.php3 Thu Mar 28 14:31:20 2002
> @@ -44,8 +44,16 @@
> }
>
> function member ($string, $array) {
> + $nopStr = explode(".", $string);
> + $nopStr = explode(",", $nopStr[0]);
> + $nopStr = explode(":", $nopStr[0]);
> + $nopStr = explode(";", $nopStr[0]);
> + $nopStr = explode("'", $nopStr[0]);
> + $nopStr = explode("\"", $nopStr[0]);
> + $nopStr = explode("!", $nopStr[0]);
> + $nopStr = explode("?", $nopStr[0]);
> while (list($key, $val) = each($array)) {
> - if ($val == $string)
> + if ($val == $nopStr[0])
> return true;
> }
> return false;
> @@ -102,10 +110,9 @@
> }
>
> $message = htmlspecialchars($message);
> -
> if (isset($errors)) {
> $msg = '';
> - while (estrtok($tok, $delim, $message, " ,.:;'\"&%!?()[]{}/|\n\\")) {
> + while (estrtok($tok, $delim, $message, " ")) {
> if (member($tok, $errors))
> $msg .= "<font color=\"ff0000\">$tok</font>$delim";
> else
>