From 2317f17136a775666dbbd09731e6a30c2d023ed3 Mon Sep 17 00:00:00 2001 From: Liviu-Mihail Concioiu Date: Wed, 13 Jul 2022 17:56:48 +0200 Subject: [PATCH] Adds detection for Ricoh brand and device --- Parser/Device/AbstractDeviceParser.php | 3 ++- Tests/fixtures/peripheral.yml | 18 ++++++++++++++++++ regexes/device/mobiles.yml | 8 ++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Parser/Device/AbstractDeviceParser.php b/Parser/Device/AbstractDeviceParser.php index 432f2c6150..f09ef7a2d9 100644 --- a/Parser/Device/AbstractDeviceParser.php +++ b/Parser/Device/AbstractDeviceParser.php @@ -1032,6 +1032,7 @@ abstract class AbstractDeviceParser extends AbstractParser 'RH' => 'Remdun', 'RP' => 'Revo', '8R' => 'Retroid Pocket', + 'RIC' => 'Ricoh', 'RI' => 'Rikomagic', 'RM' => 'RIM', 'RN' => 'Rinno', @@ -1658,7 +1659,7 @@ protected function hasDesktopFragment(): bool { return $this->matchUserAgent('(?:Windows (?:NT|IoT)|X11; Linux x86_64)') && - !$this->matchUserAgent(' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone') && + !$this->matchUserAgent(' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone|ricoh') && !$this->matchUserAgent('Lenovo|compatible; MSIE|Trident/|Tesla/|XBOX|FBMD/|ARM; ?([^)]+)'); } diff --git a/Tests/fixtures/peripheral.yml b/Tests/fixtures/peripheral.yml index c3bf0b4652..d35b7c1a04 100644 --- a/Tests/fixtures/peripheral.yml +++ b/Tests/fixtures/peripheral.yml @@ -606,3 +606,21 @@ model: MobiGo 2 os_family: Android browser_family: Chrome +- + user_agent: Mozilla/5.0 (X11; Linux x86_64; ricoh_mfpapnl) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24 + os: + name: GNU/Linux + version: "" + platform: x64 + client: + type: browser + name: Chrome + version: 11.0.696.34 + engine: WebKit + engine_version: "534.24" + device: + type: peripheral + brand: Ricoh + model: MFP + os_family: GNU/Linux + browser_family: Chrome diff --git a/regexes/device/mobiles.yml b/regexes/device/mobiles.yml index 1fa25cd557..18b9fda700 100644 --- a/regexes/device/mobiles.yml +++ b/regexes/device/mobiles.yml @@ -6470,6 +6470,14 @@ Gateway: device: 'tablet' model: 'Tablet 8"' +# Ricoh (https://www.ricoh.com/) +Ricoh: + regex: 'ricoh_' + device: 'peripheral' + models: + - regex: 'ricoh_mfpapnl' + model: 'MFP' + # Rikomagic Rikomagic: regex: 'MK(80[28][^/;]*) Build'