aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter/s9e
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2017-01-07 00:16:45 +0100
committerMarc Alexander <admin@m-a-styles.de>2017-01-07 00:16:45 +0100
commit7074876f3298df301bad89c1a55c4265aad4c710 (patch)
treec0791ce965d13da2916116f55f55f27540ebea8d /phpBB/phpbb/textformatter/s9e
parent166320ef9edd0f8c5e6ddaee35f05741c274eb4e (diff)
parent538f03efb058c84daf3e677a3137be8900678f2b (diff)
downloadforums-7074876f3298df301bad89c1a55c4265aad4c710.tar
forums-7074876f3298df301bad89c1a55c4265aad4c710.tar.gz
forums-7074876f3298df301bad89c1a55c4265aad4c710.tar.bz2
forums-7074876f3298df301bad89c1a55c4265aad4c710.tar.xz
forums-7074876f3298df301bad89c1a55c4265aad4c710.zip
Merge pull request #4619 from Nicofuma/ticket/14962
[ticket/14962] Introduces a new helper to check emptyness of bbcode texts
Diffstat (limited to 'phpBB/phpbb/textformatter/s9e')
-rw-r--r--phpBB/phpbb/textformatter/s9e/utils.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php
index b317fe4a8d..a9a6d4b892 100644
--- a/phpBB/phpbb/textformatter/s9e/utils.php
+++ b/phpBB/phpbb/textformatter/s9e/utils.php
@@ -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)) === '';
+ }
}