[IP.Board 3.1.3 / PHP 7.2] «Function create_function() is deprecated»

php72
ip-board
php

(Dmitry Fedyuk) #1


(Dmitry Fedyuk) #2

How to fix

Step 1

Locate the code in the initdata.php file:

if( version_compare( PHP_VERSION, '5.2.0', '>=' ) )
{
	error_reporting( E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_RECOVERABLE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_USER_WARNING );
}
else
{
	error_reporting( E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR | E_USER_ERROR | E_USER_WARNING );
}

Replace it with:

error_reporting (
    defined('E_DEPRECATED')
    ? (E_ALL | E_STRICT) &~ (E_DEPRECATED | E_NOTICE)
    : E_ALL | E_STRICT &~ E_NOTICE
);

Step 2

Locate the code in the admin/sources/loginauth/live/auth.php file:

error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT );

Replace it with:

error_reporting(error_reporting() ^ E_STRICT);