diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 99a66a9a682..b1129dcfb4f 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -5786,8 +5786,8 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
// Example of $temp: 0000-021
$temp = preg_replace($pattern, "", $temp); // pass 1 - $temp after pass 1: 0000-021
$temp = preg_replace($pattern, "", $temp); // pass 2 - $temp after pass 2: 0000-021
- // removed '<' into non closing html tags like 'id < 10 ? round($object->id / 2, 2) : (2 * $user->id) * (int) substr($mysoc->zip, 1, 2)) : \'objnotdefined\'';
$_POST["param10"]='is_object($object) ? ($object->id < 10 ? round($object->id / 2, 2) : (2 * $user->id) * (int) substr($mysoc->zip, 1, 2)) : \'objnotdefined\'';
$_POST["param11"]=' Name ';
@@ -371,6 +373,14 @@ class SecurityTest extends PHPUnit\Framework\TestCase
print __METHOD__." result=".$result."\n";
$this->assertEquals($_POST['param8c'], $result, 'Test a string with non closing html tag with alphanohtml');
+ $result=GETPOST("param8d", 'alphanohtml');
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals('abc123 is html to clean', $result, 'Test a string with non closing html tag with alphanohtml');
+
+ $result=GETPOST("param8e", 'alphanohtml');
+ print __METHOD__." result=".$result."\n";
+ $this->assertEquals($_POST['param8e'], $result, 'Test a string with non closing html tag with alphanohtml');
+
$result=GETPOST("param9", 'alphanohtml');
print __METHOD__." result=".$result."\n";
$this->assertEquals($_POST["param9"], $result);