mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
[ticket/14962] Introduces a new helper to check emptyness of bbcode texts
PHPBB3-14962
This commit is contained in:
@@ -136,4 +136,17 @@ class utils implements \phpbb\textformatter\utils_interface
|
||||
{
|
||||
return \s9e\TextFormatter\Unparser::unparse($xml);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_empty($text)
|
||||
{
|
||||
if ($text === null || $text === '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return trim($this->unparse($text)) === '';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user