X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Foexchange.php;h=49c5d01f4504fb33e4f6d40186b2f87f0529149b;hb=54905a3d81065915418af7f96953f957bf795300;hp=1e7c9b23c9e412427fc225d8ce2bd29acabfb770;hpb=0c764684bb32a9432fd161e62db907efb78af1a5;p=friendica.git diff --git a/mod/oexchange.php b/mod/oexchange.php index 1e7c9b23c9..49c5d01f45 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -1,42 +1,41 @@ argc > 1) && ($a->argv[1] === 'xrd')) { $tpl = get_markup_template('oexchange_xrd.tpl'); - $o = replace_macros($tpl, array('$base' => $a->get_baseurl())); + $o = replace_macros($tpl, array('$base' => App::get_baseurl())); echo $o; killme(); } -} + } -if(! function_exists('oexchange_content')) { -function oexchange_content(&$a) { +function oexchange_content(App &$a) { - if(! local_user()) { + if (! local_user()) { $o = login(false); return $o; } - if(($a->argc > 1) && $a->argv[1] === 'done') { + if (($a->argc > 1) && $a->argv[1] === 'done') { info( t('Post successful.') . EOL); return; } - $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url'])) + $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url'])) ? urlencode(notags(trim($_REQUEST['url']))) : ''); - $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title'])) + $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title'])) ? '&title=' . urlencode(notags(trim($_REQUEST['title']))) : ''); - $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description'])) + $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description'])) ? '&description=' . urlencode(notags(trim($_REQUEST['description']))) : ''); - $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags'])) + $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags'])) ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : ''); - $s = fetch_url($a->get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); + $s = fetch_url(App::get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); if(! strlen($s)) return; @@ -53,5 +52,7 @@ function oexchange_content(&$a) { $_REQUEST = $post; require_once('mod/item.php'); item_post($a); + } -} + +