]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Debug/Babel.php
update the release date in the CHANGELOG file
[friendica.git] / src / Module / Debug / Babel.php
index f4a0fa1d9522f139189e3cd2740d4fb0eb0682f8..649c12cecdf5b6da8f65481933982154abd77048 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,13 +24,10 @@ namespace Friendica\Module\Debug;
 use Friendica\BaseModule;
 use Friendica\Content\PageInfo;
 use Friendica\Content\Text;
-use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\DI;
-use Friendica\Model\Conversation;
 use Friendica\Model\Item;
 use Friendica\Protocol\Activity;
-use Friendica\Model\Tag;
 use Friendica\Util\XML;
 
 /**
@@ -38,7 +35,7 @@ use Friendica\Util\XML;
  */
 class Babel extends BaseModule
 {
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                function visible_whitespace($s)
                {
@@ -183,9 +180,7 @@ class Babel extends BaseModule
                                                'content' => $html
                                        ];
 
-                                       $config = \HTMLPurifier_Config::createDefault();
-                                       $HTMLPurifier = new \HTMLPurifier($config);
-                                       $purified = $HTMLPurifier->purify($html);
+                                       $purified = Text\HTML::purify($html);
 
                                        $results[] = [
                                                'title'   => DI::l10n()->t('HTML Purified (raw)'),
@@ -306,6 +301,7 @@ class Babel extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate('babel.tpl');
                $o = Renderer::replaceMacros($tpl, [
+                       '$title'         => DI::l10n()->t('Babel Diagnostic'),
                        '$text'          => ['text', DI::l10n()->t('Source text'), $_REQUEST['text'] ?? '', ''],
                        '$type_bbcode'   => ['type', DI::l10n()->t('BBCode'), 'bbcode', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'bbcode'],
                        '$type_diaspora' => ['type', DI::l10n()->t('Diaspora'), 'diaspora', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'diaspora'],
@@ -313,7 +309,8 @@ class Babel extends BaseModule
                        '$type_html'     => ['type', DI::l10n()->t('HTML'), 'html', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'html'],
                        '$flag_twitter'  => file_exists('addon/twitter/twitter.php'),
                        '$type_twitter'  => ['type', DI::l10n()->t('Twitter Source / Tweet URL (requires API key)'), 'twitter', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'twitter'],
-                       '$results'       => $results
+                       '$results'       => $results,
+                       '$submit'        => DI::l10n()->t('Submit'),
                ]);
 
                return $o;