8192: Function create_function() is deprecated

Started by The Dead Spiders, May 17, 2019, 11:11:36 PM

Previous topic - Next topic

The Dead Spiders

Hi!  I'm sorry, I know this has come up before, but all the solutions I've found haven't worked for me.  It's currently making it look like all my links are highlighted, I think?  Or I have a bonus secret problem, but for now, is there a way that I can make this a normal function?  I tried deleting "create_" from all the error lines and it broke, I added

error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);

within the <?php?>, and I downloaded and installed the SMF 2.0.X - PHP 7.2+ Compatibility mod.  I've also flickered between PHP 7.1, 7.2, and 7.3.  Is there anything else I can do?  Bear in mind, I have no idea about anything PHP, so if you could break it down to layman, I'd be immensely grateful.

Here's one of the sections of code I'm looking at:

array(
'tag' => 'ftp',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_ftp new_win" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'ftp://\') !== 0 && strpos($data, \'ftps://\') !== 0)
$data = \'ftp://\' . $data;
'),
),

Thanks so much!

Arantor

The only way to fix this is to rewrite it, SMF 2.0 isn't going to get full support for PHP 7.2+ because T-shirt not possible to patch it, it needs rewriting. (Whatever mods are out there will only do the core, maybe, and definitely no other mods)

2.1 solves this though mods still need updating.

The Dead Spiders

I'm having a hard time uploading the package.

"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."

My permissions look fine, and I've downloaded the file into the Packages as smf_2-1-rc2_upgrade, but it still isn't being picked up.  Am I doing something wrong with the upload?

Or, alternatively, how would I rewrite that string?  I just can't really read PHP, so I don't know the ripple effect of any changes, and deleting create_ broke it.  Again, I really appreciate the assistance! 

Arantor

You can't upload 2.1 as a package, it's not possible to do so. You unpack it and overwrite all the files with the ones in the 2.1 upgrade.

As for rewriting, honestly, I don't have the energy to sit and do the rewrite for you - you might be able to find it in the Subs.php file in 2.1 in the new format.

The Dead Spiders

#4
Thank you so much, I really appreciate the help!  I didn't know if the create_function was a change x to y situation, so I didn't mean to ask you to take up a massive undertaking, if it was more complex than that.  I've got it updating now.

And the updating work!

You've been a huge help!

Arantor

It's not that it's a massive undertaking for just one, but there's dozens in SMF and that's without any of the mods...

Advertisement: