Skip to content
Snippets Groups Projects
Commit 9714cfd7 authored by Dave Reid's avatar Dave Reid
Browse files

Ensure that explode() does not mess up a library name with a colon in it.

parent 6a80aadb
No related branches found
No related tags found
No related merge requests found
......@@ -71,13 +71,13 @@ function library_attach_set_view_mode_libraries($entity_type, $bundle, $view_mod
function library_attach_add_libraries($libraries, &$render_element = NULL) {
if (isset($render_element) && is_array($render_element)) {
foreach ($libraries as $key) {
list($module, $name) = explode(':', $key);
list($module, $name) = explode(':', $key, 2);
$render_element['#attached']['library'][] = array($module, $name);
}
}
else {
foreach ($libraries as $key) {
list($module, $name) = explode(':', $key);
list($module, $name) = explode(':', $key, 2);
drupal_add_library($module, $name);
}
}
......
......@@ -26,7 +26,7 @@ class library_attach_plugin_display_extender_libraries extends views_plugin_disp
protected function getLibrarySummary(array $libraries) {
$library_names = array();
foreach ($libraries as $key) {
list($module, $name) = explode(':', $key);
list($module, $name) = explode(':', $key, 2);
if ($library = drupal_get_library($module, $name)) {
$library_names[] = check_plain($library['title']);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment