PHP: Security when using CURL?

前端 未结 2 561
谎友^
谎友^ 2021-01-25 11:56

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

2条回答
  •  日久生厌
    2021-01-25 12:44

    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.

提交回复
热议问题