Bugfix: Work item 11576 - AdvancedValueBinder.php: String sometimes becomes a date when it shouldn't. Improved with a preg_match trap to reject unlikely formats for dates before passing value to PHPExcel_Shared_Date::stringToExcel() for final validation

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@67536 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2011-01-29 17:05:02 +00:00
parent 5e27d037bc
commit 956cc7a2cf
2 changed files with 3 additions and 0 deletions

View File

@ -279,6 +279,8 @@ class PHPExcel_Shared_Date
public static function stringToExcel($dateValue = '') {
if (strlen($dateValue) < 2)
return false;
if (!preg_match('/^(\d{1,4}[ \.\/\-][A-Z]{3,9}([ \.\/\-]\d{1,4})?|[A-Z]{3,9}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?|\d{1,4}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?)( \d{1,2}:\d{1,2}(:\d{1,2})?)?$/iu', $dateValue))
return false;
$dateValueNew = PHPExcel_Calculation_DateTime::DATEVALUE($dateValue);

View File

@ -51,6 +51,7 @@ Fixed in SVN:
- Bugfix: (MBaker) Work item 15129 - Worksheet fromArray() only working with 2-D arrays
- Bugfix: (MBaker) Work item 15172 - rangeToarray function modified for non-existent cells
- Bugfix: (MBaker) Work item 14980 - Images not getting copyied with the ->clone function
- Bugfix: (MBaker) Work item 11576 - AdvancedValueBinder.php: String sometimes becomes a date when it shouldn't
- General: (MBaker) Improved performance (speed), for building the Shared Strings table in the Excel2007 Writer.