protected function checkBrowserSafari()
    {
        $version = '';

        //Check for current versions of Safari
        $found = $this->checkBrowserUAWithVersion(array('Safari', 'AppleWebKit'), $this->_agent, self::BROWSER_SAFARI);
        if ($found && $this->getVersion() != self::VERSION_UNKNOWN) {
            $version = $this->getVersion();
        }

        //Safari 1-2 didn't had a "Version" string in the UA, only a WebKit build and/or Safari build, extract version from these...
        if (!$found || $version == '') {
            if (preg_match('/.*Safari[ (\/]*([a-z0-9.-]*)/i', $this->_agent, $matches)) {
                $version = $this->safariBuildToSafariVer($matches[1]);
                $found = true;
            }
        }
        if (!$found || $version == '') {
            if (preg_match('/.*AppleWebKit[ (\/]*([a-z0-9.-]*)/i', $this->_agent, $matches)) {
                $version = $this->webKitBuildToSafariVer($matches[1]);
                $found = true;
            }
        }

        if ($found) {
            $this->setBrowser(self::BROWSER_SAFARI);
            $this->setVersion($version);
            $this->setMobile(false);
            $this->setRobot(false);
        }

        return $found;
    }
protected function checkBrowserSafari()
    {
        $version = '';

        //Check for current versions of Safari
        $found = $this->checkBrowserUAWithVersion(array('Safari', 'AppleWebKit'), $this->_agent, self::BROWSER_SAFARI);
        if ($found && $this->getVersion() != self::VERSION_UNKNOWN) {
            $version = $this->getVersion();
        }

        //Safari 1-2 didn't had a "Version" string in the UA, only a WebKit build and/or Safari build, extract version from these...
        if (!$found || $version == '') {
            if (preg_match('/.*Safari[ (\/]*([a-z0-9.-]*)/i', $this->_agent, $matches)) {
                $version = $this->safariBuildToSafariVer($matches[1]);
                $found = true;
            }
        }
        if (!$found || $version == '') {
            if (preg_match('/.*AppleWebKit[ (\/]*([a-z0-9.-]*)/i', $this->_agent, $matches)) {
                $version = $this->webKitBuildToSafariVer($matches[1]);
                $found = true;
            }
        }

        if ($found) {
            $this->setBrowser(self::BROWSER_SAFARI);
            $this->setVersion($version);
            $this->setMobile(false);
            $this->setRobot(false);
        }

        return $found;
    }
protected function checkBrowserSafari ( ) { $ version = '' ; //Check for current versions of Safari $ found = $ this -> checkBrowserUAWithVersion ( array ( 'Safari' , 'AppleWebKit' ) , $ this -> _agent , self :: BROWSER_SAFARI ) ; if ( $ found && $ this -> getVersion ( ) != self :: VERSION_UNKNOWN ) { $ version = $ this -> getVersion ( ) ; } //Safari 1-2 didn't had a "Version" string in the UA, only a WebKit build and/or Safari build, extract version from these... if ( ! $ found || $ version == '' ) { if ( preg_match ( '/.*Safari[ (\/]*([a-z0-9.-]*)/i' , $ this -> _agent , $ matches ) ) { $ version = $ this -> safariBuildToSafariVer ( $ matches [ 1 ] ) ; $ found = true ; } } if ( ! $ found || $ version == '' ) { if ( preg_match ( '/.*AppleWebKit[ (\/]*([a-z0-9.-]*)/i' , $ this -> _agent , $ matches ) ) { $ version = $ this -> webKitBuildToSafariVer ( $ matches [ 1 ] ) ; $ found = true ; } } if ( $ found ) { $ this -> setBrowser ( self :: BROWSER_SAFARI ) ; $ this -> setVersion ( $ version ) ; $ this -> setMobile ( false ) ; $ this -> setRobot ( false ) ; } return $ found ; }
Determine if the browser is Safari or not.
@access protected
@link http://www.apple.com/safari/
@link http://web.archive.org/web/20080514173941/http://developer.apple.com/internet/safari/uamatrix.html
@link http://en.wikipedia.org/wiki/Safari_version_history#Release_history
@return boolean Returns true if the browser is Safari, false otherwise.
Determine if the browser is Safari or not .