From ef9f229aedc00f5cc8938de3e6bf5bddd18725f0 Mon Sep 17 00:00:00 2001
From: Pascal Querner
Date: Tue, 8 Aug 2023 12:23:16 +0200
Subject: [PATCH] make compatible to extends
---
Mobile_Detect.php | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/Mobile_Detect.php b/Mobile_Detect.php
index 617f473f..3dc384d4 100644
--- a/Mobile_Detect.php
+++ b/Mobile_Detect.php
@@ -1180,10 +1180,10 @@ public static function getMobileDetectionRules()
if (!$rules) {
$rules = array_merge(
- self::$phoneDevices,
- self::$tabletDevices,
- self::$operatingSystems,
- self::$browsers
+ static::getPhoneDevices(),
+ static::getTabletDevices(),
+ static::getOperatingSystems(),
+ static::getBrowsers()
);
}
@@ -1208,11 +1208,11 @@ public function getMobileDetectionRulesExtended()
if (!$rules) {
// Merge all rules together.
$rules = array_merge(
- self::$phoneDevices,
- self::$tabletDevices,
- self::$operatingSystems,
- self::$browsers,
- self::$utilities
+ static::getPhoneDevices(),
+ static::getTabletDevices(),
+ static::getOperatingSystems(),
+ static::getBrowsers(),
+ static::getUtilities()
);
}
@@ -1406,7 +1406,7 @@ public function isTablet($userAgent = null, $httpHeaders = null)
$this->setDetectionType(self::DETECTION_TYPE_MOBILE);
- foreach (self::$tabletDevices as $_regex) {
+ foreach (static::getTabletDevices() as $_regex) {
if ($this->match($_regex, $userAgent)) {
return true;
}
@@ -1531,7 +1531,7 @@ public function version($propertyName, $type = self::VERSION_TYPE_STRING)
$type = self::VERSION_TYPE_STRING;
}
- $properties = self::getProperties();
+ $properties = static::getProperties();
// Check if the property exists in the properties array.
if (true === isset($properties[$propertyName])) {