MyBB Community Forums

Full Version: [D] Magic Quotes Deprecated in PHP 5.3+
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As some members that are running PHP 5.3+ have found, since Magic Quotes is deprecated, error messages show up since the functions are called in inc/class_core.php.

Find in inc/class_core.php:
// Determine Magic Quotes Status
if(get_magic_quotes_gpc())
{
	$this->magicquotes = 1;
	$this->strip_slashes_array($_POST);
	$this->strip_slashes_array($_GET);
	$this->strip_slashes_array($_COOKIE);
}
set_magic_quotes_runtime(0);
@ini_set("magic_quotes_gpc", 0);
@ini_set("magic_quotes_runtime", 0);

Replace with:
if(phpversion() < "5.3")
{
	// Determine Magic Quotes Status
	if(get_magic_quotes_gpc())
	{
		$this->magicquotes = 1;
		$this->strip_slashes_array($_POST);
		$this->strip_slashes_array($_GET);
		$this->strip_slashes_array($_COOKIE);
	}
	set_magic_quotes_runtime(0);
	@ini_set("magic_quotes_gpc", 0);
	@ini_set("magic_quotes_runtime", 0);
}
PHP 5.3 support has been added into the next maintenance release. There's a few more errors than just class_core.php - but the SVN has already been updated...
Marking as dupe since these were already identified and fixed for the next maintenance release a while ago
Oops. Sorry, I didn't update my SVN soon enough.