1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-18 15:54:28 +01:00

[Bookmarks] Remove dead code and more special chars from page title

This commit is contained in:
Brice Maron 2013-01-08 18:25:56 +00:00
parent 8ed12564cc
commit 6f8d0be58f

View File

@ -384,14 +384,14 @@ class OC_Bookmarks_Bookmarks{
$url = 'http://' . $url;
}
$metadata['url'] = $url;
if (!function_exists('curl_init')) {
return $metadata;
}
$page = OC_Util::getUrlContent($url);
if($page) {
if(preg_match( "/<title>(.*)<\/title>/sUi", $page, $match ) !== false)
$metadata['title'] = htmlspecialchars_decode($match[1]);
$metadata['title'] = html_entity_decode($match[1], ENT_NOQUOTES , 'UTF-8');
//Not the best solution but....
$metadata['title'] = str_replace('&trade;', chr(153), $metadata['title']);
$metadata['title'] = str_replace('&dash;', '', $metadata['title']);
$metadata['title'] = str_replace('&ndash;', '', $metadata['title']);
}
return $metadata;
}