Guest Posted October 3, 2011 Share Posted October 3, 2011 I am running OSC 2.3.1, Centos 6.0 & PHP 5.3.8 The installer comes up, but when i input the database settings and press continue, the log fills with this and the installer never finished initializing the database: PHP Deprecated: Function eregi() is deprecated in /home/oscommerce/install/includes/functions/database.php on line 98 line 98 says: if ( (eregi('create', $next)) || (eregi('insert', $next)) || (eregi('drop t', $next)) ) { Link to comment Share on other sites More sharing options...
♥toyicebear Posted October 4, 2011 Share Posted October 4, 2011 Click me>> Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here] Link to comment Share on other sites More sharing options...
Guest Posted October 4, 2011 Share Posted October 4, 2011 I thought v2.3.1 was PHP 5.3 compatible ? How can the installer contain deprecated ereg functions ? Maybe 2.4 will be better ? lol Chris Link to comment Share on other sites More sharing options...
MrPhil Posted October 4, 2011 Share Posted October 4, 2011 compatibility.php: find return ereg('^[0-9]{1,50}.?[0-9]{0,50}$', $param); and change to return preg_match('/^[0-9]{1,50}.?[0-9]{0,50}$/', $param); database.php: find if ( (eregi('create', $next)) || (eregi('insert', $next)) || (eregi('drop t', $next)) ) { and change to if ( (preg_match('/create/i', $next)) || (preg_match('/insert/i', $next)) || (preg_match('/drop t/i', $next)) ) { If there are more to fix, this has been discussed many times already. Actually, I'm kind of surprised... I thought osC 2.3 had been thoroughly cleaned up to make it PHP 5.3 compatible. I guess they missed something. Link to comment Share on other sites More sharing options...
softwarepro Posted October 4, 2011 Share Posted October 4, 2011 Apparently ereg() and eregi() are not the only functions deprecated. A client told me her site was displaying multiple errors. I checked to see what version of PHP she was using and it was 5.3.6. The deprecated functions on her site were: session_is_registered() split() ereg() eregi() and those were just the ones shown. I then checked several other clients websites and they all had similar errors though not all the same because most of the sites have been modified. Because of that, finding and fixing these errors will be more time consuming. I was very surprised to not see many people complaining about it yet here and also very surprised that there were no add-ons to fix the errors and no warnings from osCommerce posted. I was also surprised that the hosting company did not notify me they were going to upgrade all of the hosting accounts with the new version of PHP so I could see the many deprecated functions and changes and fix the osCommerce customers sites before the updates went into effect. I would like to see osCommerce replace standard PHP and MySQL functions in their files with osCommerce "proxy" functions which are basically wrappers for the standard functions which would all be contained in a single include file. That way when PHP or MySQL deprecate something only the function in include file needs to be changed instead of hunting through numerous files to change multiple copies of the same functions. Just a thought. Link to comment Share on other sites More sharing options...
Taipo Posted October 4, 2011 Share Posted October 4, 2011 Most production servers have notices disabled so most users will not see the errors. - Stop Oscommerce hacks dead in their tracks with osC_Sec (see discussion here)- Another discussion about infected files ::here::- A discussion on file permissions ::here::- Site hacked? Should you upgrade or not, some thoughts ::here::- Fix the admin login bypass exploit here- Pareto Security: New security addon I am developing, a remake of osC_Sec in PHP 5 with a number of fixes- BTC:1LHiMXedmtyq4wcYLedk9i9gkk8A8Hk7qX Link to comment Share on other sites More sharing options...
MrPhil Posted October 4, 2011 Share Posted October 4, 2011 I would like to see osCommerce replace standard PHP and MySQL functions in their files with osCommerce "proxy" functions which are basically wrappers for the standard functions which would all be contained in a single include file. That way when PHP or MySQL deprecate something only the function in include file needs to be changed instead of hunting through numerous files to change multiple copies of the same functions. Just a thought. The problem here is that PHP deliberately introduced incompatibilities in their language definition. I suppose it would be possible to put replacement functions into the compatibility.php layer, but 1) that would slow down osC quite a bit, and 2) it's not a simple matter. For example, for "eregi" you can't simply slap / and /i around the first argument (to preg_match) -- you need to check if / is used in the pattern, and either escape those uses, or choose another delimiter. In the long run, it's probably better to go through the code and properly fix it once and for all, than to keep jury-rigging patches like a compatibility layer (ditto for "long" array names, etc.). This would make osC incompatible with very old levels of PHP, but it's unreasonable to drag everyone else down supporting PHP 3.x or whatever. Link to comment Share on other sites More sharing options...
Mark Evans Posted October 4, 2011 Share Posted October 4, 2011 See https://github.com/osCommerce/oscommerce2/commit/df9bf6a36f1e0569d88643f84e4b11ce6d71a1b3 Will be fixed in 2.3.2 and of course 2.4 Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds) Link to comment Share on other sites More sharing options...
Mark Evans Posted October 4, 2011 Share Posted October 4, 2011 I would like to see osCommerce replace standard PHP and MySQL functions in their files with osCommerce "proxy" functions which are basically wrappers for the standard functions which would all be contained in a single include file. That way when PHP or MySQL deprecate something only the function in include file needs to be changed instead of hunting through numerous files to change multiple copies of the same functions. Just a thought. I would very much doubt we would do that as it would make maintenance a nightmare. Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds) Link to comment Share on other sites More sharing options...
Guest Posted October 4, 2011 Share Posted October 4, 2011 ok, thanks for the fix :D Link to comment Share on other sites More sharing options...
alexandra66 Posted November 10, 2011 Share Posted November 10, 2011 hi. does anyone know how to fix these two function, I have tried everything I could and nothing seem to work.. This is a pop up contact form with email validation and 1) Deprecated: Function split() in red function ValidateFileUploads() { $ret=true; foreach($this->fileupload_fields as $upld_field) { $field_name = $upld_field["name"]; $valid_filetypes = $upld_field["file_types"]; if(!$this->IsFileUploaded($field_name)) { continue; } and 2nd, Deprecated: Function eregi(): function validate_email($email) { return eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email); Is there anyway to fix it? Link to comment Share on other sites More sharing options...
MrPhil Posted November 11, 2011 Share Posted November 11, 2011 Where's the split call? Anyway, it should be changed to preg_split, and the first argument should get delimiters on it. E.g,. $var = split('pattern', $string) becomes $var = preg_split('/pattern/', $string) Note that if pattern is a variable rather than a string, you need to do: "/$pattern/". Also note that if the pattern has slashes in it (/), you need to either escape them: \/, or use a different delimiter (e.g., '#pattern#'). return eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email); becomes return preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.