From f0131c028252ac4134b1e4d7be10e3e31c7aafe8 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Tue, 28 Sep 2010 15:53:49 +0000 Subject: [PATCH] Bugfix: Modified PHPExcel_Shared_Date::isDateTimeFormatCode() to return false if format code begins with "_" or with "0 " to prevent false positives These leading characters are most commonly associated with number, currency or accounting (or occasionally fraction) formats git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@61632 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Shared/Date.php | 4 ++++ changelog.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index 01695392..1d44463b 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -256,6 +256,10 @@ class PHPExcel_Shared_Date return true; } + // Typically number, currency or accounting (or occasionally fraction) formats + if ((substr($pFormatCode,0,1) == '_') || (substr($pFormatCode,0,2) == '0 ')) { + return false; + } // Try checking for any of the date formatting characters that don't appear within square braces if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i',$pFormatCode)) { return true; diff --git a/changelog.txt b/changelog.txt index ffc201a4..65659539 100644 --- a/changelog.txt +++ b/changelog.txt @@ -46,6 +46,8 @@ Fixed in SVN: - Bugfix: (MBaker) Workitem 14256 - Worksheet title exception when duplicate worksheet is being renamed but exceeds the 31 character limit - Bugfix: (MBaker) Workitem 14086 - Named range with sheet name that contains the $ throws exception when getting the cell - Bugfix: (MBaker) Added autoloader to DefaultValueBinder and AdvancedValueBinder +- Bugfix: (MBaker) Modified PHPExcel_Shared_Date::isDateTimeFormatCode() to return false if format code begins with "_" or with "0 " to prevent false positives + These leading characters are most commonly associated with number, currency or accounting (or occasionally fraction) formats 2010-08-26 (v1.7.4):