Re: Recovering from a hung regex
| From: | Shivanand Sharma | Date: | Tue, 26 May 2020 19:17:26 +0000 |
| Subject: | Re: Recovering from a hung regex | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327170@lists.php.net to get a copy of this message | ||
This file is a part of a WordPress plugin with a user base of 10k users and
growing. The regular expressions are OSINT sourced. Having developed this
solution and with a decent user-base, sadly my options at this moment are
limited. This will be ported to other CMSes too.
At the moment I've chosen to use curl to post the payload to a url endpoint
which in the worst case will timeout thereby allowing PHP to handle the
exception and recover / continue. This is essentially the same as spawning
an external process to let PHP be an observer than indulge itself into
something that it cannot handle.
I do sincerely appreciate everyone's inputs. Learned quite a few things and
potentially alternate approaches. Thanks again.