X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftext.php;fp=include%2Ftext.php;h=d34fd7fbeec35bcacfb5a1bd2fa201a3e770d692;hb=9243c9fc141237453f05d215058d4b975d010437;hp=199460d2cf12104841d27085a3d8db9a14c34559;hpb=ab89aa90caced4f60fc0ae944c7190e156a872e2;p=friendica.git diff --git a/include/text.php b/include/text.php index 199460d2cf..d34fd7fbee 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 .= '
' . t('Filed under:') . ' ' . $x . '
'; } - $prep_arr = array('item' => $item, 'html' => $s); call_hooks('prepare_body_final', $prep_arr); + return $prep_arr['html']; }}