* @return boolean
*/
function proxy_is_local_image($url) {
- if ($url[0] == '/') return true;
+ if ($url[0] == '/') {
+ return true;
+ }
- if (strtolower(substr($url, 0, 5)) == "data:") return true;
+ if (strtolower(substr($url, 0, 5)) == 'data:') {
+ return true;
+ }
// links normalised - bug #431
- $baseurl = normalise_link(get_app()->get_baseurl());
+ $baseurl = normalise_link(App::get_baseurl());
$url = normalise_link($url);
return (substr($url, 0, strlen($baseurl)) == $baseurl);
}
}
function proxy_parse_html($html) {
-- $a = get_app();
- $html = str_replace(normalise_link(App::get_baseurl())."/", App::get_baseurl()."/", $html);
- $html = str_replace(normalise_link($a->get_baseurl()) . '/', $a->get_baseurl() . '/', $html);
++ $html = str_replace(normalise_link(App::get_baseurl()) . '/', App::get_baseurl() . '/', $html);
- return preg_replace_callback("/(<img [^>]*src *= *[\"'])([^\"']+)([\"'][^>]*>)/siU", "proxy_img_cb", $html);
+ return preg_replace_callback('/(<img [^>]*src *= *["\'])([^"\']+)(["\'][^>]*>)/siU', 'proxy_img_cb', $html);
}