diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-02 00:11:33 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-02 00:11:50 +0300 |
commit | 10bc3c86e959b6b3f11bf39e8367a2ff230b917e (patch) | |
tree | a1dea6878b6fc249cd6e41750519cef7681aed60 /plugins/Monolog/Processor | |
parent | 063f8c321fa4e76d156afc637cd0d8640dcffa62 (diff) |
#7301 Removes any token_auth that might be logged.
Diffstat (limited to 'plugins/Monolog/Processor')
-rw-r--r-- | plugins/Monolog/Processor/TokenProcessor.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/Monolog/Processor/TokenProcessor.php b/plugins/Monolog/Processor/TokenProcessor.php new file mode 100644 index 0000000000..0fd54892fc --- /dev/null +++ b/plugins/Monolog/Processor/TokenProcessor.php @@ -0,0 +1,24 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik\Plugins\Monolog\Processor; + +/** + * Removes any token_auth that might appear in the logs. + * + * Ideally the token_auth should never be logged, but... + */ +class TokenProcessor +{ + public function __invoke(array $record) + { + $record['message'] = preg_replace('/token_auth=[0-9a-h]+/', 'token_auth=removed', $record['message']); + + return $record; + } +} |