tchwork / utf8

Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP
Apache License 2.0
627 stars 50 forks source link

file_get_contents() function blocked at php.ini level #62

Closed vinhtvu2 closed 4 years ago

vinhtvu2 commented 7 years ago

We recently blocked set allow_url_fopen = 0 in php settings for security reason.

Is there anyway we can request for all the file_get_contents() functions to be converted to using curl? Either: http://snipplr.com/view/4084/curl-replacement-for-filegetcontents/ Or http://snipplr.com/view/51161/basic-curl-wrapper-function-for-php/

which include a default user-agent and option for setting user agent.

Thanks.

vinhtvu2 commented 7 years ago

Usage of file_get_contents() function: https://github.com/tchwork/utf8/search?q=file_get_contents&type=Code&utf8=%E2%9C%93

GrahamCampbell commented 7 years ago

This function is used for reading files on the disk, not HTTP requests. I don't think cURL can even be used for that?

GrahamCampbell commented 7 years ago

Ah, I see your example. Seems very unconventional. Surely people are more likely to have mb-string installed than curl?

GrahamCampbell commented 7 years ago

It doesn't make sense to me to another extension dependency, when one of the aims of this package is to mitigate the absence of the mb-string extension?

nicolas-grekas commented 4 years ago

Old and edgy.