aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index c504c77e1..1a27cbe57 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -580,6 +580,19 @@ function item_post(&$a) {
}
+ if(array_key_exists('item_private',$datarray) && $datarray['item_private']) {
+ logger('Encrypting local storage');
+ $key = get_config('system','pubkey');
+ $datarray['item_flags'] = $datarray['item_flags'] | ITEM_OBSCURED;
+ if($datarray['title'])
+ $datarray['title'] = json_encode(aes_encapsulate($datarray['title'],$key));
+ if($datarray['body'])
+ $datarray['body'] = json_encode(aes_encapsulate($datarray['body'],$key));
+ }
+
+
+
+
if($orig_post) {
$r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `attach` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($datarray['title']),
@@ -602,6 +615,23 @@ function item_post(&$a) {
);
+ if(count($post_tags)) {
+ foreach($post_tags as $tag) {
+ if(strlen(trim($tag['term']))) {
+ q("insert into term (uid,oid,otype,type,term,url) values (%d,%d,%d,%d,'%s','%s')",
+ intval($tag['uid']),
+ intval($post_id),
+ intval($tag['otype']),
+ intval($tag['type']),
+ dbesc(trim($tag['term'])),
+ dbesc(trim($tag['url']))
+ );
+ }
+ }
+ }
+
+
+
proc_run('php', "include/notifier.php", 'edit_post', $post_id);
if((x($_REQUEST,'return')) && strlen($return_path)) {
logger('return: ' . $return_path);