Top Hosting Forum

WebHosting Reviews Forum


[solved] PHPBB 3.0.x static kind of errors and its fixes

PHPBB forum script Discussion. PHPBB Questions, Troubleshooting, Errors, Mods and so on..
Hosting Forum Description
PHPBB forum script Discussion. PHPBB Questions, Troubleshooting, Errors, Mods and so on..

[solved] PHPBB 3.0.x static kind of errors and its fixes

Postby hostingforum » Thu Aug 01, 2024 12:22 pm

PHPBB 3.0.X
PHP 5.6.40

Error:
Non-static method phpbb_captcha_factory::get_instance() should not be called statically * in captcha_factory.php (or in posting.php on line 185 )

Find the line error mentions:
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);

replace by:
$captchaFactory = new phpbb_captcha_factory();
$captcha = $captchaFactory->get_instance($config['captcha_plugin']);

--------in same file:--------------------------

PHP Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_qa::garbage_collect() should not be called statically in /includes/captcha/captcha_factory.php on line 58\n

replace:
call_user_func(array($name, 'garbage_collect'), 0);

by:
$name = new phpbb_captcha_qa();
call_user_func(array($name, 'garbage_collect'), 0);

-----------in same file----------------------

call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_recaptcha::is_available() should not be called statically in includes/captcha/captcha_factory.php on line 85

replace:
if (call_user_func(array($name, 'is_available')))


{
$captchas['available'][$name] = call_user_func(array($name, 'get_name'));
}
else
{
$captchas['unavailable'][$name] = call_user_func(array($name, 'get_name'));
}
}


by:
$instance = new $name(); // Create an instance of the class
if (call_user_func(array($instance, 'is_available'))) {
$captchas['available'][$name] = call_user_func(array($instance, 'get_name'));
} else {
$captchas['unavailable'][$name] = call_user_func(array($instance, 'get_name'));
}
}


---------------------------------

[STDERR] PHP Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method phpbb_captcha_qa::get_instance() should not be called statically in /includes/captcha/captcha_factory.php on line 38\n OR in posting.php

replace
$instance = call_user_func(array($name, 'get_instance'));

by:
$class_instance = new $name();
$instance = $class_instance->get_instance();



hostingforum
Site Admin
 
Posts: 673
Joined: Fri May 20, 2011 7:58 pm

Return to PHPBB

Who is online

Users browsing this forum: No registered users and 0 guests

.