diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-06-24 19:25:41 -0400 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-27 01:05:36 +0200 |
commit | f21fdf14f9456b5a25c78f48d03063c383cdbdc2 (patch) | |
tree | d059bcafb273396f4b78a5160ddde98457a7b893 | |
parent | bc68f14c4baba0438bf019af144564eec6624760 (diff) | |
download | nextcloud-server-f21fdf14f9456b5a25c78f48d03063c383cdbdc2.tar.gz nextcloud-server-f21fdf14f9456b5a25c78f48d03063c383cdbdc2.zip |
Forgot I got rid of the class field backendTypes, use the array keys of the backends field instead
-rw-r--r-- | core/js/share.js | 2 | ||||
-rw-r--r-- | lib/public/share.php | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/core/js/share.js b/core/js/share.js index 9ba35616a47..b7821ce14b5 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -25,7 +25,7 @@ OC.Share={ if (result && result.status === 'success') { OC.Share.item = result.data; } - }}); + }); }, share:function(itemType, shareType, shareWith, permissions, callback) { $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'share', itemType: itemType, shareType: shareType, shareWith: shareWith, permissions: permissions }, function(result) { diff --git a/lib/public/share.php b/lib/public/share.php index b77a986f441..0ba4cefad9e 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -355,8 +355,9 @@ class Share { * @return array */ private static function getParentItemTypes($itemType) { + $backendTypes = array_keys(self::$backends); $parents = array($itemType); - foreach (self::$backendTypes as $type => $backend) { + foreach ($backendTypes as $type => $backend) { if (in_array($backend->dependsOn, $parents)) { $parents[] = $type; } @@ -497,7 +498,8 @@ class Share { // Check file extension for an equivalent item type to convert to if ($itemType == 'file') { $extension = strtolower(substr($item, strrpos($item, '.') + 1)); - foreach (self::$backendTypes as $type => $backend) { + $backendTypes = array_keys(self::$backends); + foreach ($backendTypes as $type => $backend) { if (isset($backend['dependsOn']) && $backend['dependsOn'] == 'file' && isset($backend['supportedFileExtensions']) && in_array($extension, $backend['supportedFileExtensions'])) { $itemType = $type; break; |