]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 4 Dec 2020 06:39:32 +0000 (07:39 +0100)
committerRoland Häder <roland@mxchange.org>
Fri, 4 Dec 2020 06:39:32 +0000 (07:39 +0100)
- shouldn't the header array being set after it has been hex-decoded?

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/stacker/file/class_BaseFileStack.php

index 7ea25c11285fdb6602113575a57d7c33066094d6..7bf00c4f674866427423a5ebd6f6b8de838cb905 100644 (file)
@@ -154,9 +154,6 @@ abstract class BaseFileStack extends BaseStacker {
                 */
                $header = explode(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA), $data);
 
-               // Set header here
-               $this->getIteratorInstance()->setHeader($header);
-
                // Check if the array has only 3 elements
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: header(%d)=%s', count($header), print_r($header, true)));
                if (count($header) != 3) {
@@ -191,6 +188,9 @@ abstract class BaseFileStack extends BaseStacker {
                $header[1] = hex2bin($header[1]);
                $header[2] = hex2bin($header[2]);
 
+               // Set header here
+               $this->getIteratorInstance()->setHeader($header);
+
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: EXIT!', __METHOD__, __LINE__));
        }