diff --git a/libraries.module b/libraries.module index c92bd01..596c86c 100644 --- a/libraries.module +++ b/libraries.module @@ -584,17 +584,12 @@ function libraries_load_files($library) { foreach (array('js', 'css') as $type) { if (!empty($library['files'][$type])) { foreach ($library['files'][$type] as $data => $options) { - // If the value is not an array, it's a filename and passed as first - // (and only) argument. - if (!is_array($options)) { - // Prepend the library path to the file name. - $data = "$path/$options"; - $options = NULL; - } - // In some cases, the first parameter ($data) is an array. Arrays can't - // be passed as keys in PHP, so we have to get $data from the value - // array. - if (is_numeric($data)) { + // $data is now always the filename due to libraries_prepare_files() so + // prepend the library path to it + $data = "$path/$data"; + + // Allow the data to be set in the options array? + if (isset($options['data'])) { $data = $options['data']; unset($options['data']); }