diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-13 16:58:18 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2012-05-13 16:58:47 -0400 |
commit | 1629c77eb5737ade319801c7ed8fba7b75d0a2bf (patch) | |
tree | acb1014993a4912f581793ce65949d07cba834c8 /apps/bookmarks | |
parent | 90518e8d2a9adc1d93b1453a830b3703d54d72c2 (diff) | |
download | nextcloud-server-1629c77eb5737ade319801c7ed8fba7b75d0a2bf.tar.gz nextcloud-server-1629c77eb5737ade319801c7ed8fba7b75d0a2bf.zip |
Validate bookmark inputs, fixes bug oc-636
Diffstat (limited to 'apps/bookmarks')
-rw-r--r-- | apps/bookmarks/js/bookmarks.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/bookmarks/js/bookmarks.js b/apps/bookmarks/js/bookmarks.js index 73986e49186..5032aa5f50c 100644 --- a/apps/bookmarks/js/bookmarks.js +++ b/apps/bookmarks/js/bookmarks.js @@ -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'), |