diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-01-21 17:30:04 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-01-21 17:30:04 +0100 |
commit | fb1e6ca6c17dc24cfe29bde375f933822117a9af (patch) | |
tree | 7ae08003969c59b7a08e8486c17a12939ceeca37 /mod | |
parent | da6abe5462eca82a2322f75c0d7bde01a45ebf36 (diff) | |
parent | b711c050db39bd733f4a48cbe575b9e926aa3d0d (diff) | |
download | volse-hubzilla-fb1e6ca6c17dc24cfe29bde375f933822117a9af.tar.gz volse-hubzilla-fb1e6ca6c17dc24cfe29bde375f933822117a9af.tar.bz2 volse-hubzilla-fb1e6ca6c17dc24cfe29bde375f933822117a9af.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/mod/item.php b/mod/item.php index f100c9dfe..fdc768c67 100644 --- a/mod/item.php +++ b/mod/item.php @@ -817,25 +817,26 @@ function item_post(&$a) { dbesc($body) ); - if($z && $z[0]['created'] > datetime_convert('UTC','UTC', 'now - 2 minutes')) { - $datarray['cancel'] = 1; - notice( t('Duplicate post suppressed.') . EOL); - logger('Duplicate post. Faking plugin cancel.'); + if($z) { + foreach($z as $zz) { + if($zz['created'] > datetime_convert('UTC','UTC', 'now - 2 minutes')) { + $datarray['cancel'] = 1; + notice( t('Duplicate post suppressed.') . EOL); + logger('Duplicate post. Faking plugin cancel.'); + } + } } } call_hooks('post_local',$datarray); if(x($datarray,'cancel')) { - logger('mod_item: post cancelled by plugin.'); - if($return_path) { + logger('mod_item: post cancelled by plugin or duplicate suppressed.'); + if($return_path) goaway($a->get_baseurl() . "/" . $return_path); - } $json = array('cancel' => 1); - if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload'])) - $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload']; - + $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload']; echo json_encode($json); killme(); } |