X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Foexchange.php;h=79414a7f6a727f010edd7bb743369d8ccb2f8565;hb=c67452f72e34cfa94977dd8b6f4a8fdd09e79523;hp=1e7c9b23c9e412427fc225d8ce2bd29acabfb770;hpb=0c764684bb32a9432fd161e62db907efb78af1a5;p=friendica.git diff --git a/mod/oexchange.php b/mod/oexchange.php index 1e7c9b23c9..79414a7f6a 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -1,29 +1,33 @@ argc > 1) && ($a->argv[1] === 'xrd')) { +/** + * @file mod/oexchange.php + */ +use Friendica\App; +use Friendica\Core\L10n; +use Friendica\Core\System; +use Friendica\Module\Login; +use Friendica\Util\Network; + +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, ['$base' => System::baseUrl()]); echo $o; killme(); } - -} } -if(! function_exists('oexchange_content')) { -function oexchange_content(&$a) { +function oexchange_content(App $a) { - if(! local_user()) { - $o = login(false); + if (! local_user()) { + $o = Login::form(); return $o; } - if(($a->argc > 1) && $a->argv[1] === 'done') { - info( t('Post successful.') . EOL); + if (($a->argc > 1) && $a->argv[1] === 'done') { + info(L10n::t('Post successful.') . EOL); return; } @@ -36,14 +40,15 @@ 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 = Network::fetchURL(System::baseUrl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); - if(! strlen($s)) + if (! strlen($s)) { return; + } require_once('include/html2bbcode.php'); - $post = array(); + $post = []; $post['profile_uid'] = local_user(); $post['return'] = '/oexchange/done' ; @@ -54,4 +59,3 @@ function oexchange_content(&$a) { require_once('mod/item.php'); item_post($a); } -}