I am concerned about the safety of fetching content from unknown url in PHP.

We will basically use cURL to fetch html content from user provided url and look for Open Graph meta tags, to show the links as content cards.

Because the url is provided by the user, I am worried about the possibility of getting malicious code in the process.

I have another question: does curl\_exec actually download the full file to the server? If yes then is it possible that viruses or malware be downloaded when using curl?