fix a couple of miscellaneous errors which showed up in the logs

This commit is contained in:
redmatrix 2015-05-11 22:57:12 -07:00
parent aeb69dcbbe
commit f2a0dac653
2 changed files with 5 additions and 2 deletions

View File

@ -603,7 +603,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
$scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]); $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]);
else else
$scaled = $mtch[3]; $scaled = $mtch[3];
$i = z_fetch_url($scaled); $i = z_fetch_url($scaled,true);
$cache = get_config('system','itemcache'); $cache = get_config('system','itemcache');
@ -613,7 +613,10 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
} }
// guess mimetype from headers or filename // guess mimetype from headers or filename
$type = guess_image_type($mtch[3],$i['header']); $type = guess_image_type($mtch[3],$i['header']);
if(strpos($type,'image') === false)
continue;
if($i['success']) { if($i['success']) {
$ph = photo_factory($i['body'], $type); $ph = photo_factory($i['body'], $type);

View File

@ -2244,7 +2244,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d
// The '=' is needed to not replace color codes if the code is also used as a tag // The '=' is needed to not replace color codes if the code is also used as a tag
// Much better would be to somehow completely avoiding things in e.g. [color]-tags. // Much better would be to somehow completely avoiding things in e.g. [color]-tags.
// This would allow writing things like "my favourite tag=#foobar". // This would allow writing things like "my favourite tag=#foobar".
$body = preg_replace('/(?<![a-zA-Z0-9=])'.preg_quote($tag).'/', $newtag, $body); $body = preg_replace('/(?<![a-zA-Z0-9=])'.preg_quote($tag,'/').'/', $newtag, $body);
$replaced = true; $replaced = true;
} }
//is the link already in str_tags? //is the link already in str_tags?