library/Garp/Controller/Helper/CanonicalUrl.php
public function validate($canonical) {
        $currUrl = $this->getRequest()->getRequestUri();
        // match using a full url if the canonical starts with a protocol
        if (preg_match('~^[a-z]+://~', $canonical)) {
            $isObj = $canonical instanceof Garp_Util_FullUrl;
            $omitProtocol = $isObj ? $canonical->getOmitProtocol() : false;
            $omitBaseUrl = $isObj ? $canonical->getOmitBaseUrl() : false;
            $currUrl = new Garp_Util_FullUrl($currUrl, $omitProtocol, $omitBaseUrl);
        }
        return (string)$currUrl == (string)$canonical;
    }
public function validate($canonical) {
        $currUrl = $this->getRequest()->getRequestUri();
        // match using a full url if the canonical starts with a protocol
        if (preg_match('~^[a-z]+://~', $canonical)) {
            $isObj = $canonical instanceof Garp_Util_FullUrl;
            $omitProtocol = $isObj ? $canonical->getOmitProtocol() : false;
            $omitBaseUrl = $isObj ? $canonical->getOmitBaseUrl() : false;
            $currUrl = new Garp_Util_FullUrl($currUrl, $omitProtocol, $omitBaseUrl);
        }
        return (string)$currUrl == (string)$canonical;
    }
public function validate ( $ canonical ) { $ currUrl = $ this -> getRequest ( ) -> getRequestUri ( ) ; // match using a full url if the canonical starts with a protocol if ( preg_match ( '~^[a-z]+://~' , $ canonical ) ) { $ isObj = $ canonical instanceof Garp_Util_FullUrl ; $ omitProtocol = $ isObj ? $ canonical -> getOmitProtocol ( ) : false ; $ omitBaseUrl = $ isObj ? $ canonical -> getOmitBaseUrl ( ) : false ; $ currUrl = new Garp_Util_FullUrl ( $ currUrl , $ omitProtocol , $ omitBaseUrl ) ; } return ( string ) $ currUrl == ( string ) $ canonical ; }
Validate wether the supposed canonical url is actually the current request url
@param String $canonical
@return Boolean
Validate wether the supposed canonical url is actually the current request url