mirror of
https://github.com/owncloud/bookmarks.git
synced 2024-12-02 06:24:11 +01:00
use unnamed as title for a bookmark if no title was entered and curl fails
This commit is contained in:
parent
1efdb4fc95
commit
46cbc4b461
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user