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

Fix Null titles and title with quotes from backend request fix #18

This commit is contained in:
Brice Maron 2013-06-28 23:54:54 +02:00
parent 3d44474eb4
commit 37a036c166
2 changed files with 5 additions and 2 deletions

View File

@ -280,6 +280,9 @@ function updateBookmarksList(bookmark, position) {
bookmark.added_date.setTime(parseInt(bookmark.added)*1000); bookmark.added_date.setTime(parseInt(bookmark.added)*1000);
} }
if(! bookmark.title)
bookmark.title ='';
html = tmpl("item_tmpl", bookmark); html = tmpl("item_tmpl", bookmark);
if(position == "prepend") { if(position == "prepend") {
$('.bookmarks_list').prepend(html); $('.bookmarks_list').prepend(html);

View File

@ -435,7 +435,7 @@ class OC_Bookmarks_Bookmarks{
if($page) { if($page) {
if(preg_match( "/<title>(.*)<\/title>/sUi", $page, $match ) !== false) if(preg_match( "/<title>(.*)<\/title>/sUi", $page, $match ) !== false)
if(isset($match[1])) { if(isset($match[1])) {
$metadata['title'] = html_entity_decode($match[1], ENT_NOQUOTES , 'UTF-8'); $metadata['title'] = html_entity_decode($match[1], ENT_QUOTES , 'UTF-8');
//Not the best solution but.... //Not the best solution but....
$metadata['title'] = str_replace('&trade;', chr(153), $metadata['title']); $metadata['title'] = str_replace('&trade;', chr(153), $metadata['title']);
$metadata['title'] = str_replace('&dash;', '', $metadata['title']); $metadata['title'] = str_replace('&dash;', '', $metadata['title']);