4 use Friendica\Core\System;
5 use Friendica\Model\Item;
7 require_once 'include/items.php';
9 function like_content(App $a) {
10 if (!local_user() && !remote_user()) {
15 $verb = notags(trim($_GET['verb']));
21 $item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
23 $r = Item::performLike($item_id, $verb);
28 // See if we've been passed a return path to redirect to
29 $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
31 like_content_return(System::baseUrl(), $return_path);
32 killme(); // NOTREACHED
36 // Decide how to return. If we were called with a 'return' argument,
37 // then redirect back to the calling page. If not, just quietly end
39 function like_content_return($baseurl, $return_path) {
41 $rand = '_=' . time();
42 if (strpos($return_path, '?')) {
48 goaway($baseurl . "/" . $return_path . $rand);