I have a theme that needs to check if a CCK date field value is blank. Initially, I did this with a simple ...
if ($field_datetime_value)
... but since upgrading the date module, I'm getting strange non- empty "blank" strings, e.g. something that serializes to s:41:"". So, empty($field_datetime_value) returns false, strlen ($field_datetime_value) returns 41, strcmp($field_datetime_value, "") is positive, but the string *is* blank.
So two questions: (1) How does such a string ever get created (is this a PHP bug)? (2) If it's not a bug, how does one detect this kind of blank string?
See http://drupal.org/node/128778 for more details.