Skip to content
Snippets Groups Projects
Commit 45b320d6 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

use unnamed as title for a bookmark if no title was entered and curl fails

parent 7cad6ccc
Branches
No related tags found
No related merge requests found
...@@ -71,7 +71,7 @@ function getURLMetadata($url) { ...@@ -71,7 +71,7 @@ function getURLMetadata($url) {
return $metadata; return $metadata;
} }
function addBookmark($url, $title='', $tags='') { function addBookmark($url, $title, $tags='') {
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
$_ut = "strftime('%s','now')"; $_ut = "strftime('%s','now')";
...@@ -93,6 +93,11 @@ function addBookmark($url, $title='', $tags='') { ...@@ -93,6 +93,11 @@ function addBookmark($url, $title='', $tags='') {
$title = $metadata['title']; $title = $metadata['title'];
} }
if(empty($title)) {
$l = new OC_L10N('bookmarks');
$title = $l->t('unnamed');
}
$params=array( $params=array(
htmlspecialchars_decode($url), htmlspecialchars_decode($url),
htmlspecialchars_decode($title), htmlspecialchars_decode($title),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment