diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2465d3ccd08..79bfd9c9886 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -136,7 +136,7 @@ function testSqlAndScriptInject($val, $type) $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database $inj += preg_match('/assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject expected 0c'); + $test='/user/perms.php?id=1&action=addrights&entity=1&rights=123&confirm=yes&token=123456789&updatedmodulename=lmscoursetracking'; + $result=testSqlAndScriptInject($test, 1); + print "test=".$test." result=".$result."\n"; + $this->assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject with a valid url'); + // Should detect attack $expectedresult=1;