]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4487 turned off logging for sites that haven't been upgraded with ip address...
authorCash Costello <cash.costello@gmail.com>
Sun, 17 Jun 2012 22:53:37 +0000 (18:53 -0400)
committerCash Costello <cash.costello@gmail.com>
Sun, 17 Jun 2012 22:53:37 +0000 (18:53 -0400)
engine/lib/system_log.php

index 28d90be5673fff762bc42c09a4f911772a0d8be5..53fa245571ac0749727ec74da7812444632c7c64 100644 (file)
@@ -156,9 +156,8 @@ function get_object_from_log_entry($entry_id) {
  * This is called by the event system and should not be called directly.
  *
  * @param object $object The object you're talking about.
- * @param string $event  String The event being logged
- *
- * @return mixed
+ * @param string $event  The event being logged
+ * @return void
  */
 function system_log($object, $event) {
        global $CONFIG;
@@ -166,6 +165,12 @@ function system_log($object, $event) {
        static $cache_size = 0;
 
        if ($object instanceof Loggable) {
+
+               if (datalist_get('version') < 2012012000) {
+                       // this is a site that doesn't have the ip_address column yet
+                       return;
+               }
+
                // reset cache if it has grown too large
                if (!is_array($log_cache) || $cache_size > 500) {
                        $log_cache = array();
@@ -213,8 +218,6 @@ function system_log($object, $event) {
                        $log_cache[$time][$object_id][$event] = true;
                        $cache_size += 1;
                }
-
-               return true;
        }
 }