1
0
Fork 0

replaced $return_url to $return_path to make it more clear that it is a relative path to the Friendica baseurl

This commit is contained in:
Philipp Holzer 2018-10-19 23:55:11 +02:00
commit 3edad1591e
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
12 changed files with 44 additions and 44 deletions

View file

@ -198,7 +198,7 @@ function events_content(App $a)
}
if ($a->argc == 1) {
$_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
$_SESSION['return_path'] = $a->cmd;
}
if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {

View file

@ -25,7 +25,7 @@ function follow_post(App $a)
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
$return_url = 'contacts';
$return_path = 'contacts';
// Makes the connection request for friendica contacts easier
// This is just a precaution if maybe this page is called somewhere directly via POST
@ -37,24 +37,24 @@ function follow_post(App $a)
if ($result['message']) {
notice($result['message']);
}
$a->internalRedirect($return_url);
$a->internalRedirect($return_path);
} elseif ($result['cid']) {
$a->internalRedirect('contact/' . $result['cid']);
}
info(L10n::t('The contact could not be added.'));
$a->internalRedirect($return_url);
$a->internalRedirect($return_path);
// NOTREACHED
}
function follow_content(App $a)
{
$return_url = 'contacts';
$return_path = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
$a->internalRedirect($return_url);
$a->internalRedirect($return_path);
// NOTREACHED
}
@ -74,7 +74,7 @@ function follow_content(App $a)
if ($r[0]['pending']) {
notice(L10n::t('You already added this contact.'));
$submit = '';
//$a->internalRedirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_path']);
// NOTREACHED
}
}
@ -84,21 +84,21 @@ function follow_content(App $a)
if (($ret['network'] == Protocol::DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
notice(L10n::t("Diaspora support isn't enabled. Contact can't be added."));
$submit = '';
//$a->internalRedirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_path']);
// NOTREACHED
}
if (($ret['network'] == Protocol::OSTATUS) && Config::get('system', 'ostatus_disabled')) {
notice(L10n::t("OStatus support is disabled. Contact can't be added."));
$submit = '';
//$a->internalRedirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_path']);
// NOTREACHED
}
if ($ret['network'] == Protocol::PHANTOM) {
notice(L10n::t("The network type couldn't be detected. Contact can't be added."));
$submit = '';
//$a->internalRedirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_path']);
// NOTREACHED
}
@ -118,7 +118,7 @@ function follow_content(App $a)
if (!$r) {
notice(L10n::t('Permission denied.'));
$a->internalRedirect($return_url);
$a->internalRedirect($return_path);
// NOTREACHED
}

View file

@ -99,7 +99,7 @@ function manage_post(App $a) {
unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']);
unset($_SESSION['page_flags']);
unset($_SESSION['return_url']);
unset($_SESSION['return_path']);
if (x($_SESSION, 'submanage')) {
unset($_SESSION['submanage']);
}

View file

@ -35,7 +35,7 @@ function match_content(App $a)
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();
$_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
$_SESSION['return_path'] = $a->cmd;
$r = q(
"SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",

View file

@ -265,7 +265,7 @@ function message_content(App $a)
}
$_SESSION['return_url'] = $a->query_string;
$_SESSION['return_path'] = $a->query_string;
if ($a->argc == 1) {

View file

@ -1469,7 +1469,7 @@ function photos_content(App $a)
if (count($linked_items)) {
$cmnt_tpl = get_markup_template('comment_item.tpl');
$tpl = get_markup_template('photo_item.tpl');
$return_url = $a->cmd;
$return_path = $a->cmd;
if ($can_post || Security::canWriteToUserWall($owner_uid)) {
$like_tpl = get_markup_template('like_noshare.tpl');
@ -1486,7 +1486,7 @@ function photos_content(App $a)
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
$comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_url,
'$jsreload' => $return_path,
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
@ -1525,7 +1525,7 @@ function photos_content(App $a)
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
$comments .= replace_macros($cmnt_tpl,[
'$return_path' => '',
'$jsreload' => $return_url,
'$jsreload' => $return_path,
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
@ -1585,7 +1585,7 @@ function photos_content(App $a)
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
$comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_url,
'$jsreload' => $return_path,
'$id' => $item['item_id'],
'$parent' => $item['parent'],
'$profile_uid' => $owner_uid,

View file

@ -62,7 +62,7 @@ function suggest_content(App $a)
return;
}
$_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
$_SESSION['return_path'] = $a->cmd;
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();

View file

@ -14,7 +14,7 @@ use Friendica\Model\User;
function unfollow_post(App $a)
{
$return_url = 'contacts';
$return_path = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
@ -32,17 +32,17 @@ function unfollow_post(App $a)
if (!DBA::isResult($contact)) {
notice(L10n::t("You aren't following this contact."));
$a->internalRedirect($return_url);
$a->internalRedirect($return_path);
// NOTREACHED
}
if (!empty($_REQUEST['cancel'])) {
$a->internalRedirect($return_url . '/' . $contact['id']);
$a->internalRedirect($return_path . '/' . $contact['id']);
}
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
notice(L10n::t('Unfollowing is currently not supported by your network.'));
$a->internalRedirect($return_url . '/' . $contact['id']);
$a->internalRedirect($return_path . '/' . $contact['id']);
// NOTREACHED
}
@ -69,7 +69,7 @@ function unfollow_post(App $a)
function unfollow_content(App $a)
{
$return_url = 'contacts';
$return_path = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
@ -88,7 +88,7 @@ function unfollow_content(App $a)
if (!DBA::isResult($contact)) {
notice(L10n::t("You aren't following this contact."));
$a->internalRedirect($return_url);
$a->internalRedirect($return_path);
// NOTREACHED
}
@ -105,7 +105,7 @@ function unfollow_content(App $a)
if (!DBA::isResult($self)) {
notice(L10n::t('Permission denied.'));
$a->internalRedirect($return_url);
$a->internalRedirect($return_path);
// NOTREACHED
}