diff --git a/src/Plugin/monitoring/SensorPlugin/PhpNoticesSensorPlugin.php b/src/Plugin/monitoring/SensorPlugin/PhpNoticesSensorPlugin.php index fcac317..ad58a60 100644 --- a/src/Plugin/monitoring/SensorPlugin/PhpNoticesSensorPlugin.php +++ b/src/Plugin/monitoring/SensorPlugin/PhpNoticesSensorPlugin.php @@ -43,12 +43,11 @@ class PhpNoticesSensorPlugin extends WatchdogAggregatorSensorPlugin { $variables = unserialize($this->fetchedObject->variables); $variables['%file'] = $this->shortenFilename($variables['%file']); foreach ($variables as $key => $value) { - $variables['!' . substr($key, 1)] = $variables[$key]; - if (substr($key, 0, 1) === '%') { - unset($variables[$key]); - } + // Remove the sanitation key from the variables array. + $variables[substr($key, 1)] = $variables[$key]; + unset($variables[$key]); } - $result->setMessage('@count times: @error', ['@count' => (int) $this->fetchedObject->records_count, '@error' => SafeMarkup::format('!type: !message in !function (line !line of !file).', $variables)]); + $result->setMessage('@count times: @error', ['@count' => (int) $this->fetchedObject->records_count, '@error' => SafeMarkup::format('type: message in function (Line line of file).', $variables)]); }; }