mdobydullah / easyfeed

RSS & Atom Feed Generator and Reader for Laravel & PHP Project
MIT License
2 stars 1 forks source link

Headers missing #1

Open nunodonato opened 3 years ago

nunodonato commented 3 years ago

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?

mdobydullah commented 3 years ago

Thank you. @nunodonato. Yeah, sure.

nunodonato commented 3 years ago

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...

mdobydullah commented 3 years ago

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.