From 09e1412dcd0e142c760eb5447af254a817b7b056 Mon Sep 17 00:00:00 2001 From: dizzy Date: Wed, 30 Mar 2022 11:31:05 -0700 Subject: [Vue] standardize use of v-html with ReleaseChecklistTest (#19020) * modify v-html use * exclude node_modules from watch command * force use of $sanitize w/ v-html through test + replace existing missing uses * update tagmanager submodule * remove accidental git add Co-authored-by: sgiehl --- tests/PHPUnit/Integration/ReleaseCheckListTest.php | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/PHPUnit/Integration') diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php index 22373832d9..7994026a63 100644 --- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php @@ -696,6 +696,31 @@ class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase . implode(', ', $filesThatDoNotExist)); } + public function test_noVueHtmlWithoutSanitize() + { + $command = 'grep -r "v-html=" ' . PIWIK_INCLUDE_PATH . '/plugins --include=*.vue | grep -v "v-html=[\'\\"]\\$sanitize"'; + $output = shell_exec($command); + + $errorMessage = ""; + if (!empty($output)) { + $lines = explode("\n", $output); + + $files = []; + foreach ($lines as $line) { + if (empty(trim($line))) { + continue; + } + + list($file, $match) = explode(':', $line); + $files[] = '- ' . trim($file); + } + + $errorMessage = "Found uses of v-html without \$sanitize:\n" . implode("\n", $files); + } + + $this->assertEmpty($output, $errorMessage); + } + /** * @param $file * @return bool -- cgit v1.2.3