aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-16 20:25:10 -0800
committerFriendika <info@friendika.com>2011-02-16 20:25:10 -0800
commitc397a2f89bf3c2c609852f5bfc618c1d0cb0b709 (patch)
tree24d21b9352352a5594cb7bb80b8afd7f7fea2bc0 /mod/item.php
parent67bb737aa1368e4b16de0ac42134db47874cc18c (diff)
downloadvolse-hubzilla-c397a2f89bf3c2c609852f5bfc618c1d0cb0b709.tar.gz
volse-hubzilla-c397a2f89bf3c2c609852f5bfc618c1d0cb0b709.tar.bz2
volse-hubzilla-c397a2f89bf3c2c609852f5bfc618c1d0cb0b709.zip
properly handle error returns in post w/ajax
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/mod/item.php b/mod/item.php
index 21dfb4560..cbdd11eb9 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -35,7 +35,9 @@ function item_post(&$a) {
);
if(! count($r)) {
notice( t('Unable to locate original post.') . EOL);
- goaway($a->get_baseurl() . "/" . $_POST['return'] );
+ if(x($_POST,'return'))
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
+ killme();
}
$parent_item = $r[0];
if($parent_item['contact-id'] && $uid) {
@@ -53,7 +55,9 @@ function item_post(&$a) {
if(! can_write_wall($a,$profile_uid)) {
notice( t('Permission denied.') . EOL) ;
- return;
+ if(x($_POST,'return'))
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
+ killme();
}
$user = null;
@@ -92,8 +96,9 @@ function item_post(&$a) {
if(! strlen($body)) {
notice( t('Empty post discarded.') . EOL );
- goaway($a->get_baseurl() . "/" . $_POST['return'] );
-
+ if(x($_POST,'return'))
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
+ killme();
}
// get contact info for poster