forked from Wavyzz/dolibarr
Merge pull request #24162 from atm-lena/17.0_FIX_textishtmlfunction
FIX dol_textishtml() function
This commit is contained in:
@@ -7485,7 +7485,7 @@ function dol_textishtml($msg, $option = 0)
|
||||
return true;
|
||||
} elseif (preg_match('/<\/textarea/i', $msg)) {
|
||||
return true;
|
||||
} elseif (preg_match('/<(b|em|i|u)>/i', $msg)) {
|
||||
} elseif (preg_match('/<(b|em|i|u)(\s+[^>]+)?>/i', $msg)) {
|
||||
return true;
|
||||
} elseif (preg_match('/<br/i', $msg)) {
|
||||
return true;
|
||||
@@ -7500,7 +7500,7 @@ function dol_textishtml($msg, $option = 0)
|
||||
return true;
|
||||
} elseif (preg_match('/<\/textarea/i', $msg)) {
|
||||
return true;
|
||||
} elseif (preg_match('/<(b|em|i|u)>/i', $msg)) {
|
||||
} elseif (preg_match('/<(b|em|i|u)(\s+[^>]+)?>/i', $msg)) {
|
||||
return true;
|
||||
} elseif (preg_match('/<br\/>/i', $msg)) {
|
||||
return true;
|
||||
|
||||
@@ -580,6 +580,9 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
|
||||
$input='This is a text with accent é';
|
||||
$after=dol_textishtml($input);
|
||||
$this->assertTrue($after, 'Test with a é');
|
||||
$input='<i class="abc">xxx</i>';
|
||||
$after=dol_textishtml($input);
|
||||
$this->assertTrue($after, 'Test with i tag and class;');
|
||||
|
||||
// False
|
||||
$input='xxx < br>';
|
||||
|
||||
Reference in New Issue
Block a user