You can access the page at: ' . $url);
}
// mask visits to *.piwik.org
if (!self::isPiwikUrl($url)) {
Piwik::checkUserHasSomeViewAccess();
}
if (!Common::isLookLikeUrl($url)) {
die('Please check the &url= parameter: it should to be a valid URL');
}
@header('Content-Type: text/html; charset=utf-8');
echo '';
exit;
}
/**
* Validate URL against *.piwik.org domains
*
* @param string $url
* @return bool True if valid; false otherwise
*/
static public 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;
}
// Allow clockworksms domain
if (strpos($url, 'http://www.clockworksms.com/') === 0) {
return true;
}
return false;
}
}