From f21fdf14f9456b5a25c78f48d03063c383cdbdc2 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sun, 24 Jun 2012 19:25:41 -0400 Subject: [PATCH] Forgot I got rid of the class field backendTypes, use the array keys of the backends field instead --- core/js/share.js | 2 +- 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 9ba35616a4..b7821ce14b 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 b77a986f44..0ba4cefad9 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;