From a52cc30a46e7d8b85ee84efd3ec51db0ae03f59b Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Fri, 21 Jul 2023 18:37:11 +0100 Subject: [PATCH 1/2] OPTIM: Stops checking other flow elements once an initial flowelement indicates that it requires the key. Improved the comment for the set method. --- Evidence.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Evidence.php b/Evidence.php index e0d225b..d3eecd0 100644 --- a/Evidence.php +++ b/Evidence.php @@ -43,7 +43,8 @@ public function __construct($flowData) } /** - * Set a single piece of evidence by its element and value + * If a flow element can use the key then add the key value pair to the + * evidence collection * @param string key * @param mixed value */ @@ -54,6 +55,7 @@ public function set($key, $value) foreach ($this->flowData->pipeline->flowElements as $flowElement) { if ($flowElement->filterEvidenceKey($key)) { $keep = true; + break; } } From 1893c6ffcbf37f374843e369fa48e8f06053be04 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Thu, 27 Jul 2023 20:59:06 +0100 Subject: [PATCH 2/2] CLEANUP: Removed error log messages. --- Evidence.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Evidence.php b/Evidence.php index d3eecd0..05ec3f1 100644 --- a/Evidence.php +++ b/Evidence.php @@ -111,18 +111,15 @@ public function setFromWebRequest($server = null, $cookies = null, $query = null $key = strtolower($key); - error_log("header." . $key . ": " . $value, 0); $evidence["header." . $key] = $value; } } foreach ($cookies as $key => $value) { - error_log("cookie." . $key . ": " . $value, 0); $evidence["cookie." . $key] = $value; } foreach ($query as $key => $value) { - error_log("query." . $key . ": " . $value, 0); $evidence["query." . $key] = $value; } @@ -153,7 +150,6 @@ public function setFromWebRequest($server = null, $cookies = null, $query = null $this->setArray($evidence); } - /** * Get a piece of evidence by key * @param string key