diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-05 13:23:13 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-05 13:23:13 +0100 |
commit | e5ea000aae2493b3df0a2673a9399983dd1ecfd0 (patch) | |
tree | 195d4ed2cfe8dc46432dfae034c308a34eb4f4db | |
parent | a6d2019014fc8967509a0baf727365cd08b545ff (diff) | |
parent | 28c8f5a0f9c79229a24af3f8a95bef0f8f43da09 (diff) | |
download | nextcloud-server-e5ea000aae2493b3df0a2673a9399983dd1ecfd0.tar.gz nextcloud-server-e5ea000aae2493b3df0a2673a9399983dd1ecfd0.zip |
Merge pull request #13108 from owncloud/fix-public-link-mount-for-pre-oc7
Check for version before mounting a public link
-rw-r--r-- | apps/files_sharing/ajax/testremote.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/js/public.js | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_sharing/ajax/testremote.php b/apps/files_sharing/ajax/testremote.php index 89581794698..08149bf7ecc 100644 --- a/apps/files_sharing/ajax/testremote.php +++ b/apps/files_sharing/ajax/testremote.php @@ -14,7 +14,8 @@ function testUrl($url) { try { $result = file_get_contents($url); $data = json_decode($result); - return is_object($data) and !empty($data->version); + // public link mount is only supported in ownCloud 7+ + return is_object($data) and !empty($data->version) and version_compare($data->version, '7.0.0', '>='); } catch (Exception $e) { return false; } diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 861da2065ea..02ecf56fa09 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -217,7 +217,7 @@ OCA.Sharing.PublicApp = { // this check needs to happen on the server due to the Content Security Policy directive $.get(OC.generateUrl('apps/files_sharing/testremote'), {remote: remote}).then(function (protocol) { if (protocol !== 'http' && protocol !== 'https') { - OC.dialogs.alert(t('files_sharing', 'No ownCloud installation found at {remote}', {remote: remote}), + OC.dialogs.alert(t('files_sharing', 'No ownCloud installation (7 or higher) found at {remote}', {remote: remote}), t('files_sharing', 'Invalid ownCloud url')); } else { OC.redirect(protocol + '://' + url); |