From a5efe15030ef212ff2a2914c74cc00b94b9f0c4a Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 6 Feb 2014 14:13:37 +0100 Subject: [PATCH] Fixed #1173 #486 #466 #483 ignore E_NOTICE unpack() errors --- src/utils/Utils.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/utils/Utils.php b/src/utils/Utils.php index 62faeb2f8..4651e4ab8 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -121,7 +121,7 @@ class Utils{ } public static function readTriad($str){ - list(,$unpacked) = unpack("N", "\x00".$str); + list(,$unpacked) = @unpack("N", "\x00".$str); return $unpacked; } @@ -457,7 +457,7 @@ class Utils{ } public static function readShort($str, $signed = true){ - list(,$unpacked) = unpack("n", $str); + list(,$unpacked) = @unpack("n", $str); if($unpacked > 0x7fff and $signed === true){ $unpacked -= 0x10000; // Convert unsigned short to signed short } @@ -472,7 +472,7 @@ class Utils{ } public static function readLShort($str, $signed = true){ - list(,$unpacked) = unpack("v", $str); + list(,$unpacked) = @unpack("v", $str); if($unpacked > 0x7fff and $signed === true){ $unpacked -= 0x10000; // Convert unsigned short to signed short } @@ -487,7 +487,7 @@ class Utils{ } public static function readInt($str){ - list(,$unpacked) = unpack("N", $str); + list(,$unpacked) = @unpack("N", $str); if($unpacked >= 2147483648){ $unpacked -= 4294967296; } @@ -502,7 +502,7 @@ class Utils{ } public static function readLInt($str){ - list(,$unpacked) = unpack("V", $str); + list(,$unpacked) = @unpack("V", $str); if($unpacked >= 2147483648){ $unpacked -= 4294967296; } @@ -517,7 +517,7 @@ class Utils{ } public static function readFloat($str){ - list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("f", $str):unpack("f", strrev($str)); + list(,$value) = ENDIANNESS === BIG_ENDIAN ? @unpack("f", $str):@unpack("f", strrev($str)); return $value; } @@ -526,7 +526,7 @@ class Utils{ } public static function readLFloat($str){ - list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("f", strrev($str)):unpack("f", $str); + list(,$value) = ENDIANNESS === BIG_ENDIAN ? @unpack("f", strrev($str)):@unpack("f", $str); return $value; } @@ -539,7 +539,7 @@ class Utils{ } public static function readDouble($str){ - list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("d", $str):unpack("d", strrev($str)); + list(,$value) = ENDIANNESS === BIG_ENDIAN ? @unpack("d", $str):@unpack("d", strrev($str)); return $value; } @@ -548,7 +548,7 @@ class Utils{ } public static function readLDouble($str){ - list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("d", strrev($str)):unpack("d", $str); + list(,$value) = ENDIANNESS === BIG_ENDIAN ? @unpack("d", strrev($str)):@unpack("d", $str); return $value; }