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:
authorMatthieu Aubry <mattab@users.noreply.github.com>2021-06-17 22:50:10 +0300
committerGitHub <noreply@github.com>2021-06-17 22:50:10 +0300
commit216aa653a891ece5078437698fb1982b25d2c584 (patch)
tree7052a5c8fe8a137ef320299cd22a503bfa05e113 /plugins/Diagnostics
parenta35e6c981ea14f83260ebeb7bf09e74a1b7825ee (diff)
Add link to new FAQ how to make the diagnostic “Managing processes via CLI” show Ok (#17527)
* Add link to new FAQ how to make the diagnostic “Managing processes via CLI” show Ok NOTE: Had to add the |raw to the item.comment, which may have security risks if some of the "Informational" diagnostics will contain random content that may be injected by someone. Maybe we should audit all informational diagnostics. The new FAQ is: https://matomo.org/faq/troubleshooting/how-to-make-the-diagnostic-managing-processes-via-cli-to-display-ok/ * Ensure possible user input is escaped in information diagnosic items Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Diagnostics')
-rw-r--r--plugins/Diagnostics/Diagnostic/CronArchivingCheck.php3
-rw-r--r--plugins/Diagnostics/Diagnostic/DiagnosticResult.php15
2 files changed, 12 insertions, 6 deletions
diff --git a/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php b/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php
index 25581f3a8f..ad2520377c 100644
--- a/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php
+++ b/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php
@@ -77,7 +77,8 @@ class CronArchivingCheck implements Diagnostic
}
$comment .= $this->translator->translate('Installation_NotSupported')
. ' ' . $this->translator->translate('Goals_Optional')
- . ' (' . $this->translator->translate('General_Reasons') . ': ' . $reasonText . ')';
+ . ' (' . $this->translator->translate('General_Reasons') . ': ' . $reasonText . ')'
+ . $this->translator->translate('General_LearnMore', [' <a target="_blank" href="https://matomo.org/faq/troubleshooting/how-to-make-the-diagnostic-managing-processes-via-cli-to-display-ok/">', '</a>']);
$status = DiagnosticResult::STATUS_INFORMATIONAL;
}
diff --git a/plugins/Diagnostics/Diagnostic/DiagnosticResult.php b/plugins/Diagnostics/Diagnostic/DiagnosticResult.php
index f95407d40a..d0e1381ce1 100644
--- a/plugins/Diagnostics/Diagnostic/DiagnosticResult.php
+++ b/plugins/Diagnostics/Diagnostic/DiagnosticResult.php
@@ -8,6 +8,8 @@
namespace Piwik\Plugins\Diagnostics\Diagnostic;
+use Piwik\Common;
+
/**
* The result of a diagnostic.
*
@@ -55,20 +57,23 @@ class DiagnosticResult
/**
* @param string $label
- * @param string $status
* @param string $comment
+ * @param bool $escapeComment
* @return DiagnosticResult
*/
- public static function informationalResult($label, $comment = '')
+ public static function informationalResult($label, $comment = '', $escapeComment = true)
{
if ($comment === true) {
$comment = '1';
} elseif ($comment === false) {
$comment = '0';
}
- $result = new self($label);
- $result->addItem(new DiagnosticResultItem(self::STATUS_INFORMATIONAL, $comment));
- return $result;
+
+ if ($escapeComment) {
+ $comment = Common::sanitizeInputValue($comment);
+ }
+
+ return self::singleResult($label, self::STATUS_INFORMATIONAL, $comment);
}
/**