diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index 065ebe7..5150dfe 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -262,6 +262,18 @@ class PHPExcel_Shared_Date } // Try checking for any of the date formatting characters that don't appear within square braces if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i',$pFormatCode)) { + // We might also have a format mask containing quoted strings... + // we don't want to test for any of our characters within the quoted blocks + if (strpos($pFormatCode,'"') !== false) { + $i = false; + foreach(explode('"',$pFormatCode) as $subVal) { + // Only test in alternate array entries (the non-quoted blocks) + if (($i = !$i) && (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i',$subVal))) { + return true; + } + } + return false; + } return true; } diff --git a/changelog.txt b/changelog.txt index 29cf724..054ae6f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -59,6 +59,7 @@ Fixed in SVN: Default row argument for all __ByColumnAndRow() methods should be 1 - Bugfix: (MBaker) Work item 15121 - Column reference rather than cell reference in Print Area definition Fix Excel2007 Writer to handle print areas that are defined as row or column ranges rather than just as cell ranges +- Bugfix: (MBaker) Reduced false positives from isDateTimeFormatCode() method by suppressing testing within quoted strings - General: (MBaker) Improved performance (speed), for building the Shared Strings table in the Excel2007 Writer. - General: (MBaker) Enhanced SheetViews element structures in the Excel2007 Writer for frozen panes.