Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2022-08-09 00:54:52 +0300
committerGitHub <noreply@github.com>2022-08-09 00:54:52 +0300
commit48c458c830fd75ab8cc90489d5a31110ee6c36c9 (patch)
treebf54e410b4535e7aa5dc61205828b3c5537049d5
parent1ef548f5a28d08f741697fd012a3c988b3e5c8a0 (diff)
Removes unused method Proxy\Controller:isPiwikUrl() (#19610)
-rw-r--r--plugins/Proxy/Controller.php31
-rw-r--r--plugins/Proxy/tests/Unit/ProxyTest.php48
2 files changed, 0 insertions, 79 deletions
diff --git a/plugins/Proxy/Controller.php b/plugins/Proxy/Controller.php
index fe3c529196..7b0a60ec90 100644
--- a/plugins/Proxy/Controller.php
+++ b/plugins/Proxy/Controller.php
@@ -20,7 +20,6 @@ use Piwik\ProxyHttp;
*/
class Controller extends \Piwik\Plugin\Controller
{
- const TRANSPARENT_PNG_PIXEL = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=';
const JS_MIME_TYPE = "application/javascript; charset=UTF-8";
/**
@@ -83,34 +82,4 @@ class Controller extends \Piwik\Plugin\Controller
{
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, '&#59') !== 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;
- }
}
diff --git a/plugins/Proxy/tests/Unit/ProxyTest.php b/plugins/Proxy/tests/Unit/ProxyTest.php
deleted file mode 100644
index e4db54b303..0000000000
--- a/plugins/Proxy/tests/Unit/ProxyTest.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\Proxy\tests\Unit;
-
-use Piwik\Plugins\Proxy\Controller;
-
-/**
- * @group Proxy
- * @group ProxyTest
- * @group Plugins
- */
-class ProxyTest extends \PHPUnit\Framework\TestCase
-{
- public function getAcceptableRemoteUrls()
- {
- return array(
- // piwik white list (and used in homepage)
- array('http://piwik.org/', true),
-
- array('http://piwik.org', true),
- array('http://qa.piwik.org/', true),
- array('http://forum.piwik.org/', true),
- array('http://dev.piwik.org/', true),
- array('http://demo.piwik.org/', true),
-
- // not in the piwik white list
- array('http://www.piwik.org/', false),
- array('https://piwik.org/', false),
- array('http://example.org/', false),
- );
- }
-
- /**
- * @dataProvider getAcceptableRemoteUrls
- * @group Plugins
- */
- public function testIsAcceptableRemoteUrl($url, $expected)
- {
- $this->assertEquals($expected, Controller::isPiwikUrl($url));
- }
-}
-