]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
Merge remote-tracking branch 'upstream/master'
[friendica.git] / include / text.php
index 54c9f39fa6a8e50f1be98594c88aa9bbd4b47849..53dd06d1fd8e71e095c2f02f9a2a5e6a7e44ab86 100644 (file)
@@ -23,7 +23,6 @@ function replace_macros($s,$r) {
                if(gettype($s) === 'string') {
                        $template = $s;
                        $s = new FriendicaSmarty();
-                       $s->error_reporting = E_ALL & ~E_NOTICE;
                }
                foreach($r as $key=>$value) {
                        if($key[0] === '$') {
@@ -490,12 +489,12 @@ function get_template_file($a, $filename, $root = '') {
        if($root !== '' && $root[strlen($root)-1] !== '/')
                $root = $root . '/';
 
-       if(file_exists($root . "view/theme/$theme/$filename"))
-               $template_file = $root . "view/theme/$theme/$filename";
-       elseif (x($a->theme_info,"extends") && file_exists($root . "view/theme/".$a->theme_info["extends"]."/$filename"))
-               $template_file = $root . "view/theme/".$a->theme_info["extends"]."/$filename";
+       if(file_exists("{$root}view/theme/$theme/$filename"))
+               $template_file = "{$root}view/theme/$theme/$filename";
+       elseif (x($a->theme_info,"extends") && file_exists("{$root}view/theme/{$a->theme_info["extends"]}/$filename"))
+               $template_file = "{$root}view/theme/{$a->theme_info["extends"]}/$filename";
        else
-               $template_file = $root . "view/$filename";
+               $template_file = "{$root}view/$filename";
 
        return $template_file;
 }}
@@ -1045,13 +1044,13 @@ function prepare_body($item,$attach = false) {
                return $s;
        }
 
-       $arr = explode(',',$item['attach']);
+       $arr = explode('[/attach],',$item['attach']);
        if(count($arr)) {
                $s .= '<div class="body-attach">';
                foreach($arr as $r) {
                        $matches = false;
                        $icon = '';
-                       $cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches, PREG_SET_ORDER);
+                       $cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches, PREG_SET_ORDER);
                        if($cnt) {
                                foreach($matches as $mtch) {
                                        $icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));