From 08fd4b38f895a5e9a91cdc476103c26be68dda80 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 28 Sep 2015 20:44:33 +0200 Subject: [PATCH] Do noy allow empty urls to be submitted in "add to your owncloud" Fixes #19382 --- apps/files_sharing/js/public.js | 8 ++++++++ apps/files_sharing/templates/public.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 6a6095317a..41333f1a08 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 cde28c80fc..06d797c3c6 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -76,7 +76,7 @@ $thumbSize = 1024;