Skip to content
Snippets Groups Projects
Commit e5ea000a authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #13108 from owncloud/fix-public-link-mount-for-pre-oc7

Check for version before mounting a public link
parents a6d20190 28c8f5a0
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment