Deprecated Errors

Ask all your questions about the script here.

Deprecated Errors

Postby Josh on Sat Feb 20, 2010 10:27 am

Quadodo was originally written to support the 4.x branch of PHP, years ago. :P

Well, today web hosts and servers like WAMP are by default installing version 5.3 of PHP. Unfortunately, a newer version of Quadodo hasn't been released in the past year to comply with the changes. Therefore, two solutions exist to fix the errors.

The first solution is the easiest: downgrade your PHP version. If possible, you would just have to ask your web host to use version 5.1.x or 5.2.x or you'd manually do it if you have access to the root.

Otherwise, you're forced to change every instance of the deprecated functions to supported functions before you install. Below I have made a list of all the places to change...

First, find this line in install/Install.class.php (on line 52).
Code: Select all
$this->main_directory = ereg_replace('/install', '', $this->install_directory);

And replace it with this...
Code: Select all
$this->main_directory = preg_replace('/install/', '', $this->install_directory);


Second, find this line in includes/SQL.class.php (on line 60).
Code: Select all
$file_location = ereg_replace('/includes', '/install/', dirname(__FILE__));

And replace it with this...
Code: Select all
$file_location = preg_replace('/includes/', '/install/', dirname(__FILE__));


Third, find this line in includes/Admin.class.php (on line 146).
Code: Select all
$email = (isset($_GET['email']) && strlen($_GET['email']) > 6 && strlen($_GET['email']) < 256 && eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', $_GET['email'])) ? $this->qls->Security->make_safe($_GET['email']) : false;

And replace it with this...
Code: Select all
$email = (isset($_GET['email']) && strlen($_GET['email']) > 6 && strlen($_GET['email']) < 256 && preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i', $_GET['email'])) ? $this->qls->Security->make_safe($_GET['email']) : false;


Fourth, find this line in includes/Admin.class.php (on line 323).
Code: Select all
$new_email = (isset($_GET['new_email']) && eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', $_GET['new_email'])) ? $this->qls->Security->make_safe($_GET['new_email']) : false;

And replace it with this...
Code: Select all
$new_email = (isset($_GET['new_email']) && preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i', $_GET['new_email'])) ? $this->qls->Security->make_safe($_GET['new_email']) : false;


Then, find this line in includes/Admin.class.php (on line 1160).
Code: Select all
$to = (isset($_GET['to']) && strlen($_GET['to']) > 6 && eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', $_GET['to'])) ? $_GET['to'] : false;

And replace it with this...
Code: Select all
$to = (isset($_GET['to']) && strlen($_GET['to']) > 6 && preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i', $_GET['to'])) ? $_GET['to'] : false;


Then, find this line in includes/Admin.class.php (on line 1161).
Code: Select all
$reply_to = (isset($_GET['reply_to']) && strlen($_GET['reply_to']) > 6 && eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', $_GET['reply_to'])) ? $_GET['reply_to'] : false;

And replace it with this...
Code: Select all
$reply_to = (isset($_GET['reply_to']) && strlen($_GET['reply_to']) > 6 && preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i', $_GET['reply_to'])) ? $_GET['reply_to'] : false;


Finally, find this line in includes/User.class.php (on line 664).
Code: Select all
$email = (isset($_POST['email']) && strlen($_POST['email']) > 6 && strlen($_POST['email']) < 256 && eregi('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', $_POST['email'])) ? $this->qls->Security->make_safe($_POST['email']) : false;

And replace it with this...
Code: Select all
$email = (isset($_POST['email']) && strlen($_POST['email']) > 6 && strlen($_POST['email']) < 256 && preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i', $_POST['email'])) ? $this->qls->Security->make_safe($_POST['email']) : false;


Great! :D If there are any more compatibility issues that anyone finds, please post them below so I can add them to this guide.

Thanks for reading!
Josh
Site Admin
 
Posts: 476
Joined: Mon Nov 05, 2007 7:30 pm
Location: California

Re: Deprecated Errors

Postby kivieg on Sat Jun 19, 2010 9:47 am

I made all of these changes and am still getting:

mysqlnd cannot connect to MySQL 4.1+ using old authentication


I am using WAMP:
MySQL Version : 5.1.36
PHP Version : 5.3.0

thanks,
joel
kivieg
New
 
Posts: 15
Joined: Thu Jun 25, 2009 10:39 pm

Re: Deprecated Errors

Postby kivieg on Sun Jun 20, 2010 4:31 pm

Answered this on my own. Turns out that PHP 5.3 introduces some incompatabilities, including a higher security requirement for connecting to MySQL. Reverting back to PHP 5.2 solved the problem...

joel
kivieg
New
 
Posts: 15
Joined: Thu Jun 25, 2009 10:39 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 0 guests

cron