From ad9e4e2f0f089cbe0727b098da1481d47288e413 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 13 Oct 2010 13:16:02 +0000 Subject: [PATCH] Fix for a single character string in a call to PHPExcel_Shared_Date::stringToExcel() being treated as a valid date git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@62207 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Shared/Date.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index 1d44463b..0c9bb605 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -277,6 +277,9 @@ class PHPExcel_Shared_Date * @return float|false Excel date/time serial value */ public static function stringToExcel($dateValue = '') { + if (strlen($dateValue) < 2) + return false; + $dateValueNew = PHPExcel_Calculation_Functions::DATEVALUE($dateValue); if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) {