X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Foexchange.php;h=930caac7e459f2e2a19aa92d46d4fe2266780c7d;hb=6161ceff649fd52cb6cdfe14ebe5fdd35f6854a9;hp=1e7c9b23c9e412427fc225d8ce2bd29acabfb770;hpb=9330a6994c1b9aee49a482efe32e84ca1a944c9b;p=friendica.git diff --git a/mod/oexchange.php b/mod/oexchange.php index 1e7c9b23c9..930caac7e4 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -1,28 +1,26 @@ argc > 1) && ($a->argv[1] === 'xrd')) { +function oexchange_init(App $a) { + + if (($a->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; } @@ -36,10 +34,11 @@ function oexchange_content(&$a) { $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)) + if (! strlen($s)) { return; + } require_once('include/html2bbcode.php'); @@ -54,4 +53,3 @@ function oexchange_content(&$a) { require_once('mod/item.php'); item_post($a); } -}