summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoshbrown812018-10-01 21:25:39 (GMT)
committerJoseph Olstad2018-10-01 21:38:43 (GMT)
commit4d5014d6c55437a62294bb6c5d3cbeb6b4339f71 (patch)
tree26d42ab476c00afa33bf0a49ca4dd3d4c7dae0ac
parenta720031dfcfa18926457ab459a300eba8c366957 (diff)
Issue #2999116 by iceman2202, Anghelu, joseph.olstad, joshbrown81: Finds no library after update7.x-3.x
-rw-r--r--libraries.module7
1 files changed, 7 insertions, 0 deletions
diff --git a/libraries.module b/libraries.module
index fa964f4..32b6a65 100644
--- a/libraries.module
+++ b/libraries.module
@@ -123,6 +123,13 @@ function libraries_get_libraries() {
$profile = drupal_get_path('profile', drupal_get_profile());
$config = conf_path();
+ // $config and $profile should never be empty in a proper Drupal setup.
+ // However, we should never search into the root filesystem under any
+ // circumstances, so just bail out in that case.
+ if (!$profile && !$config) {
+ return array();
+ }
+
// Similar to 'modules' and 'themes' directories in the root directory,
// certain distributions may want to place libraries into a 'libraries'
// directory in Drupal's root directory.