From 59a837f82e686483e6954dd780f5c99413c0e19e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 18 Mar 2007 18:01:33 +0000 Subject: [PATCH] r1501: We can actually simplify Logging::compare_arrays() by removing the array_diff() business because it really isn't necessary it turns out and was actually responsible for adding a whole bunch of useless logs to the system --- docs/changes.txt | 1 + includes/class_logging.php | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index cfc0678..99d12c0 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -13,6 +13,7 @@ - Fixed: In the product-level permissions screens, not all the products would always show up - Fixed: A minor display issue would occur in a rare instance when showing an error message when trying to add a version without a product - Fixed: If any fields had invalid data in editreport.php no errors would be thrown +- Fixed: The Logging system would add extra empty logs that would pollute the database; fixed this and then added queries in showhistory.php to clean it up 1.2.0 Beta 1 =============================== diff --git a/includes/class_logging.php b/includes/class_logging.php index dfceac7..c5f8092 100644 --- a/includes/class_logging.php +++ b/includes/class_logging.php @@ -176,9 +176,6 @@ class Logging */ function compare_arrays() { - $newfields = array_diff_assoc($this->modified, $this->original); - $removedfields = array_diff_assoc($this->original, $this->modified); - foreach ($this->modified AS $key => $value) { if ($this->original["$key"] != $value AND !($value['value'] == '' AND $this->original["$key"]['value'] == '0') AND !($this->original["$key"]['value'] == '' AND $value['value'] == '0')) @@ -186,16 +183,6 @@ class Logging $this->compared["$key"] = array('old' => $this->original["$key"]['value'], 'new' => $this->modified["$key"]['value']); } } - - foreach ($newfields AS $field) - { - $this->compared["$field"] = array('old' => null, 'new' => $this->modified["$field"]['value']); - } - - foreach ($removedfields AS $field) - { - $this->compared["$field"] = array('old' => $this->original["$field"]['value'], 'new' => null); - } } // ################################################################### -- 2.22.5