1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2024-12-02 06:24:11 +01:00

Validate bookmark inputs, fixes bug oc-636

This commit is contained in:
Michael Gapczynski 2012-05-13 16:58:18 -04:00
parent 7281a90fa4
commit 58a4859ed3

View File

@ -60,7 +60,14 @@ function addOrEditBookmark(event) {
var title = encodeEntities($('#bookmark_add_title').val());
var tags = encodeEntities($('#bookmark_add_tags').val());
$("#firstrun").hide();
if($.trim(url) == '') {
OC.dialogs.alert('A valid bookmark url must be provided', 'Error creating bookmark');
return false;
}
if($.trim(title) == '') {
OC.dialogs.alert('A valid bookmark title must be provided', 'Error creating bookmark');
return false;
}
if (id == 0) {
$.ajax({
url: OC.filePath('bookmarks', 'ajax', 'addBookmark.php'),