Move /parse_url module to /parseurl

- Update oexchange module to use BBCode::embedURL instead of a self-request
- Remove mod/parse_url.php file
- Restrict ParseUrl module to authenticated users
This commit is contained in:
Hypolite Petovan 2021-02-16 10:20:51 -05:00
commit 3859b7ba10
12 changed files with 148 additions and 204 deletions

View file

@ -47,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 = DI::httpRequest()->fetch(DI::baseUrl() . '/parse_url?url=' . $url . $title . $description . $tags);
$s = \Friendica\Content\Text\BBCode::embedURL($url, true, $title, $description, $tags);
if (!strlen($s)) {
return;