From c10a4ca9c7422e2d68b3222e5c1a605ff6f456d6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 20 May 2015 20:28:16 -0700 Subject: re-arrange the html cache a bit --- include/text.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index f2d9f3e69..67410dfbc 100644 --- a/include/text.php +++ b/include/text.php @@ -1378,20 +1378,26 @@ function generate_named_map($location) { function prepare_body(&$item,$attach = false) { - if($item['html']) - return bb_observer($item['html']); - - call_hooks('prepare_body_init', $item); - - - unobscure($item); + if($item['html']) { + $s = bb_observer($item['html']); + } + else { + call_hooks('prepare_body_init', $item); + unobscure($item); - $s = prepare_text($item['body'],$item['mimetype'], true); + $s = prepare_text($item['body'],$item['mimetype'], true); + } $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body', $prep_arr); $s = $prep_arr['html']; + + q("update item set html = '%s' where id = %d", + dbesc($prep_arr['html']), + intval($item['id']) + ); + if(! $attach) { return $s; } @@ -1452,10 +1458,6 @@ function prepare_body(&$item,$attach = false) { call_hooks('prepare_body_final', $prep_arr); - q("update item set html = '%s' where id = %d", - dbesc($prep_arr['html']), - intval($item['id']) - ); return $prep_arr['html']; } -- cgit v1.2.3