PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 1.3.1
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v1.3.1
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / View / OneClickDone.php
matomo / app / core / View Last commit date
HtmlEmailFooterView.php 6 years ago HtmlReportEmailHeaderView.php 6 years ago OneClickDone.php 6 years ago RenderTokenParser.php 6 years ago UIControl.php 6 years ago ViewInterface.php 6 years ago
OneClickDone.php
100 lines
1 <?php
2 /**
3 * Piwik - free/libre analytics platform
4 *
5 * @link https://matomo.org
6 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7 *
8 */
9
10 namespace Piwik\View;
11
12 use Piwik\Common;
13
14 /**
15 * Post-update view
16 *
17 * During a Piwik software update, there will be instances of old classes
18 * loaded in memory. This is problematic as we will start to instantiate
19 * new classes which may not be backward compatible. This class provides
20 * a clean bridge/transition by forcing a new request.
21 *
22 * This class needs to be self-contained, with no external dependencies.
23 *
24 */
25 class OneClickDone
26 {
27 /**
28 * @var string
29 */
30 private $tokenAuth;
31
32 /**
33 * @var string
34 */
35 public $error;
36
37 /**
38 * @var array
39 */
40 public $feedbackMessages;
41
42 /**
43 * Did the download over HTTPS fail?
44 *
45 * @var bool
46 */
47 public $httpsFail = false;
48
49 public function __construct($tokenAuth)
50 {
51 $this->tokenAuth = $tokenAuth;
52 }
53
54 /**
55 * Outputs the data.
56 *
57 * @return string html
58 */
59 public function render()
60 {
61 // set response headers
62 @Common::stripHeader('Pragma');
63 @Common::stripHeader('Expires');
64 @Common::sendHeader('Content-Type: text/html; charset=UTF-8');
65 @Common::sendHeader('Cache-Control: must-revalidate');
66 @Common::sendHeader('X-Frame-Options: deny');
67
68 $error = htmlspecialchars($this->error, ENT_QUOTES, 'UTF-8');
69 $messages = htmlspecialchars(serialize($this->feedbackMessages), ENT_QUOTES, 'UTF-8');
70 $tokenAuth = $this->tokenAuth;
71 $httpsFail = (int) $this->httpsFail;
72
73 // use a heredoc instead of an external file
74 echo <<<END_OF_TEMPLATE
75 <!DOCTYPE html>
76 <html>
77 <head>
78 <meta name="robots" content="noindex,nofollow">
79 <meta charset="utf-8">
80 <title></title>
81 </head>
82 <body>
83 <form name="myform" method="post" action="?module=CoreUpdater&amp;action=oneClickResults">
84 <input type="hidden" name="token_auth" value="$tokenAuth" />
85 <input type="hidden" name="error" value="$error" />
86 <input type="hidden" name="messages" value="$messages" />
87 <input type="hidden" name="httpsFail" value="$httpsFail" />
88 <noscript>
89 <button type="submit">Continue</button>
90 </noscript>
91 </form>
92 <script type="text/javascript">
93 document.myform.submit();
94 </script>
95 </body>
96 </html>
97 END_OF_TEMPLATE;
98 }
99 }
100