X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Foexchange.php;h=49c5d01f4504fb33e4f6d40186b2f87f0529149b;hb=54905a3d81065915418af7f96953f957bf795300;hp=53dce6446a2cbdaf722eb194f4390762e6c04c1e;hpb=f681535ccfd09efa3d1ec1a88fe12583bc3ad225;p=friendica.git diff --git a/mod/oexchange.php b/mod/oexchange.php index 53dce6446a..49c5d01f45 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -1,43 +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(); } - - } -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($_GET,'url')) && strlen($_GET['url'])) - ? urlencode(notags(trim($_GET['url']))) : ''); - $title = (((x($_GET,'title')) && strlen($_GET['title'])) - ? '&title=' . urlencode(notags(trim($_GET['title']))) : ''); - $description = (((x($_GET,'description')) && strlen($_GET['description'])) - ? '&description=' . urlencode(notags(trim($_GET['description']))) : ''); - $tags = (((x($_GET,'tags')) && strlen($_GET['tags'])) - ? '&tags=' . urlencode(notags(trim($_GET['tags']))) : ''); + $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url'])) + ? urlencode(notags(trim($_REQUEST['url']))) : ''); + $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title'])) + ? '&title=' . urlencode(notags(trim($_REQUEST['title']))) : ''); + $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description'])) + ? '&description=' . urlencode(notags(trim($_REQUEST['description']))) : ''); + $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; @@ -51,7 +49,7 @@ function oexchange_content(&$a) { $post['body'] = html2bbcode($s); $post['type'] = 'wall'; - $_POST = $post; + $_REQUEST = $post; require_once('mod/item.php'); item_post($a);