feed-io
feed-io copied to clipboard
Catastrofic backtracking fix
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
I also tested the updated regex again with a modified version of the feed item, see:
https://regex101.com/r/oxU67Z/1
I see this problem with your link. I'll think about a solution.