Validate bookmark inputs, fixes bug oc-636

This commit is contained in:
Michael Gapczynski 2012-05-13 16:58:18 -04:00
parent 90518e8d2a
commit 1629c77eb5
1 changed files with 8 additions and 1 deletions

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'),