Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP 5.4 and mysql 5.5


Havock

Recommended Posts

Greeting fellow oscommerce users.

 

Like many I've used oscommerce for quite some times now (11 years). Through these years I've improved my old MS2.2 and made a lot of changes to the standard shop.

 

My site works on a PHP 5.2, mysql 5.0 server with ISO 8859-1 databases.

 

Now it's time to upgrade to PHP 5.4 and mysql 5.5 (as my hosting company gives me no choice). I've read some posts on the French forum and on this one (especially this thread). But I still have a few questions.

 

(Please do not reply by telling me to upgrade to V2.3.4. It would take far more time for me to add all the features I've added to my site to a standard V2.3.4 than to adapt my old MS 2.2 to PHP 5.4 and mysql 5.5).

 

In theory I should replace HTTP_*_VARS with super globals (eg, HTTP_GET_VARS to _GET), but by doing so I have the following code in the header.php file :

<?php echo htmlspecialchars(stripslashes(urldecode($_GET['error_message']))); ?>

That's also the same code we can see on GitHub : https://github.com/osCommerce/oscommerce2/blob/master/catalog/includes/header.php

 

But on php.net there is a warning :

 

 

Warning

The superglobals $_GET and $_REQUEST are already decoded. Using urldecode() on an element in $_GET or $_REQUEST could have unexpected and dangerous results.

 

 

If I've understood correctly, the compatibility.php files allows us to still use $HTTP_*_VARS, so that may explain why on the header.php of the V2.3.4 version we have :

<?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?>

What version is the correct one ? I would say the one with HTTP_GET_VARS, but would that mean that the code on GitHub is wrong ?

 

 

About mysql 5.5 : Is there something special I should do to import a mysql 5.0 ISO 8859-1 database ?

 

I know I have to replace msql function calls with mysqli functions. On the oscommerce library there is some code example to "Replace mysql function calls with mysqli functions. Add a mysqli compatibility layer for earlier PHP versions without native support for mysqli.". I'll have a look at it and use it as a base to make my changes (without the changes related to the action_recorder module). Have I missed something ? Has someone already upgraded an old version to mysql 5.5 ?

 

Many thanks for your help

 

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...