aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-03-23 21:34:49 +0100
committerJoshyPHP <s9e.dev@gmail.com>2015-04-02 19:16:04 +0200
commit37fedc656fbdeb36b098375201042eed4c7e7229 (patch)
tree16ad1ad23c38c89801ac8a1c09bc305e8b0844c4 /phpBB/phpbb/textformatter
parent5b2d3fddfda75bcc212c8b9c88ab0d9ccc28b1d5 (diff)
downloadforums-37fedc656fbdeb36b098375201042eed4c7e7229.tar
forums-37fedc656fbdeb36b098375201042eed4c7e7229.tar.gz
forums-37fedc656fbdeb36b098375201042eed4c7e7229.tar.bz2
forums-37fedc656fbdeb36b098375201042eed4c7e7229.tar.xz
forums-37fedc656fbdeb36b098375201042eed4c7e7229.zip
[ticket/11768] Updated the text_formatter.s9e.utils service
Made it use s9e\TextFormatter\Utils. Refactored some tests to make them more readable. PHPBB3-11768
Diffstat (limited to 'phpBB/phpbb/textformatter')
-rw-r--r--phpBB/phpbb/textformatter/s9e/utils.php17
1 files changed, 3 insertions, 14 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php
index df4ae4b9ec..29dcfcdf58 100644
--- a/phpBB/phpbb/textformatter/s9e/utils.php
+++ b/phpBB/phpbb/textformatter/s9e/utils.php
@@ -26,7 +26,7 @@ class utils implements \phpbb\textformatter\utils_interface
// Insert a space before <s> and <e> then remove formatting
$text = preg_replace('#<[es]>#', ' $0', $text);
- return \s9e\TextFormatter\Unparser::removeFormatting($text);
+ return \s9e\TextFormatter\Utils::removeFormatting($text);
}
/**
@@ -34,18 +34,7 @@ class utils implements \phpbb\textformatter\utils_interface
*/
public function remove_bbcode($text, $bbcode_name, $depth = 0)
{
- $dom = new \DOMDocument;
- $dom->loadXML($text);
-
- $xpath = new \DOMXPath($dom);
- $nodes = $xpath->query(str_repeat('//' . strtoupper($bbcode_name), 1 + $depth));
-
- foreach ($nodes as $node)
- {
- $node->parentNode->removeChild($node);
- }
-
- return $dom->saveXML($dom->documentElement);
+ return \s9e\TextFormatter\Utils::removeTag($text, strtoupper($bbcode_name), $depth);
}
/**
@@ -53,7 +42,7 @@ class utils implements \phpbb\textformatter\utils_interface
*/
public function remove_formatting($text)
{
- return \s9e\TextFormatter\Unparser::removeFormatting($text);
+ return \s9e\TextFormatter\Utils::removeFormatting($text);
}
/**