aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-12-10 15:35:22 -0500
committerBrett Profitt <brett.profitt@gmail.com>2012-12-10 15:35:22 -0500
commit4c517db146cb1c59c8a54d9e87b9e5a4ae17987e (patch)
treea6f595a26fb9a48c042c67ec9b7709b8b1ae5128 /engine/lib/elgglib.php
parent93e83fd9a7016e0b37ced978434c258dd69e6954 (diff)
parent3a47b126b392afe4eaab58ffa869d104cbd779ec (diff)
downloadelgg-4c517db146cb1c59c8a54d9e87b9e5a4ae17987e.tar.gz
elgg-4c517db146cb1c59c8a54d9e87b9e5a4ae17987e.tar.bz2
Merge branch '1.8' of github.com:Elgg/Elgg into 1.8
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index dd3cba25d..540605876 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -710,9 +710,12 @@ function elgg_register_event_handler($event, $object_type, $callback, $priority
*/
function elgg_unregister_event_handler($event, $object_type, $callback) {
global $CONFIG;
- foreach ($CONFIG->events[$event][$object_type] as $key => $event_callback) {
- if ($event_callback == $callback) {
- unset($CONFIG->events[$event][$object_type][$key]);
+
+ if (isset($CONFIG->events[$event]) && isset($CONFIG->events[$event][$object_type])) {
+ foreach ($CONFIG->events[$event][$object_type] as $key => $event_callback) {
+ if ($event_callback == $callback) {
+ unset($CONFIG->events[$event][$object_type][$key]);
+ }
}
}
}
@@ -889,9 +892,12 @@ function elgg_register_plugin_hook_handler($hook, $type, $callback, $priority =
*/
function elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback) {
global $CONFIG;
- foreach ($CONFIG->hooks[$hook][$entity_type] as $key => $hook_callback) {
- if ($hook_callback == $callback) {
- unset($CONFIG->hooks[$hook][$entity_type][$key]);
+
+ if (isset($CONFIG->hooks[$hook]) && isset($CONFIG->hooks[$hook][$entity_type])) {
+ foreach ($CONFIG->hooks[$hook][$entity_type] as $key => $hook_callback) {
+ if ($hook_callback == $callback) {
+ unset($CONFIG->hooks[$hook][$entity_type][$key]);
+ }
}
}
}
@@ -1073,8 +1079,8 @@ function _elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
case E_USER_WARNING :
case E_RECOVERABLE_ERROR: // (e.g. type hint violation)
- // check if the error wasn't suppressed by @-functionname
- if(error_reporting()){
+ // check if the error wasn't suppressed by the error control operator (@)
+ if (error_reporting()) {
error_log("PHP WARNING: $error");
}
break;