diff options
author | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2012-03-16 07:13:14 +0100 |
---|---|---|
committer | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2012-03-16 07:13:14 +0100 |
commit | 74c64ef2d244df47b2bea6527bbeb5cc62ca8845 (patch) | |
tree | 1e3314f76eefd8f7d014ae8e4a218dc9663ae3d7 /include/text.php | |
parent | 80b57e664a3df68994108a3d511468b249e0bbff (diff) | |
parent | 47e1b8d0c07d79c33f8b2de52145aa751d4b955a (diff) | |
download | volse-hubzilla-74c64ef2d244df47b2bea6527bbeb5cc62ca8845.tar.gz volse-hubzilla-74c64ef2d244df47b2bea6527bbeb5cc62ca8845.tar.bz2 volse-hubzilla-74c64ef2d244df47b2bea6527bbeb5cc62ca8845.zip |
Merge branch 'master' of https://github.com/friendica/friendica
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/text.php b/include/text.php index 199460d2c..d34fd7fbe 100644 --- a/include/text.php +++ b/include/text.php @@ -877,14 +877,27 @@ function prepare_body($item,$attach = false) { $a = get_app(); call_hooks('prepare_body_init', $item); - $s = prepare_text($item['body']); + $cache = get_config('system','itemcache'); + + if (($cache != '')) { + $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body']); + + if (file_exists($cachefile)) + $s = file_get_contents($cachefile); + else { + $s = prepare_text($item['body']); + file_put_contents($cachefile, $s); + } + } else + $s = prepare_text($item['body']); $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body', $prep_arr); $s = $prep_arr['html']; - if(! $attach) + if(! $attach) { return $s; + } $arr = explode(',',$item['attach']); if(count($arr)) { @@ -942,9 +955,9 @@ function prepare_body($item,$attach = false) { $s .= '<div class="filesavetags"><span>' . t('Filed under:') . ' </span>' . $x . '</div>'; } - $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body_final', $prep_arr); + return $prep_arr['html']; }} |