- Added a helper script to ease applying patches
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index c5b4ebe06a81c7077c2046dc99c9e3d0c00f3a9a..aa64808ec799516afa717c92c517f88d6642829f 100644 (file)
@@ -1649,6 +1649,15 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $dec /= 16;
                } while ($dec >= 1);
 
+               /*
+                * We need hexadecimal strings with leading zeros if the length cannot
+                * be divided by 2
+                */
+               if ((strlen($hex) % 2) != 0) {
+                       // Prepend a zero
+                       $hex = '0' . $hex;
+               } // END - if
+
                // Return the hexadecimal string
                return $sign . $hex;
        }
@@ -1676,9 +1685,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $dec    Decimal number
         * @return      $asc    An ASCII string
         */
-       public final function dec2asc ($deg) {
+       public final function dec2asc ($dec) {
                // First convert the number into a hexadecimal string
-               $hex = $this->dec2hex($deg);
+               $hex = $this->dec2hex($dec);
 
                // Then convert it into the ASCII string
                $asc = $this->hex2asc($hex);
@@ -1703,7 +1712,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                for ($idx = 0; $idx < strlen($hex); $idx+=2) {
                        // Get the decimal number of the chunk
                        $part = hexdec(substr($hex, $idx, 2));
-                       $this->debugOutput(__FUNCTION__ . ': part(' . strlen($part) . ')=' . $part);
 
                        // Add it to the final string
                        $asc .= chr($part);