diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-09-28 22:39:53 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-09-28 22:40:46 -0700 |
commit | a458ae4e0f8e5b19884860fead6e5f901b95eca4 (patch) | |
tree | a074e2d6bfa19c17b284c3950b4555cf584eabe2 /engine/lib | |
parent | 1a44b71e0cd65a009c0fb54ca11825b75528a327 (diff) | |
download | elgg-a458ae4e0f8e5b19884860fead6e5f901b95eca4.tar.gz elgg-a458ae4e0f8e5b19884860fead6e5f901b95eca4.tar.bz2 |
Fixes #3891. elgg_register_external_file() defaults priority to 500. Elgg's default CSS now at 500 instead of 1.
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 10 | ||||
-rw-r--r-- | engine/lib/views.php | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 198ffe60c..7bdc5972a 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -278,7 +278,7 @@ function elgg_get_loaded_css() { * @return bool * @since 1.8.0 */ -function elgg_register_external_file($type, $name, $url, $location, $priority = null) { +function elgg_register_external_file($type, $name, $url, $location, $priority = 500) { global $CONFIG; if (empty($name) || empty($url)) { @@ -291,7 +291,15 @@ function elgg_register_external_file($type, $name, $url, $location, $priority = elgg_bootstrap_externals_data_structure($type); $name = trim(strtolower($name)); + + // normalize bogus priorities, but allow empty, null, and false to be defaults. + if (!is_numeric($priority)) { + $priority = 500; + } + + // no negative priorities right now. $priority = max((int)$priority, 0); + $item = elgg_extract($name, $CONFIG->externals_map[$type]); if ($item) { diff --git a/engine/lib/views.php b/engine/lib/views.php index 3b9448c71..c31f61e84 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1575,7 +1575,7 @@ function elgg_views_boot() { elgg_register_css('lightbox', $lightbox_css_url); $elgg_css_url = elgg_get_simplecache_url('css', 'elgg'); - elgg_register_css('elgg', $elgg_css_url, 1); + elgg_register_css('elgg', $elgg_css_url); elgg_load_css('elgg'); elgg_register_plugin_hook_handler('output:before', 'layout', 'elgg_views_add_rss_link'); |