X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   Smart Search and PHP7 (https://forum.x-cart.com/showthread.php?t=74902)

acrotech 04-18-2018 10:15 AM

Re: Smart Search and PHP7
 
$search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript
"'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags
"'([\r\n])[\s]+'", // Strip out white space
"'&(quot|#34);'i", // Replace HTML entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e");

if ($search && $string){
return preg_replace($search, ' ', $string);
} else {
return false;
}

I believe, the issue is in the above code - 'e"

Here is the error -
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /.../modules/Smart_Search/smart_search_functions.php on line 319

The search does not return anything.

BCSE 04-19-2018 11:23 AM

Re: Smart Search and PHP7
 
I think the 'e' is a mistake, but this is untested.

I would replace this line:
"'&#(\d+);'e");

With this:
"'&#(\d+);'");

Try it and let us know.

thanks

Carrie

acrotech 04-19-2018 12:41 PM

Re: Smart Search and PHP7
 
Thanks Carrie - that seems to work. There are some other minor kinks - once we resolve them - we should be able to move to php7.
thanks

BCSE 04-25-2018 08:43 AM

Re: Smart Search and PHP7
 
Quote:

Originally Posted by acrotech
Thanks Carrie - that seems to work. There are some other minor kinks - once we resolve them - we should be able to move to php7.
thanks


You're very welcome! Glad it helped!

Carrie


All times are GMT -8. The time now is 02:05 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.