getMergedStylesheet(); } catch (StylesheetLessCompileException $exception) { $cssMergedFile = AssetManager::getInstance()->getMergedStylesheet(); } ProxyHttp::serverStaticFile($cssMergedFile->getAbsoluteLocation(), "text/css"); } /** * Output the merged core JavaScript file. * This method is called when the asset manager is enabled. * * @see core/AssetManager.php */ public function getCoreJs() { $jsMergedFile = AssetManager::getInstance()->getMergedCoreJavaScript(); $this->serveJsFile($jsMergedFile); } /** * Output the merged non core JavaScript file. * This method is called when the asset manager is enabled. * * @see core/AssetManager.php */ public function getNonCoreJs() { $jsMergedFile = AssetManager::getInstance()->getMergedNonCoreJavaScript(); $this->serveJsFile($jsMergedFile); } /** * Output a UMD merged chunk JavaScript file. * This method is called when the asset manager is enabled. * * @see core/AssetManager.php */ public function getUmdJs() { $chunk = Common::getRequestVar('chunk'); $chunkFile = AssetManager::getInstance()->getMergedJavaScriptChunk($chunk); $this->serveJsFile($chunkFile); } /** * @param UIAsset $uiAsset */ private function serveJsFile($uiAsset) { ProxyHttp::serverStaticFile($uiAsset->getAbsoluteLocation(), self::JS_MIME_TYPE); } /** * Validate URL against *.piwik.org domains * * @param string $url * @return bool True if valid; false otherwise */ public static function isPiwikUrl($url) { // guard for IE6 meta refresh parsing weakness (OSVDB 19029) if (strpos($url, ';') !== false || strpos($url, ';') !== false ) { return false; } if (preg_match('~^http://(qa\.|demo\.|dev\.|forum\.)?piwik.org([#?/]|$)~', $url)) { return true; } if (preg_match('~^http://(qa\.|demo\.|dev\.|forum\.)?matomo.org([#?/]|$)~', $url)) { return true; } // Allow clockworksms domain if (strpos($url, 'http://www.clockworksms.com/') === 0) { return true; } return false; } }