PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
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 2 years ago HtmlReportEmailHeaderView.php 1 month ago MethodCallExpression.php 1 year ago OneClickDone.php 6 months ago RenderTokenParser.php 1 year ago SecurityPolicy.php 1 month ago UIControl.php 1 month ago ViewInterface.php 1 year ago
OneClickDone.php
91 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 */
9 namespace Piwik\View;
10
11 use Piwik\Common;
12 /**
13 * Post-update view
14 *
15 * During a Piwik software update, there will be instances of old classes
16 * loaded in memory. This is problematic as we will start to instantiate
17 * new classes which may not be backward compatible. This class provides
18 * a clean bridge/transition by forcing a new request.
19 *
20 * This class needs to be self-contained, with no external dependencies.
21 *
22 */
23 class OneClickDone
24 {
25 /**
26 * @var string
27 */
28 private $tokenAuth;
29 /**
30 * @var string
31 */
32 public $error = '';
33 /**
34 * @var array
35 */
36 public $feedbackMessages;
37 /**
38 * Did the download over HTTPS fail?
39 *
40 * @var bool
41 */
42 public $httpsFail = \false;
43 public function __construct(
44 #[\SensitiveParameter]
45 $tokenAuth)
46 {
47 $this->tokenAuth = $tokenAuth;
48 }
49 /**
50 * Outputs the data.
51 */
52 public function render()
53 {
54 // set response headers
55 @Common::stripHeader('Pragma');
56 @Common::stripHeader('Expires');
57 @Common::sendHeader('Content-Type: text/html; charset=UTF-8');
58 @Common::sendHeader('Cache-Control: no-store');
59 @Common::sendHeader('X-Frame-Options: deny');
60 $error = htmlspecialchars($this->error, \ENT_QUOTES, 'UTF-8');
61 $messages = htmlspecialchars(serialize($this->feedbackMessages), \ENT_QUOTES, 'UTF-8');
62 $tokenAuth = $this->tokenAuth;
63 $httpsFail = (int) $this->httpsFail;
64 // use a heredoc instead of an external file
65 echo <<<END_OF_TEMPLATE
66 <!DOCTYPE html>
67 <html>
68 <head>
69 <meta name="robots" content="noindex,nofollow">
70 <meta charset="utf-8">
71 <title></title>
72 </head>
73 <body>
74 <form name="myform" method="post" action="?module=CoreUpdater&amp;action=oneClickResults">
75 <input type="hidden" name="token_auth" value="{$tokenAuth}" />
76 <input type="hidden" name="error" value="{$error}" />
77 <input type="hidden" name="messages" value="{$messages}" />
78 <input type="hidden" name="httpsFail" value="{$httpsFail}" />
79 <noscript>
80 <button type="submit">Continue</button>
81 </noscript>
82 </form>
83 <script type="text/javascript">
84 document.myform.submit();
85 </script>
86 </body>
87 </html>
88 END_OF_TEMPLATE;
89 }
90 }
91