Exemple #1
0
 public function applyConclusiveMatch($userAgent)
 {
     if (Utils::checkIfContains($userAgent, 'BB10')) {
         $tolerance = Utils::indexOfOrLength($userAgent, ')');
     } else {
         if (Utils::checkIfStartsWith($userAgent, 'Mozilla/4')) {
             $tolerance = Utils::secondSlash($userAgent);
         } else {
             if (Utils::checkIfStartsWith($userAgent, 'Mozilla/5')) {
                 $tolerance = Utils::ordinalIndexOf($userAgent, ';', 3);
             } elseif (Utils::checkIfStartsWith($userAgent, 'PlayBook')) {
                 $tolerance = Utils::firstCloseParen($userAgent);
             } else {
                 $tolerance = Utils::firstSlash($userAgent);
             }
         }
     }
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
Exemple #2
0
 public function testSecondSlash()
 {
     $this->assertEquals(9, Utils::secondSlash('Value/12/13'));
     $this->assertNull(Utils::secondSlash('Value/12'));
     $this->assertNull(Utils::secondSlash('Value'));
 }