summaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-03-23 16:53:44 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-03-23 16:54:15 +0100
commit45b320d674332dc224cf95c82e2e02e25ac66661 (patch)
treedf32233fc1c636849505bedb3ff2b3ff376d2b8d /apps/bookmarks
parent7cad6ccce0f2fdcfc61e1071cb6373e9d28bcd63 (diff)
downloadnextcloud-server-45b320d674332dc224cf95c82e2e02e25ac66661.tar.gz
nextcloud-server-45b320d674332dc224cf95c82e2e02e25ac66661.zip
use unnamed as title for a bookmark if no title was entered and curl fails
Diffstat (limited to 'apps/bookmarks')
-rw-r--r--apps/bookmarks/bookmarksHelper.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index 8def7401e2f..7ada69014fb 100644
--- a/apps/bookmarks/bookmarksHelper.php
+++ b/apps/bookmarks/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),