From c4a24197a7dda0a7a2ae108461f3478e4d210d44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Aug 2022 23:03:42 +0200 Subject: [PATCH] Add phpunit for MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT --- test/phpunit/SecurityTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 0b77e613008..cc43d6c3a31 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -604,6 +604,13 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('x3aalert(1)', $result, 'Test for backtopage param'); + + $conf->global->MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT = 3; + $_POST["pagecontentwithlinks"]=''; + $result=GETPOST("pagecontentwithlinks", 'restricthtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('TooManyLinksIntoHTMLString', $result, 'Test on limit on GETPOST fails'); + return $result; }