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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
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 03: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
add to buddy list
ignore all messages by this user
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] Fri, 27 January 2012 23:17 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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 04: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
add to buddy list
ignore all messages by this user
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 05:10 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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 11: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
add to buddy list
ignore all messages by this user
Well, it didn't work for me. That's why I proposed the change.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Tue Oct 24 02:03:23 EDT 2017

Total time taken to generate the page: 0.00633 seconds