aboutsummaryrefslogtreecommitdiffstats
path: root/mod/editpost.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/editpost.php')
-rw-r--r--mod/editpost.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/mod/editpost.php b/mod/editpost.php
index 43c71ca8a..583bae9eb 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -1,6 +1,7 @@
<?php
require_once('acl_selectors.php');
+require_once('include/crypto.php');
function editpost_content(&$a) {
@@ -18,13 +19,14 @@ function editpost_content(&$a) {
return;
}
- $itm = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ $itm = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d and author_xchan = '%s' LIMIT 1",
intval($post_id),
- intval(local_user())
+ intval(local_user()),
+ dbesc(get_observer_hash())
);
if(! count($itm)) {
- notice( t('Item not found') . EOL);
+ notice( t('Item is not editable') . EOL);
return;
}
@@ -46,6 +48,15 @@ function editpost_content(&$a) {
));
+
+ if($itm[0]['item_flags'] & ITEM_OBSCURED) {
+ $key = get_config('system','prvkey');
+ if($itm[0]['title'])
+ $itm[0]['title'] = aes_unencapsulate(json_decode_plus($itm[0]['title']),$key);
+ if($itm[0]['body'])
+ $itm[0]['body'] = aes_unencapsulate(json_decode_plus($itm[0]['body']),$key);
+ }
+
$tpl = get_markup_template("jot.tpl");
$jotplugins = '';
@@ -82,9 +93,9 @@ function editpost_content(&$a) {
'$pvisit' => 'none',
'$public' => t('Public post'),
'$jotnets' => $jotnets,
- '$title' => $itm[0]['title'],
+ '$title' => htmlspecialchars($itm[0]['title']),
'$placeholdertitle' => t('Set title'),
- '$category' => file_tag_file_to_list($itm[0]['file'], 'category'),
+ '$category' => '', // FIXME
'$placeholdercategory' => t('Categories (comma-separated list)'),
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,