diff options
author | friendica <info@friendica.com> | 2015-05-01 13:19:19 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-05-01 13:19:19 -0700 |
commit | b467dc4f0055452b65fac842d1294ec9cc978445 (patch) | |
tree | aaeac4db4a1e1340ee95cad3c3367bdff10e64f1 /include/text.php | |
parent | c4221f32738dac51f691d5be1bebd2b50318521e (diff) | |
parent | e4fe068ed51c3d92cdb416492c3cc0ad26c28c1c (diff) | |
download | volse-hubzilla-b467dc4f0055452b65fac842d1294ec9cc978445.tar.gz volse-hubzilla-b467dc4f0055452b65fac842d1294ec9cc978445.tar.bz2 volse-hubzilla-b467dc4f0055452b65fac842d1294ec9cc978445.zip |
Merge branch 'master' into tres
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index 1292d49d3..72000b546 100644 --- a/include/text.php +++ b/include/text.php @@ -1185,6 +1185,14 @@ function unobscure(&$item) { $item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key); if($item['body']) $item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key); + if(get_config('system','item_cache')) { + q("update item set title = '%s', body = '%s', item_flags = %d where id = %d", + dbesc($item['title']), + dbesc($item['body']), + intval($item['item_flags'] - ITEM_OBSCURED), + intval($item['id']) + ); + } } } @@ -1371,8 +1379,12 @@ function generate_named_map($location) { function prepare_body(&$item,$attach = false) { + if(get_config('system','item_cache') && $item['html']) + return $item['html']; + call_hooks('prepare_body_init', $item); + unobscure($item); $s = prepare_text($item['body'],$item['mimetype']); @@ -1440,6 +1452,12 @@ function prepare_body(&$item,$attach = false) { $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body_final', $prep_arr); + if(get_config('system','item_cache')) + q("update item set html = '%s' where id = %d", + dbesc($prep_arr['html']), + intval($item['id']) + ); + return $prep_arr['html']; } |