From 6ed64440a84895bf048c484ae69efafcd2400514 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 16 Feb 2014 02:08:10 +0100 Subject: [PATCH] decodedData is an array and needs some assertitions on array elements. Signed-off-by: Roland Haeder --- .../hub/main/decoder/package/class_PackageDecoder.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/hub/main/decoder/package/class_PackageDecoder.php b/application/hub/main/decoder/package/class_PackageDecoder.php index 5bb4abf3e..e8010141e 100644 --- a/application/hub/main/decoder/package/class_PackageDecoder.php +++ b/application/hub/main/decoder/package/class_PackageDecoder.php @@ -73,7 +73,7 @@ class PackageDecoder extends BaseDecoder implements Decodeable { $unhandledDataLeft = (!$this->getHandlerInstance()->getStackerInstance()->isStackEmpty(ChunkHandler::STACKER_NAME_ASSEMBLED_RAW_DATA)); // Return it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: unhandledDataLeft=' . intval($unhandledDataLeft)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: unhandledDataLeft=' . intval($unhandledDataLeft)); return $unhandledDataLeft; } @@ -95,8 +95,11 @@ class PackageDecoder extends BaseDecoder implements Decodeable { // "Decode" the raw package content by using the NetworkPackage instance $decodedData = $this->getPackageInstance()->decodeRawContent($rawPackageContent); + // Some checks + assert(is_array($decodedData)); + // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData()=' . strlen($decodedData) . ' ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData(' . count($decodedData) . ')=' . print_r($decodedData, TRUE)); // Next get a recipient-discovery instance $discoveryInstance = PackageDiscoveryFactory::createPackageDiscoveryInstance(); -- 2.39.5