diff --git a/src/Agent.php b/src/Agent.php index 0d13031..a1549f0 100644 --- a/src/Agent.php +++ b/src/Agent.php @@ -320,6 +320,10 @@ public function version($propertyName, $type = self::VERSION_TYPE_STRING) $properties[$propertyName] = (array) $properties[$propertyName]; foreach ($properties[$propertyName] as $propertyMatchString) { + if (is_array($propertyMatchString)) { + $propertyMatchString = implode("|", $propertyMatchString); + } + $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); // Identify and extract the version. diff --git a/tests/AgentTest.php b/tests/AgentTest.php index f9a8935..a816ed5 100644 --- a/tests/AgentTest.php +++ b/tests/AgentTest.php @@ -222,6 +222,11 @@ public function testVersions() $platform = $agent->platform(); $this->assertEquals($version, $agent->version($platform), $ua); } + + foreach ($this->browsers as $ua => $browser) { + $agent->setUserAgent('FAKE'); + $this->assertFalse($agent->version($browser)); + } } public function testIsMethods()