Affects Version/s: 15
Fix Version/s: None
Component/s: FreePBX Framework
Bug Tracker:Customer Issue
If 3rd Party module updates are hosted on GitHub, Curl fails to retrieve the file because of redirects and/or cookies not being enabled
The files can be retrieved via wget, but the download code in modulefunctions.class.php does not respect the "Use wget for Module Admin" advanced setting.
A dirty fix is to add:
exec("wget -q $url -O $filename");
at line 1530.
but this can obviously be improved with a relevant test to choose the downloader, or by including the relevant settings for FreePBX::Curl.
The updated version can be downloaded successfully using Admin -> Module Admin -> Upload Modules without changing advanced settings.
After further analysis of past issues, the fix is the same as for issue
FREEPBX-21129 - change the 'post' at line 1529 to a 'get'
diff modulefunctions.class.php modulefunctions.class.old.php 1527d1526 < 'filename' => $filename, 1529c1528,1529 < $response = $requests->get('', array(), $options); --- > $response = $requests->post('', array(), $urls['options'], $options); > file_put_contents($filename,$response->body);