better check for bad spans
authorChuck Hagenbuch <chuck@horde.org>
Fri, 22 May 2009 02:51:26 +0000 (22:51 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Fri, 22 May 2009 15:57:32 +0000 (11:57 -0400)
framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php

index 5cf3388..da61cae 100644 (file)
@@ -195,9 +195,10 @@ class Horde_Date_Parser_Locale_Base
      */
     public function guess($span)
     {
-        if (empty($span)) {
+        if (! $span instanceof Horde_Date_Span) {
             return null;
         }
+
         if ($span->width() > 1) {
             return $span->begin->add($span->width() / 2);
         } else {