diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 12 | ||||
-rw-r--r-- | include/text.php | 10 |
2 files changed, 20 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 47a1fd223..fe5f37260 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -420,7 +420,11 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) { // process [observer] tags before we do anything else because we might // be stripping away stuff that then doesn't need to be worked on anymore - $observer = $a->get_observer(); + if(get_config('system','item_cache')) + $observer = false; + else + $observer = $a->get_observer(); + if ((strpos($Text,'[/observer]') !== false) || (strpos($Text,'[/rpost]') !== false)) { if ($observer) { $Text = preg_replace("/\[observer\=1\](.*?)\[\/observer\]/ism", '$1', $Text); @@ -433,7 +437,11 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) { } } - $channel = $a->get_channel(); + if(get_config('system','item_cache')) + $channel = false; + else + $channel = $a->get_channel(); + if (strpos($Text,'[/channel]') !== false) { if ($channel) { $Text = preg_replace("/\[channel\=1\](.*?)\[\/channel\]/ism", '$1', $Text); 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']; } |