This escaping is not used anywhere
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
aad5bd7d22
commit
a2f13a8cd2
@ -472,7 +472,7 @@ class Message implements Stringable
|
||||
*/
|
||||
public static function decodeBB(string $message): string
|
||||
{
|
||||
return Sanitize::sanitizeMessage($message, false, true);
|
||||
return Sanitize::sanitizeMessage($message, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -165,10 +165,9 @@ class Sanitize
|
||||
* <a title="<?php echo Sanitize::sanitizeMessage($foo, true); ?>">bar</a>
|
||||
*
|
||||
* @param string $message the message
|
||||
* @param bool $escape whether to escape html in result
|
||||
* @param bool $safe whether string is safe (can keep < and > chars)
|
||||
*/
|
||||
public static function sanitizeMessage(string $message, bool $escape = false, bool $safe = false): string
|
||||
public static function sanitizeMessage(string $message, bool $safe = false): string
|
||||
{
|
||||
if (! $safe) {
|
||||
$message = strtr($message, ['<' => '<', '>' => '>']);
|
||||
@ -220,11 +219,6 @@ class Sanitize
|
||||
$message,
|
||||
);
|
||||
|
||||
/* Possibly escape result */
|
||||
if ($escape) {
|
||||
return htmlspecialchars($message);
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
|
||||
@ -139,17 +139,6 @@ class SanitizeTest extends AbstractTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests output escaping.
|
||||
*/
|
||||
public function testEscape(): void
|
||||
{
|
||||
$this->assertEquals(
|
||||
'<strong>strong</strong>',
|
||||
Sanitize::sanitizeMessage('[strong]strong[/strong]', true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for Sanitize::sanitizeFilename
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user