]> git.mxchange.org Git - friendica.git/commitdiff
bad checkin
authorfriendica <info@friendica.com>
Fri, 3 May 2013 05:19:16 +0000 (22:19 -0700)
committerfriendica <info@friendica.com>
Fri, 3 May 2013 05:19:16 +0000 (22:19 -0700)
include/network.php
index.php

index 5a36bd6a0043d506b9900cd00956d099f6847857..d2732e0393796f9bd9abe80b22bfae347b5ec6c8 100644 (file)
@@ -819,12 +819,12 @@ function add_fcontact($arr,$update = false) {
 }
 
 
-function scale_external_images($s, $include_link = true, $scale_replace = false) {
+function scale_external_images($srctext, $include_link = true, $scale_replace = false) {
 
        $a = get_app();
 
        // Picture addresses can contain special characters
-       $s = htmlspecialchars_decode($s);
+       $s = htmlspecialchars_decode($srctext);
 
        $matches = null;
        $c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER);
@@ -846,7 +846,9 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
                                $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[1]);
                        else
                                $scaled = $mtch[1];
-                       $i = fetch_url($scaled);
+                       $i = @fetch_url($scaled);
+                       if(! $i)
+                               return $srctext;
 
                        $cachefile = get_cachefile(hash("md5", $scaled));
                        if ($cachefile != '') {
index 8abca2eb82a87b3650f577b91507953ed7a35c69..8e2376e918120c4d0c7319c28c8c30a643376ae2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -414,10 +414,7 @@ if(!$a->theme['stylesheet'])
        $stylesheet = current_theme_url();
 else
        $stylesheet = $a->theme['stylesheet'];
-// this creates hundreds of compiled templates, when all we really want is a string replace.
-// $a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => $stylesheet));
-
-$a->page['htmlhead'] = str_replace('$stylesheet',$stylesheet,$a->page['htmlhead']);
+$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => $stylesheet));
 
 $page    = $a->page;
 $profile = $a->profile;