]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
Merge remote-tracking branch 'upstream/master'
[friendica.git] / include / text.php
index d1fff85ea358f7cc866976063eefd3d09047e860..53dd06d1fd8e71e095c2f02f9a2a5e6a7e44ab86 100644 (file)
@@ -561,11 +561,12 @@ function get_tags($s) {
        $ret = array();
 
        // ignore anything in a code block
-
        $s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s);
 
-       // ignore anything in a bbtag
+       // Force line feeds at bbtags
+       $s = str_replace(array("[", "]"), array("\n[", "]\n"), $s);
 
+       // ignore anything in a bbtag
        $s = preg_replace('/\[(.*?)\]/sm','',$s);
 
        // Match full names against @tags including the space between first and last
@@ -1017,7 +1018,8 @@ function prepare_body($item,$attach = false) {
        $a = get_app();
        call_hooks('prepare_body_init', $item);
 
-       $cachefile = get_cachefile($item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body']));
+       //$cachefile = get_cachefile($item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body']));
+       $cachefile = get_cachefile($item["guid"]."-".hash("md5", $item['body']));
 
        if (($cachefile != '')) {
                if (file_exists($cachefile))
@@ -1025,6 +1027,7 @@ function prepare_body($item,$attach = false) {
                else {
                        $s = prepare_text($item['body']);
                        file_put_contents($cachefile, $s);
+                       logger('prepare_body: put item '.$item["id"].' into cachefile '.$cachefile);
                }
        } else
                $s = prepare_text($item['body']);