mirror of
https://github.com/owncloud/bookmarks.git
synced 2025-01-18 14:52:10 +01:00
Bookmark: Avoid error when the title is not found
This commit is contained in:
parent
fce7e94942
commit
ffc7f365da
@ -430,11 +430,13 @@ class OC_Bookmarks_Bookmarks{
|
||||
$page = OC_Util::getUrlContent($url);
|
||||
if($page) {
|
||||
if(preg_match( "/<title>(.*)<\/title>/sUi", $page, $match ) !== false)
|
||||
$metadata['title'] = html_entity_decode($match[1], ENT_NOQUOTES , 'UTF-8');
|
||||
//Not the best solution but....
|
||||
$metadata['title'] = str_replace('™', chr(153), $metadata['title']);
|
||||
$metadata['title'] = str_replace('‐', '‐', $metadata['title']);
|
||||
$metadata['title'] = str_replace('–', '–', $metadata['title']);
|
||||
if(isset($match[1])) {
|
||||
$metadata['title'] = html_entity_decode($match[1], ENT_NOQUOTES , 'UTF-8');
|
||||
//Not the best solution but....
|
||||
$metadata['title'] = str_replace('™', chr(153), $metadata['title']);
|
||||
$metadata['title'] = str_replace('‐', '‐', $metadata['title']);
|
||||
$metadata['title'] = str_replace('–', '–', $metadata['title']);
|
||||
}
|
||||
}
|
||||
return $metadata;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user