Open nunodonato opened 3 years ago
Thank you. @nunodonato. Yeah, sure.
well the problem is that my solution is only for Laravel, because it uses
use Illuminate\Support\Facades\Http;
basically I'm doing
$content = Http::get($this->url);
$feed_data = simplexml_load_string($content, 'SimpleXMLElement', LIBXML_NOCDATA);
so I let the Http request handle the headers, and then just load the contents via simplexml_load_string
But I think this will break whoever is using your package without laravel...
Hi, @nunodonato.
I see. I'll take a look and apply the solution for all applications. You can give a feed link to test.
Thank you.
simplexml_load_file will fail while fetching contents from certain websites due to missing headers. They should be set up in a proper context and then passed to simplexml_load_file can I make a pull request for this?