Exemple #1
0
 /**
  * 
  * @staticvar string $sUriBase
  * @staticvar string $sUriPath
  * @param type $sUrl
  * @return boolean
  */
 protected function prepareExtensionValues($sUrl, $bReturn = TRUE)
 {
     if ($bReturn) {
         return $sUrl;
     }
     static $sHost = '';
     $oUri = JchPlatformUri::getInstance();
     $sHost = $sHost == '' ? $oUri->toString(array('host')) : $sHost;
     $result = preg_match('#^(?:https?:)?//([^/]+)#', $sUrl, $m1);
     $sExtension = isset($m1[1]) ? $m1[1] : '';
     if ($result === 0 || $sExtension == $sHost) {
         $result2 = preg_match('#' . JchPlatformExcludes::extensions() . '([^/]+)#', $sUrl, $m);
         if ($result2 === 0) {
             return FALSE;
         } else {
             $sExtension = $m[1];
         }
     }
     return $sExtension;
 }
Exemple #2
0
 /**
  * 
  * @param type $sPath
  */
 protected function excludeExternalExtensions($sPath)
 {
     if (!$this->params->get('includeAllExtensions', '0')) {
         return !JchOptimizeHelper::isInternal($sPath) || preg_match('#' . JchPlatformExcludes::extensions() . '#i', $sPath);
     }
     return FALSE;
 }