]> git.mxchange.org Git - friendica.git/blobdiff - mod/oexchange.php
Move HTML purification to own method in Content\Text\HTML
[friendica.git] / mod / oexchange.php
index 6a05d4994461cb3e7e30075682e9363f9163ce33..e3ef01cc4d5193d9341d377f66743fa2c5a44e90 100644 (file)
@@ -23,7 +23,6 @@ use Friendica\App;
 use Friendica\Core\Renderer;
 use Friendica\DI;
 use Friendica\Module\Security\Login;
-use Friendica\Util\Network;
 use Friendica\Util\Strings;
 
 function oexchange_init(App $a) {
@@ -48,16 +47,12 @@ function oexchange_content(App $a) {
                return;
        }
 
-       $url = ((!empty($_REQUEST['url']))
-               ? urlencode(Strings::escapeTags(trim($_REQUEST['url']))) : '');
-       $title = ((!empty($_REQUEST['title']))
-               ? '&title=' . urlencode(Strings::escapeTags(trim($_REQUEST['title']))) : '');
-       $description = ((!empty($_REQUEST['description']))
-               ? '&description=' . urlencode(Strings::escapeTags(trim($_REQUEST['description']))) : '');
-       $tags = ((!empty($_REQUEST['tags']))
-               ? '&tags=' . urlencode(Strings::escapeTags(trim($_REQUEST['tags']))) : '');
+       $url         = !empty($_REQUEST['url'])         ? trim($_REQUEST['url'])         : '';
+       $title       = !empty($_REQUEST['title'])       ? trim($_REQUEST['title'])       : '';
+       $description = !empty($_REQUEST['description']) ? trim($_REQUEST['description']) : '';
+       $tags        = !empty($_REQUEST['tags'])        ? trim($_REQUEST['tags'])        : '';
 
-       $s = Network::fetchUrl(DI::baseUrl() . '/parse_url?url=' . $url . $title . $description . $tags);
+       $s = \Friendica\Content\Text\BBCode::embedURL($url, true, $title, $description, $tags);
 
        if (!strlen($s)) {
                return;