I am working with a custom Silex (Symphony) CMS.
One of the custom modules uses google/apiclient
(https://packagist.org/packages/google/apiclient) module for fetching YouTube video channels and video informations.
On our local environment, for some reason, the ampersand (&)
of a YouTube request URL gets encoded to &
, and for this reason it is not working, throwing failed to open stream: Connection refused
error, while if I open a new browser tab, and paste the URL, and change the &
into &
, it works just fine. Tried to use a USA vpn, but no change.
It could be some PHP setting that I am not aware of. Tried to override manually the fetching URL, but the encode happens insde fopen I guess.
So I tried to use curl
instead of fopen
to read the URL, inside google/apiclient's Stream.php file, and it reads the URL just fine, it is not throwing any errors. Before that, also tried file_get_contents()
, same result as with fopen.
Is there a way to transform a curl
result to an fopen stream
, to replace only that part of the code, in order to make it work?
Or someone does have another solution for this?
Note: composer update google/apiclient
says "Nothing to update", so either the version was locked down, or it is at the latest version.