News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF 2.0.19 and PHP 8.0 or 8.1

Started by greddy, September 10, 2022, 04:56:51 PM

Previous topic - Next topic

greddy

Hello,

this year PHP 7.4.30 is eol :(

now i try php 8.0 and 8.1, both not working.

With 8.0 the Logo from the forum come and below an small window with an error,
says "create_function() ...

with 8.1  no logo and this text:

Fatal error: Uncaught Error: Call to undefined function create_function() in C:\html\forum22\Sources\Subs.php:1192 Stack trace: #0 C:\html\forum22\Sources\Subs.php(3307): parse_bbc('need help call...', true, 'news0') #1 C:\html\forum22\Sources\Subs.php(3454): setupThemeContext() #2 C:\html\forum22\Sources\Subs.php(2913): template_header() #3 C:\html\forum22\Sources\Errors.php(337): obExit(NULL, true, false, true) #4 C:\html\forum22\Sources\Errors.php(161): setup_fatal_error_context('Call to undefin...') #5 C:\html\forum22\index.php(138): fatal_error('Call to undefin...', 'critical') #6 [internal function]: {closure}(Object(Error)) #7 {main} thrown in C:\html\forum22\Sources\Subs.php on line 1192



the line 1192 from the subs.php  have only "one" create_function .. but i not understand this code:


         array(
            'tag' => 'flash',
            'type' => 'unparsed_commas_content',
            'test' => '\d+,\d+\]',
            'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$2" height="$3"><param name="movie" value="$1" /><param name="play" value="true" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">$1</a></noembed>'),
            'validate' => create_function('&$tag, &$data, $disabled', '

               if (isset($disabled[\'url\']))
                  $tag[\'content\'] = \'$1\';
               elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0)
                  $data[0] = \'http://\' . $data[0];
            '),
            'disabled_content' => '<a href="$1" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">$1</a>',
         ),




anyone have an idea ?

Greets, Peter








Doug Heffernan

Smf 2.0.19 should work fine with php 8.0.

https://wiki.simplemachines.org/smf/SMF2.0:Requirements_and_recommendations

Have you considered upgrading your forum to 2.1.2. btw?

greddy


yep, i want but i have the same problem like much other peoples with the error with the
attachments, i must wait to 2.1.3 :(


Doug Heffernan

Quote from: greddy on September 10, 2022, 05:07:53 PMyep, i want but i have the same problem like much other peoples with the error with the
attachments, i must wait to 2.1.3 :(


That makes perfect sense. I forgot about that attachment bug.

Regarding the error, can you try to install a new test forum and see how that will go? If the test forum will wwork fine with php 8, then the problem must lie with a third party mod that it is not compatible with php 8. In that case you can uninstall your mods one at a time till you find the culprit.

Oldiesmann

The code causing the problem is for the old Flash bbcode tag that exists in prior versions of SMF, which could be used to embed Flash movies in your post (though I don't know how often it was actually used). You can install this mod to solve the issue if you want to use PHP 8. https://custom.simplemachines.org/index.php?mod=4300

greddy

@Oldiesmann I can not believe it, you are my hero, it works!

Many many thanks !!!!

Greets, Peter

Advertisement: