aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-09-29 18:16:03 -0700
commitbfdb9bb8a87a29038ba1ae25355684ae19678fdd (patch)
treea074e2d6bfa19c17b284c3950b4555cf584eabe2 /engine/lib/elgglib.php
parent7be23080f34a8f92ca1f8d49c3aa0e6ce3472f4c (diff)
parenta458ae4e0f8e5b19884860fead6e5f901b95eca4 (diff)
downloadelgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.gz
elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.bz2
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php10
1 files changed, 9 insertions, 1 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) {