diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-09-28 20:44:33 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-09-30 13:55:13 +0200 |
commit | 08fd4b38f895a5e9a91cdc476103c26be68dda80 (patch) | |
tree | 5cd0cccedd85aa1f055bb9afd92eb00e9037e6f7 /apps | |
parent | 6d743ffac6ceb2b89447e7a7da6fdbefc4a6d06a (diff) | |
download | nextcloud-server-08fd4b38f895a5e9a91cdc476103c26be68dda80.tar.gz nextcloud-server-08fd4b38f895a5e9a91cdc476103c26be68dda80.zip |
Do noy allow empty urls to be submitted in "add to your owncloud"
Fixes #19382
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/js/public.js | 8 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 6a6095317af..41333f1a089 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -228,6 +228,14 @@ OCA.Sharing.PublicApp = { OCA.Sharing.PublicApp._saveToOwnCloud(remote, token, owner, name, isProtected); }); + $('#remote_address').on("change keyup paste", function() { + if ($(this).val() === '') { + $('#save-button-confirm').prop('disabled', true); + } else { + $('#save-button-confirm').prop('disabled', false); + } + }); + $('#save #save-button').click(function () { $(this).hide(); $('.save-form').css('display', 'inline'); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index cde28c80fc4..06d797c3c6f 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -76,7 +76,7 @@ $thumbSize = 1024; <button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button> <form class="save-form hidden" action="#"> <input type="text" id="remote_address" placeholder="example.com/owncloud"/> - <button id="save-button-confirm" class="icon-confirm svg"></button> + <button id="save-button-confirm" class="icon-confirm svg" disabled></button> </form> </span> <?php } ?> |