From 780cb7478209b82db236cb718f20f1e7850b3d5b Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 3 Aug 2014 22:02:46 +0100 Subject: [PATCH] URL Hyperlink data may not use the full length of the data field, but could instead be terminated by a null byte character --- Classes/PHPExcel/Reader/Excel5.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classes/PHPExcel/Reader/Excel5.php b/Classes/PHPExcel/Reader/Excel5.php index 97c3df3c..f2893ece 100644 --- a/Classes/PHPExcel/Reader/Excel5.php +++ b/Classes/PHPExcel/Reader/Excel5.php @@ -4562,6 +4562,9 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce $offset += 4; // offset: var; size: $us; character array of the URL, no Unicode string header, always 16-bit characters, zero-terminated $url = self::_encodeUTF16(substr($recordData, $offset, $us - 2), false); + $nullOffset = strpos($url, 0x00); + if ($nullOffset) + $url = substr($url,0,$nullOffset); $url .= $hasText ? '#' : ''; $offset += $us; break;