/**
  * Returns the HTTP referrer.
  *
  * 'referer' a commonly used misspelling word for 'referrer'
  * @see     http://en.wikipedia.org/wiki/HTTP_referrer
  *
  * @param   boolean     Only allow internal url's
  * @return  KHttpUrl    A KHttpUrl object
  */
 public static function referrer($isInternal = true)
 {
     if (!isset(self::$_referrer)) {
         if ($referrer = KRequest::get('server.HTTP_REFERER', 'url')) {
             self::$_referrer = KService::get('koowa:http.url', array('url' => $referrer));
         }
     }
     if ($isInternal) {
         if (!KService::get('koowa:filter.internalurl')->validate((string) self::$_referrer)) {
             return null;
         }
     }
     return self::$_referrer;
 }
示例#2
0
 /**
  * Returns the HTTP referrer.
  * 
  * 'referer' a commonly used misspelling word for 'referrer'
  * @see     http://en.wikipedia.org/wiki/HTTP_referrer
  *
  * @param   boolean     Only allow internal url's
  * @return  KHttpUri    A KHttpUri object
  */
 public static function referrer($isInternal = true)
 {
     if (!isset(self::$_referrer)) {
         if ($referrer = KRequest::get('server.HTTP_REFERER', 'url')) {
             self::$_referrer = KFactory::get('lib.koowa.http.uri', array('uri' => $referrer));
             if ($isInternal) {
                 if (!KFactory::get('lib.koowa.filter.internalurl')->validate((string) self::$_referrer)) {
                     return null;
                 }
             }
         }
     }
     return self::$_referrer;
 }