From 46cbc4b461fde2612d6cb585f13d0de721eaddfb Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Fri, 23 Mar 2012 16:53:44 +0100 Subject: [PATCH] use unnamed as title for a bookmark if no title was entered and curl fails --- bookmarksHelper.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bookmarksHelper.php b/bookmarksHelper.php index 8def7401..7ada6901 100644 --- a/bookmarksHelper.php +++ b/bookmarksHelper.php @@ -71,7 +71,7 @@ function getURLMetadata($url) { return $metadata; } -function addBookmark($url, $title='', $tags='') { +function addBookmark($url, $title, $tags='') { $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ $_ut = "strftime('%s','now')"; @@ -93,6 +93,11 @@ function addBookmark($url, $title='', $tags='') { $title = $metadata['title']; } + if(empty($title)) { + $l = new OC_L10N('bookmarks'); + $title = $l->t('unnamed'); + } + $params=array( htmlspecialchars_decode($url), htmlspecialchars_decode($title),