diff options
Diffstat (limited to 'plugins/Proxy')
-rw-r--r-- | plugins/Proxy/Controller.php | 67 | ||||
-rw-r--r-- | plugins/Proxy/Proxy.php | 3 | ||||
-rw-r--r-- | plugins/Proxy/templates/exportImageWindow.twig | 12 |
3 files changed, 2 insertions, 80 deletions
diff --git a/plugins/Proxy/Controller.php b/plugins/Proxy/Controller.php index f7f71bb8a8..9f49505e97 100644 --- a/plugins/Proxy/Controller.php +++ b/plugins/Proxy/Controller.php @@ -21,73 +21,6 @@ class Piwik_Proxy_Controller extends Piwik_Controller const TRANSPARENT_PNG_PIXEL = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII='; /** - * Display the "Export Image" window. - * - * @deprecated 1.5.1 - * - * @internal param string $imageData Base-64 encoded image data (via $_POST) - */ - static public function exportImageWindow() - { - Piwik::checkUserHasSomeViewAccess(); - - $view = new Piwik_View('@Proxy/exportImageWindow'); - $view->imageData = 'data:image/png;base64,' . Common::getRequestVar('imageData', self::TRANSPARENT_PNG_PIXEL, 'string', $_POST); - echo $view->render(); - } - - function exportImage() - { - self::exportImageWindow(); - } - - /** - * Output binary image from base-64 encoded data. - * - * @deprecated 1.5.1 - * - * @internal param string $imageData Base-64 encoded image data (via $_POST) - */ - static public function outputBinaryImage() - { - Piwik::checkUserHasSomeViewAccess(); - - $rawData = Common::getRequestVar('imageData', '', 'string', $_POST); - - // returns false if any illegal characters in input - $data = base64_decode($rawData); - if ($data !== false) { - // check for PNG header - if (Common::substr($data, 0, 8) === "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a") { - header('Content-Type: image/png'); - - // more robust validation (if available) - if (function_exists('imagecreatefromstring')) { - // validate image data - $imgResource = @imagecreatefromstring($data); - if ($imgResource !== false) { - // output image and clean-up - imagepng($imgResource); - imagedestroy($imgResource); - exit; - } - } else { - echo $data; - exit; - } - } - } - - Piwik::setHttpStatus('400 Bad Request'); - exit; - } - - function outputImage() - { - self::outputBinaryImage(); - } - - /** * Output the merged CSS file. * This method is called when the asset manager is enabled. * diff --git a/plugins/Proxy/Proxy.php b/plugins/Proxy/Proxy.php index c669215411..fc404bfd2e 100644 --- a/plugins/Proxy/Proxy.php +++ b/plugins/Proxy/Proxy.php @@ -8,13 +8,14 @@ * @category Piwik_Plugins * @package Piwik_Proxy */ +use Piwik\Plugin; /** * Proxy services for the UI * * @package Piwik_Proxy */ -class Piwik_Proxy extends Piwik_Plugin +class Piwik_Proxy extends Plugin { /** * Return information about this plugin. diff --git a/plugins/Proxy/templates/exportImageWindow.twig b/plugins/Proxy/templates/exportImageWindow.twig deleted file mode 100644 index 0145a6589f..0000000000 --- a/plugins/Proxy/templates/exportImageWindow.twig +++ /dev/null @@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <title>{{ 'General_ExportAsImage_js'|translate }}</title> -</head> -<body> -<img title="Piwik Graph" src="{{ imageData }}"/><br/><br/> - -<p>{{ 'General_SaveImageOnYourComputer_js'|translate }}</p> -</body> -</html> |