Hi all guys (and girl !).
I've upgraded my Wampserver to version 2.0i providing support PHP 5.3 and MySql 5.1.36. This enabled me to note that some PHP functions are deprecated in this release. These same functions will disappear in PHP version 6.
I know it will spend time, much time, before the main hosts'll update their platforms, but I don't like to see a lot of [notice] on my local test sites ;-)
So i've identified 3 functions still used in Piwigo's code that are deprecated. According PHP documentation, they should be replaced as follows:
ereg() -> preg_match()
ereg_replace() -> preg_replace()
eregi() -> preg_match() with the 'i' modifier
eregi_replace() -> preg_replace() with the 'i' modifier
set_magic_quotes_runtime() -> No more usefull. I've fixed it by adding "@" before the function.
And here are the Piwigo's core files using some of this deprecated features :
pwg/admin/include/pclzip.lib.php
pwg/admin/thumbnail.php
pwg/include/functions_user.inc.php
pwg/tools/create_listing_file.php
pwg/upload.php
pwg/install.php
I've already fixed this files for my personnal need but i'm still not PHP expert.
Do you agree, or not ?
Should I send them on svn ?
Offline
Eric wrote:
Do you agree, or not ?
Should I send them on svn ?
I'm agree ;-) For me, you can commit...
For pclzip file, you could send a message to pclzip contact.
Offline
For pclzip, new version is available (2.8.1), where depreciated functions have been removed.
I will upgrade pclzip class as soon as possible ;-)
Offline
I'ven't send the fixed files yet 'cause my PC was on failure this week-end (some bad virus attack :( ). But it's OK now and I'll send the files on SVN as soon as possible. But it could be nice if someone could verify my code adaptations : I'm still not an expert ;-)
Offline
Fixed files were send successfully to Piwigo's trunk.
Hope I'ven't mistaken :-S
Offline
Why always use that horrible arobase ? It's slow and useless in that case !
Offline
nicolas wrote:
Why always use that horrible arobase ? It's slow and useless in that case !
So, what else ? Simply deleting calls of set_magic_quotes_runtime() ?
Offline
Eric wrote:
nicolas wrote:
Why always use that horrible arobase ? It's slow and useless in that case !
So, what else ? Simply deleting calls of set_magic_quotes_runtime() ?
No; I think the better way is to test.
Offline
Hi all,
before finding this thread, while googling for a way to prevent the "Deprecated: Function set_magic_quotes_runtime() is deprecated" message, i ended up with these changes :
In "include/common.inc.php" and "install.php" :
search for : set_magic_quotes_runtime(0);
replace with : ini_set("magic_quotes_runtime", 0);
It seems to work (no more error message), i don't know if this is correct or not, just my 2 cents.
RegisLG wrote:
replace with : ini_set("magic_quotes_runtime", 0);
It seems to work (no more error message), i don't know if this is correct or not, just my 2 cents.
It works and I think it's better than adding an arobase. But many hosts service deactivate the ini_set() function. :-(
Offline
nicolas wrote:
RegisLG wrote:
replace with : ini_set("magic_quotes_runtime", 0);
It seems to work (no more error message), i don't know if this is correct or not, just my 2 cents.It works and I think it's better than adding an arobase. But many hosts service deactivate the ini_set() function. :-(
ini_set() is not allowed on Free hosting service. That is why I have not mentioned.
I agree with you : We have to find another way as adding an arobase. Even if it works on Free hosting... But I haven't found a solution by other web applications using magic_quotes_runtime. Punbb/Fluxbb's dev team choose the arobase too, for the moment.
Maybe with this below could work on a majority hosting service. I'll try as soon as possible on Free.
// Check if magic_quotes_runtime is active if(get_magic_quotes_runtime()) { // Deactive set_magic_quotes_runtime(false); }
Offline