Development

Changeset 1330

You must first sign up to be able to contribute.

Changeset 1330

Show
Ignore:
Timestamp:
05/09/06 16:34:45 (4 years ago)
Author:
fabien
Message:

fixed sfI18N::getDateForCulture raises notices if an invalid date is passed (closes #515)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/i18n/sfI18N.class.php

    r745 r1330  
    175175 
    176176    // We find all elements 
    177     preg_match("~$dateRegexp~", $date, $matches); 
    178  
    179     // We get matching timestamp 
    180     return array($matches[$datePositions['d']], $matches[$datePositions['m']], $matches[$datePositions['y']]); 
     177    if (preg_match("~$dateRegexp~", $date, $matches)) 
     178    { 
     179      // We get matching timestamp 
     180      return array($matches[$datePositions['d']], $matches[$datePositions['m']], $matches[$datePositions['y']]); 
     181    } 
     182    else 
     183    { 
     184      return null; 
     185    } 
    181186  } 
    182187} 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.