]> git.mxchange.org Git - friendica.git/commitdiff
The post_remote_end hook was being called with an escaped version of the item, not...
authorMatthew Exon <github.mexon@spamgourmet.com>
Fri, 8 Mar 2013 02:08:47 +0000 (03:08 +0100)
committerMatthew Exon <git.mexon@spamgourmet.com>
Sat, 9 Mar 2013 07:57:50 +0000 (15:57 +0800)
include/items.php

index 29f4d7256feb548d292539b68490233102964fdf..8bd28f788de36643c0c56ac2f92bdd98be494105 100755 (executable)
@@ -1149,7 +1149,6 @@ function item_store($arr,$force_parent = false) {
         $arr['deny_gid'] = $deny_gid;
         $arr['private'] = $private;
         $arr['deleted'] = $parent_deleted;
-       call_hooks('post_remote_end',$arr);
 
        // update the commented timestamp on the parent
 
@@ -1195,6 +1194,14 @@ function item_store($arr,$force_parent = false) {
                logger('item_store: put item '.$current_post.' into cachefile '.$cachefile);
        }
 
+        $r = q('SELECT * FROM `item` WHERE id = %d', intval($current_post));
+        if (count($r) == 1) {
+            call_hooks('post_remote_end', $r[0]);
+        }
+        else {
+            logger('item_store: new item not found in DB, id ' . $current_post);
+        }
+
        return $current_post;
 }