X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flike.php;h=957fe5fc42ee107b9dafcb22c5c9b35a727567d6;hb=80a4e6263fd53f83a710d2a2e6c57baae38cb14b;hp=ef483a1f9eed3ca264086edc3d37d77b3380504d;hpb=4d21671f75e35e7c2880467dddc0936e8c718d8c;p=friendica.git diff --git a/mod/like.php b/mod/like.php old mode 100755 new mode 100644 index ef483a1f9e..957fe5fc42 --- a/mod/like.php +++ b/mod/like.php @@ -1,49 +1,53 @@ argc > 1) ? notags(trim($a->argv[1])) : 0); - $r = do_like($item_id, $verb); - if (!$r) return; + $r = Item::performLike($item_id, $verb); + if (!$r) { + return; + } // See if we've been passed a return path to redirect to $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : ''); - like_content_return($a->get_baseurl(), $return_path); + like_content_return(System::baseUrl(), $return_path); killme(); // NOTREACHED -// return; // NOTREACHED -} } + // Decide how to return. If we were called with a 'return' argument, // then redirect back to the calling page. If not, just quietly end -if(! function_exists('like_content_return')) { -function like_content_return($baseurl, $return_path) { - if($return_path) { +function like_content_return($baseurl, $return_path) { + if ($return_path) { $rand = '_=' . time(); - if(strpos($return_path, '?')) $rand = "&$rand"; - else $rand = "?$rand"; + if (strpos($return_path, '?')) { + $rand = "&$rand"; + } else { + $rand = "?$rand"; + } goaway($baseurl . "/" . $return_path . $rand); } killme(); } -}