MDL-45846 Libraries custom user agent device detection unit test added
This commit is contained in:
@@ -122,6 +122,11 @@ class core_useragent {
|
||||
if (!empty($CFG->devicedetectregex)) {
|
||||
$this->devicetypecustoms = json_decode($CFG->devicedetectregex, true);
|
||||
}
|
||||
if ($this->devicetypecustoms === null) {
|
||||
// This shouldn't happen unless you're hardcoding the config value.
|
||||
debugging('Config devicedetectregex is not valid JSON object');
|
||||
$this->devicetypecustoms = array();
|
||||
}
|
||||
if ($forceuseragent !== null) {
|
||||
$this->useragent = $forceuseragent;
|
||||
} else if (!empty($_SERVER['HTTP_USER_AGENT'])) {
|
||||
|
||||
Reference in New Issue
Block a user