feed-io icon indicating copy to clipboard operation
feed-io copied to clipboard

Catastrofic backtracking fix

Open DemonTPx opened this issue 1 year ago • 2 comments
trafficstars

Fixes #425

Update setHostInContent regexes to reduce steps and hopefully prevent a PREG_BACKTRACK_LIMIT_ERROR and check result of preg_replace to be sure we do not set content or description to null.

Also refactor setHostInContent and getHostFromLink a bit for readability.

cc @IgorA100

DemonTPx avatar Apr 09 '24 13:04 DemonTPx

I also tested the updated regex again with a modified version of the feed item, see:

https://regex101.com/r/oxU67Z/1

DemonTPx avatar Apr 09 '24 13:04 DemonTPx

I see this problem with your link. I'll think about a solution.

IgorA100 avatar Apr 09 '24 13:04 IgorA100