Menu ▾ ▴

#2869 sqspell_ereg error in php 7.2

Can't Reproduce
open
nobody
None
5
3 days ago
2024-01-05
No

Hi, I'm having trouble using squirrelspell. With a correctly spelled email, I get the "no errors found page". When I type "donde esta la biblioteca" I get a 500 error. This is the error in my php error log:
```
[05-Jan-2024 10:36:37 America/Chicago] PHP Fatal error: Uncaught Error: Call to undefined function ereg() in /usr/share/squirrelmail/plugins/squirrelspell/modules/check_me.mod:214
Stack trace:

0 /usr/share/squirrelmail/plugins/squirrelspell/sqspell_interface.php(58): require_once()

1 {main}

thrown in /usr/share/squirrelmail/plugins/squirrelspell/modules/check_me.mod on line 214
```

I am using PHP 7.2.34 and SquirrelMail 1.4.23 [SVN]-1.el7.20190710

Discussion

  • Barry Nelson

    Barry Nelson - 2024-07-03

    I am using PHP 8.2.1 and I am getting the same error 500

     
  • Dave  Wreski

    Dave Wreski - 3 days ago

    We found the same obsolete ereg() dictionary-lookup calls in our SquirrelMail 1.4.23-svn installation while investigating SquirrelSpell failures on Fedora 44 with PHP 8.5.12.

    Our observed production failure was initially:

    Call to undefined function fgetss() in plugins/squirrelspell/modules/check_me.mod

    Reviewing that code also identified the two ereg() lookup calls associated with this report and an ereg_replace() call in the personal-dictionary save path.

    We have deployed a local patch that:

    • Replaces fgetss() with stream reading and tag stripping across the complete output.
    • Replaces both dictionary lookups with literal, newline-delimited word matching.
    • Replaces ereg_replace() with str_replace() for the literal dictionary separator.
    • Initializes the spellcheck input array and handles messages beginning with the signature separator.

    The literal dictionary lookup also avoids interpreting punctuation in dictionary words as regular-expression syntax.

    PHP syntax checks and isolated regression tests passed on PHP 8.5.12. The changes are installed, but we are still completing browser-level verification of Spell Check and Add to dictionary.

    Dave Wreski
    Guardian Digital

     

Log in to post a comment.