News:

Wondering if this will always be free?  See why free is better.

Main Menu

Type of error: Cron

Started by gevv, May 11, 2022, 04:37:32 PM

Previous topic - Next topic

gevv

Hi,

Error logs are increasing (SMF 2.1.2). What would be the reason ?


Type of error: Cron
Error message

8192: Function create_function() is deprecated

https://www.site.com/cron.php
/home/site/public_html/Sources/Subs.php (Line 2080)


==>2080:             'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),

QuoteType of error
Cron
Error message
8192: Function create_function() is deprecated
File
/home/site/public_html/Sources/Subs.php
Line
2080
URL of page causing the error
https://www.site.com/index.phphttps://www.site.com/cron.php
Backtrace information

    #0: smf_error_handler_cron()
    Called from /home/site/public_html/Sources/Subs.php on line 2080
    #1: parse_bbc()
    Called from /home/site/public_html/Sources/tasks/CreatePost-Notify.php on line 569
    #2: handleWatchedNotifications()
    Called from /home/site/public_html/Sources/tasks/CreatePost-Notify.php on line 270
    #3: execute()
    Called from /home/site/public_html/cron.php on line 237
    #4: perform_task()
    Called from /home/site/public_html/cron.php on line 131




Type of error: Cron
Error message Select
8192: Function create_function() is deprecated

 https://www.site.com/cron.php
/home/site/public_html/Sources/Subs.php (Line 2072)

==>2072:             'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),


QuoteType of error
Cron
Error message
8192: Function create_function() is deprecated
File
/home/site/public_html/Sources/Subs.php
Line
2072
URL of page causing the error
https://www.site.com/index.phphttps://www.site.com/cron.php
Backtrace information

    #0: smf_error_handler_cron()
    Called from /home/site/public_html/Sources/Subs.php on line 2072
    #1: parse_bbc()
    Called from /home/site/public_html/Sources/tasks/CreatePost-Notify.php on line 569
    #2: handleWatchedNotifications()
    Called from /home/site/public_html/Sources/tasks/CreatePost-Notify.php on line 270
    #3: execute()
    Called from /home/site/public_html/cron.php on line 237
    #4: perform_task()
    Called from /home/site/public_html/cron.php on line 131


ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Arantor

You have a mod that needs updating, some bbcode mod is using the old create_function method of making bbcodes.

Would need to see more of the lines before and after line 2072 to tell you which mod and how to fix it.

gevv

Thanks @Arantor  I added the subs.php file
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Arantor

It looks like a remove images from quotes mod. There are two bbcodes that are broken, both need updating.

Code (find) Select
// Remove images from quotes.
         array(
            'tag' => 'img',
            'type' => 'unparsed_content',
            'require_parents' => array('quote'),
            'parameters' => array(
               'alt' => array('optional' => true),
               'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
               'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
            ),
            'content' => '<i>(<a href="$1" target="_blank" onclick="this.parentNode.innerHTML = \'&lt;i\' + \'mg src=\\\'\' + this.href + \'\\\' /\' + \'>\'; return false;">' . $txt['remove_image_from_post'] . '</a>.)</i>',
            'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
            'disabled_content' => '($1)',
         ),
         array(
            'tag' => 'img',
            'type' => 'unparsed_content',
            'require_parents' => array('quote'),
            'content' => '<i>(<a href="$1" target="_blank" onclick="this.parentNode.innerHTML = \'&lt;i\' + \'mg src=\\\'\' + this.href + \'\\\' /\' + \'>\'; return false;">' . $txt['remove_image_from_post'] . '</a>.)</i>',
            'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
            'disabled_content' => '($1)',
         ),

Code (replace) Select
// Remove images from quotes.
         array(
            'tag' => 'img',
            'type' => 'unparsed_content',
            'require_parents' => array('quote'),
            'parameters' => array(
               'alt' => array('optional' => true),
               'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
               'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
            ),
            'content' => '<i>(<a href="$1" target="_blank" onclick="this.parentNode.innerHTML = \'&lt;i\' + \'mg src=\\\'\' + this.href + \'\\\' /\' + \'>\'; return false;">' . $txt['remove_image_from_post'] . '</a>.)</i>',
            'validate' => function(&$tag, &$data, $disabled) { $data = strtr($data, array('<br />' => '')); },
            'disabled_content' => '($1)',
         ),
         array(
            'tag' => 'img',
            'type' => 'unparsed_content',
            'require_parents' => array('quote'),
            'content' => '<i>(<a href="$1" target="_blank" onclick="this.parentNode.innerHTML = \'&lt;i\' + \'mg src=\\\'\' + this.href + \'\\\' /\' + \'>\'; return false;">' . $txt['remove_image_from_post'] . '</a>.)</i>',
            'validate' => function(&$tag, &$data, $disabled) { $data = strtr($data, array('<br />' => '')); },
            'disabled_content' => '($1)',
         ),

The mod author really should update this; in its present state it will break a forum on PHP 8.

gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Advertisement: