I have a page like this. User write an URL into a form and submit. Once the URL is submitted, I connect that page with CURL, search for a string. If it finds the string, it adds
I don't see why htmlspecialchars
or a Regex would be necessary here, you don't need those. Also, there is no way that PHP will "automatically" parse the content retrieved using cURL. So yes, it is save (unless you do stuff like eval
with the output).
However, when processing the retrieved content later, be aware that the input is user-provided and needs to be handled accordingly.