E_DEPRECATED: str_replace() in plugin_functions.php

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 30, 2022   (RSS)

By daniel - August 30, 2022

Hi Deborah,

Thanks for the report! Yes, this should be a relatively straightforward fix. Can you try changing this line in /cmsb/lib/plugin_functions.php (at or near line 458):

$pluginUrl    = str_replace(' ', '%20', @$_SERVER['SCRIPT_NAME']);            // url encoded spaces

To this:

$pluginUrl    = str_replace(' ', '%20', $_SERVER['SCRIPT_NAME']??'');            // url encoded spaces

Let me know if that clears up the errors!

Thanks,

Daniel
Technical Lead
interactivetools.com

By Deborah - August 30, 2022

Hi, Daniel. Your suggested worked!

While reviewing the CMSB error log I noticed an occasional similar error being recorded, so I modified the following:

/lib/database_functions.php - line 450:

  $hostname         = preg_replace('/[^\w\d\-\.]/', '', @$_SERVER['HTTP_HOST']);      

changed to:

$hostname = preg_replace('/[^\w\d\-\.]/', '', $_SERVER['HTTP_HOST']??'');

I've not seen these errors logged after the change. 

Thank you once again for your help!

~ Deborah