Страница 1 из 1

Osol Captcha deprecated functions

СообщениеДобавлено: 27 янв 2019, 18:53
Sergej
I have the site on joomla 1.5, with Osol Captcha plugin (v1.0.5), that causes PHP messages:
  • Deprecated: Function split() is deprecated in "/.../plugins/system/osolcaptcha.php on line 514";
  • Deprecated: Function ereg_replace() is deprecated in /.../plugins/system/osolcaptcha.php on line 811;
The reason is that "split" and "ereg_replace" were DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0.
In our case in "osolcaptcha.php" the usage of these functions is simple, and has a similar syntax as their nondeprecated counterparts "explode" and "str_replace" respectively.
So we can simply change the following function names in a file "osolcaptcha.php".
Line 514:
Код: Выделить всё
// $pathArray = split("/",JURI::base());
$pathArray = explode("/",JURI::base());

Line 811 (or may be 800):
Код: Выделить всё
// $hex = ereg_replace("#", "", $hex);
$hex = str_replace("#", "", $hex);

Hope this will help you :D
Late i want to write about other deprecated features in PHP 5–7.