MDL-74567 repository_flickr: replace user-agent value for API calls.

Flickr doesn't like user agent that looks like a bot. Effectively the
same reasoning/fix as b8ee31a0.
This commit is contained in:
Paul Holden
2022-04-29 13:08:36 +01:00
parent 1a744030d6
commit 2972e66008
+6
View File
@@ -78,7 +78,13 @@ class phpFlickr {
//Find the PHP version and store it for future reference
$this->php_version = explode("-", phpversion());
$this->php_version = explode(".", $this->php_version[0]);
// Initialize curl helper, set custom user agent as Flickr blocks our "MoodleBot" agent string.
$this->curl = new curl(array('cache'=>true, 'module_cache'=>'repository'));
$version = moodle_major_version();
$this->curl->setopt([
'CURLOPT_USERAGENT' => "MoodleSite/$version (+{$CFG->wwwroot})"
]);
}
function request ($command, $args = array())