Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Function eregi() is deprecated
I get this error when freshly installed Vanilla on my server and signing up as a new user.
Deprecated: Function eregi() is deprecated in C:\wamp\www\xfm\library\Framework\Framework.Class.Validator.php on line 93
Anyway to fix it?
Deprecated: Function eregi() is deprecated in C:\wamp\www\xfm\library\Framework\Framework.Class.Validator.php on line 93
Anyway to fix it?
0
Comments
preg_match('/pattern/i', $subject);
The 'i' after the pattern makes it case-insenitive. All the POSIX functions are deprecated in favor of their Perl-compatible cousins.
Note that you probably can't copy/paste your pattern from the eregi function; it'll probably have to be re-written in Perl syntax (linked).
Also, we should turn off warning message on production and probably the display of any error message. On production they should only appear in the log.
For anyone who needs a quick fix:
Just replace on line 93 of root\library\Framework\Framework.Class.Validator.php
if(!eregi($this->ValidationExpression, $this->Value)) {
with:
if(!preg_match("/{$this->ValidationExpression}/i", $this->Value)) {
Thanks @ Lincoln I didn't know about the 'i'.