FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » core.inc and PHP > 5.3.0
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
core.inc and PHP > 5.3.0 [message #166595] Fri, 27 January 2012 08:39 Go to next message
NeXuS is currently offline  NeXuS   Korea, Republic of
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
I suggest that the first few lines of core.inc are changed to the following (with the obvious change to $FORUM_VERSION, if needed)

$FORUM_VERSION = '3.0.3';

ignore_user_abort('1');

if (!defined('PHP_VERSION_ID')) {
    $version = explode('.', PHP_VERSION);

    define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}

if( PHP_VERSION_ID < 50300 )
{
	@set_magic_quotes_runtime(0);
}
Re: core.inc and PHP > 5.3.0 [message #166608 is a reply to message #166595] Sat, 28 January 2012 04:17 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Alternatively:
if (version_compare(PHP_VERSION, '5.3.0', '<')) set_magic_quotes_runtime(0);


On the other hand, won't it be easier to just desupport PHP_VERSION < 5.3? I know some sites are stuck on PHP 5.1 and 5.2, but since it's end of life, they will have to upgrade sooner rather than later.
Re: core.inc and PHP > 5.3.0 [message #166632 is a reply to message #166608] Wed, 01 February 2012 09:11 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Well, you don't have to ask me. Anyway better safe than sorry.
Re: core.inc and PHP > 5.3.0 [message #166633 is a reply to message #166632] Wed, 01 February 2012 10:10 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
The current code works well in all PHP versions up to and including 5.3.x.
PHP 5.4 will be released soon. We can retest once 5.4 is out, and - if required - change the code.
Re: core.inc and PHP > 5.3.0 [message #166634 is a reply to message #166633] Wed, 01 February 2012 16:13 Go to previous message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
Well, it didn't work for me. That's why I proposed the change.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Drupal CMS integration
Next Topic: Dynamic check of login/alias/email availability
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed May 01 15:44:21 GMT 2024

Total time taken to generate the page: 0.02860 seconds