aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-28 21:04:03 -0700
committerfriendica <info@friendica.com>2013-07-28 21:04:03 -0700
commitd002ff668aee672d7a49cd744d6797eb616b9152 (patch)
tree01044d6e4788ad9867d57d2c475973a43d368961 /mod/item.php
parent10f016841c612c6cef86cff91f45baea74c5d3d6 (diff)
downloadvolse-hubzilla-d002ff668aee672d7a49cd744d6797eb616b9152.tar.gz
volse-hubzilla-d002ff668aee672d7a49cd744d6797eb616b9152.tar.bz2
volse-hubzilla-d002ff668aee672d7a49cd744d6797eb616b9152.zip
encrypt private messages on disk - there are still a couple of places where the text is leaked in the logs during processing.
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);