aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorfriendica <redmatrix@redmatrix.me>2015-04-30 17:52:34 -0700
committerfriendica <redmatrix@redmatrix.me>2015-04-30 17:52:34 -0700
commit097002910ead3ec263f723eb66e659f0469b8bb6 (patch)
tree509b11f02380802d7e30fceac6f01e2bd0c152d4 /include/text.php
parentbc44b6f793c686255ab1c6d2e18a6dbe754b6b96 (diff)
downloadvolse-hubzilla-097002910ead3ec263f723eb66e659f0469b8bb6.tar.gz
volse-hubzilla-097002910ead3ec263f723eb66e659f0469b8bb6.tar.bz2
volse-hubzilla-097002910ead3ec263f723eb66e659f0469b8bb6.zip
just a test, please do not try to implement this as there are severe security issues
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index f8a990f58..05251c580 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1371,8 +1371,12 @@ function generate_named_map($location) {
function prepare_body(&$item,$attach = false) {
+ if(get_config('system','item_cache') && $item['body'])
+ return $item['html'];
+
call_hooks('prepare_body_init', $item);
+
unobscure($item);
$s = prepare_text($item['body'],$item['mimetype']);
@@ -1440,6 +1444,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'];
}