Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: gariban - joulukuu 28, 2019, 12:24:46 IP

Otsikko: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: gariban - joulukuu 28, 2019, 12:24:46 IP
- SMF 2.0.16
- Centos7
- PHP 7.2.26 (cli) (built: Dec 17 2019 14:06:22) ( NTS )

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1088

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1130

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1179

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1195

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1214

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1225

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1299

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1310

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1386

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1485

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1510

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1566

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1597

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1608

Deprecated: Function create_function() is deprecated in /home/forum/Sources/Subs.php on line 1619

Deprecated: Function create_function() is deprecated in /home/forum/Sources/FontAwesomeBBCode.php on line 23

Deprecated: Function create_function() is deprecated in /home/forum/Sources/FontAwesomeBBCode.php on line 33
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: vbgamer45 - joulukuu 28, 2019, 12:26:34 IP
What page does it occur on?
I saw CLI are you running a cron job?
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: gariban - joulukuu 28, 2019, 12:33:43 IP
Lainaus käyttäjältä: vbgamer45 - joulukuu 28, 2019, 12:26:34 IP
What page does it occur on?

at forum index

Lainaus käyttäjältä: vbgamer45 - joulukuu 28, 2019, 12:26:34 IP
I saw CLI are you running a cron job?

cron job not running

line 1088

'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: vbgamer45 - joulukuu 28, 2019, 12:34:42 IP
Are you including any SSI.php code? Did SMF 2.0.16 install with any failures?
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: gariban - joulukuu 28, 2019, 12:45:34 IP
Lainaus käyttäjältä: vbgamer45 - joulukuu 28, 2019, 12:34:42 IP
Are you including any SSI.php code? Did SMF 2.0.16 install with any failures?

Yes, i'm using SSI
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: vbgamer45 - joulukuu 28, 2019, 12:47:26 IP
For now edit SSI.php
Find the two spots that have error_reporting(
And change to

error_reporting(0);
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: gariban - joulukuu 28, 2019, 12:59:18 IP
which one?

line 47:
$ssi_error_reporting = error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL);

line: 120
// Make a stab at it, but ignore the E_WARNINGs generated because we can't send headers.
$temp = error_reporting(error_reporting() & !E_WARNING);
loadSession();
error_reporting($temp);


line: 190
error_reporting($ssi_error_reporting);
if (function_exists('set_magic_quotes_runtime'))

Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: vbgamer45 - joulukuu 28, 2019, 01:05:02 IP
I do line 47 and line 120
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: Sesquipedalian - joulukuu 31, 2019, 12:54:13 AP
2.0.17 officially fixes this. Please revert any manual changes you made, and then install 2.0.17.
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: riou - tammikuu 03, 2020, 03:21:45 AP
Lainaus käyttäjältä: Sesquipedalian - joulukuu 31, 2019, 12:54:13 AP
2.0.17 officially fixes this. Please revert any manual changes you made, and then install 2.0.17.

On 2.0.17

This still seems to be an issue in SSI loaded pages trying to fetch a post, it seems to trigger when a post contains the following in it (that I can confirm at least)


[quote=word]text[/quote]


It triggers the first 14 deprecated error lines from the OP

Deleting =word (in the post) makes it no longer error

The proper quote set ups (that are url linked in the default quote set up) works without error
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: FfdG - tammikuu 07, 2020, 03:31:23 IP
Same problem, had to change index.php:
error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL);
to
error_reporting((defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL) ^ E_DEPRECATED);
Otsikko: Re: SMF 2.0.16 - Deprecated: Function create_function()
Kirjoitti: Reefer - maaliskuu 15, 2020, 05:31:28 AP
Lainaus käyttäjältä: FfdG - tammikuu 07, 2020, 03:31:23 IP
Same problem, had to change index.php:
error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL);
to
error_reporting((defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL) ^ E_DEPRECATED);

Thanks for this! Running 2.0.17 on pHp 7.2 would return visible deprecated errors throughout. After much frustration, found this fix - and it worked!! Thanks again!