LSCache Opencart plugin on Windows platform browsers

AndreyPopov

Well-Known Member
#1
find problem when save UAs or URLs ( include, exclude ) list in browsers on Windows platform.
Code:
explode(PHP_EOL, $str)
not work correctly !!!!!!

only last item in list used correctly.

find recommendation replace explode with:
Code:
preg_split('/\n|\r\n?/', $str);
I replace manually in lscache.php all explode to preg_split and now all recache for UA and include/exclude URLs lists work great!
 

serpent_driver

Well-Known Member
#2
Handle this modification carefully. PHP_EOL is not the same like \n or \r\n. PHP_EOL defines the end of a line, \n can be everywhere, but you are right that PHP_EOL doesn't find endline on Windows systems. Notice, explode is as double as fast as preg_split. If you find an issue with entering UA, plugin developer should check it to find a solution that doesn't cause other issues like your solution.
 

AndreyPopov

Well-Known Member
#3
Notice, explode is as double as fast as preg_split.
for recache this is not matter.


If you find an issue with entering UA, plugin developer should check it to find a solution that doesn't cause other issues like your solution.
already write to developer.


recache for UAs list added three month ago.
I ask developer WHY recache for UAs work only for one UA in list or only for last - but no answer.

month ago added URLs include/exclude lists to recache.

I add some urls like this:
Code:
product/manufacturer/info&manufacturer_id=11&sort=p.date_added&order=DESC
product/manufacturer/info&manufacturer_id=12&sort=p.date_added&order=DESC
and in recache log see:
Code:
https://www.priazha-shop.com/product/manufacturer/info&manufacturer_id=11&sort=p.date_added&order=DESC_
https://www.priazha-shop.com/product/manufacturer/info&manufacturer_id=12&sort=p.date_added&order=DESC_
only if one url in list or last url was correct.


I try add space char after url
Code:
product/manufacturer/info&manufacturer_id=11&sort=p.date_added&order=DESC 
product/manufacturer/info&manufacturer_id=12&sort=p.date_added&order=DESC
and in recache log see:
Code:
https://www.priazha-shop.com/product/manufacturer/info&manufacturer_id=11&sort=p.date_added&order=DESC+_
https://www.priazha-shop.com/product/manufacturer/info&manufacturer_id=12&sort=p.date_added&order=DESC+_
some tests, some checks
think,think,think and search Internet by "explode PHP_EOL"
 
Last edited:

AndreyPopov

Well-Known Member
#7
I mean: LSCache plugin recache function work correctly after save UAs/URLs list

for correctly work under Windows.Linux, OSX preg_split must be:

Code:
preg_split('/\n|\r|\r\n?/', $str);
 
Top