MDL-66166 core_useragent: Update MoodleBot UA and treat as web crawler

This commit is contained in:
Brendan Heywood
2019-09-30 23:30:20 +10:00
parent 9528b1ff5b
commit 3bc082dd07
4 changed files with 31 additions and 6 deletions
+2 -2
View File
@@ -3103,7 +3103,7 @@ class curl {
*/
public function resetopt() {
$this->options = array();
$this->options['CURLOPT_USERAGENT'] = 'MoodleBot/1.0';
$this->options['CURLOPT_USERAGENT'] = \core_useragent::get_moodlebot_useragent();
// True to include the header in the output
$this->options['CURLOPT_HEADER'] = 0;
// True to Exclude the body from the output
@@ -3346,7 +3346,7 @@ class curl {
} else if (!empty($this->options['CURLOPT_USERAGENT'])) {
$useragent = $this->options['CURLOPT_USERAGENT'];
} else {
$useragent = 'MoodleBot/1.0';
$useragent = \core_useragent::get_moodlebot_useragent();
}
// Set headers.