Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

PHP 5.3/6 Comparability Problems


Print Track
Hi everyone,

I can see that more and more people are using PHP 5.3 causing more and more problems with PHP-Fusion as we today do not support PHP 5.3 nor PHP 6 as we still use functions which has been DEPRECATED or REMOVED. We are working fixing this and the latest SVN build of PHP-Fusion v7.00 corrects most of these errors. Still some testing left and some smaller bugs with PHP 5.3 and we might be ready to release PHP-Fusion v7.00.06 with PHP 5.3 and PHP 6 comparability.


eregi()
The eregi() function has been replaced with preg_match(). I think we have found most of them but we still need testing that it has been done completely and correctly.

Quote

Do not upgrade by replacing the eregi() functions your self! You should get the new files from the latest SVN of PHP-Fusion v7.00 which has the corrected files for PHP 5.3 and PHP 6


split()
Recently discovered that the version of PHPMailer we use isn't supported by PHP 5.3 or PHP 6 and we have come up with a simple fix for it:

Open this file: /includes/class.phpmailer.php

Find line 458:
CodeDownload  
$toArr = split(',', $to);



Replace with:
CodeDownload  
$toArr = explode(',', $to);



Find line 1548:
CodeDownload  
$fileParts = split("\.", $filename);



Replace with:
CodeDownload  
$fileParts = explode(".", $filename);



Save the file and upload it to your server by replacing the old one.


More problems?
Please use this thread reporting more errors and bugs with PHPFusion v7 and PHP 5.3 or PHP 6.

7 replies

I've replaced all functions eregi () to preg_match () in maincore.php and I also have mereplace split () into explorer () in line 458 and 1548 , but still there was an error on my website.

the problem is:
1.website I can not redirect to /. News.php
2. can not login as a user or admin


nb : my site http://fl2mi.or.id
Is it possible to make your own eregi function instead ?
(e.g.
if (!function_exists("ereg"){
function ereg($check, $value, $case = false){
return preg_match("/".$check."/".($case == false ? "i" : ""), $value);
}
function eregi($check, $value){
return ereg($check, $value, true);
}
}

) ?
@Jeepers1993: yes, but that will be X2 times slower than calling preg_match directly, I think there is no problem which just deprecating POSIX, on PHP.net info about POSIX deprecation was posted more than year ago, that's more than enough to find out about deprecation.

Quote

bite wrote:
@ardli: You can't just replace all eregi() with preg_patch(), read this thread for information on how to upgrade from POSIX(functions like eregi) to PCRE(functions like preg_patch) Functions.


Do not upgrade by replacing the eregi() functions your self! You should get the new files from the latest SVN of PHP-Fusion v7.00 which has the corrected files for PHP 5.3 and PHP 6


Quote

bite wrote:
@ardli: You can't just replace all eregi() with preg_patch(), read this thread for information on how to upgrade from POSIX(functions like eregi) to PCRE(functions like preg_patch) Functions.


Correct! Corrected files has been submitted to the latest build in the SVN.


Quote

Jeepers1993 wrote:
Is it possible to make your own eregi function instead ?
(e.g.
if (!function_exists("ereg"){
function ereg($check, $value, $case = false){
return preg_match("/".$check."/".($case == false ? "i" : ""), $value);
}
function eregi($check, $value){
return ereg($check, $value, true);
}
}

) ?


Good suggestion but it will be very slow, and we want our system to be as fast as possible which means replacing ergi() with preg_match() :)


Quote

bite wrote:
@Jeepers1993: yes, but that will be X2 times slower than calling preg_match directly, I think there is no problem which just deprecating POSIX, on PHP.net info about POSIX deprecation was posted more than year ago, that's more than enough to find out about deprecation.


Yes, we have been to slow with this and we apologize for it. Thats why we need all the help we can get testing PHP-Fusion on hosts with PHP 5.3 installed!
Yes that was only a temp solution for ppl already running on a newer php version smile. Oh and i see i forgot a "wink" after the function_exists :p
The current SVN appears to be quite bugless (or at least where public viewers are concerned).
Have had an issue where suspended users are told that there username and password are invalid, instead of being told "your account has been suspended for said reason".

I just assume it shouldn't tell a user that there username and password are invalid if there account is suspended.
Other than that, haven't found anymore bugs.. yet ;p
author starefossen
forumSuspected Bugs and Errors - 8
replies8 posts
viewed9,359 times
activeLast updated on 10 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: starefossen, Jeepers1993, malcster505, bite, ardli