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
This commit is contained in:
Mark Baker 2010-10-13 13:16:02 +00:00
parent 10634822fe
commit ad9e4e2f0f
1 changed files with 3 additions and 0 deletions

View File

@ -277,6 +277,9 @@ class PHPExcel_Shared_Date
* @return float|false Excel date/time serial value * @return float|false Excel date/time serial value
*/ */
public static function stringToExcel($dateValue = '') { public static function stringToExcel($dateValue = '') {
if (strlen($dateValue) < 2)
return false;
$dateValueNew = PHPExcel_Calculation_Functions::DATEVALUE($dateValue); $dateValueNew = PHPExcel_Calculation_Functions::DATEVALUE($dateValue);
if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) { if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) {