Changed VEvent.isConfirmed to return VEvent.DEFAULT_CONFIRMED when no status is defined. This is because alot of calendars doesn't have the status field, and returning false isn't always what's wanted.

No sure what the RFC says, couldn't find the default value for STATUS
master
fangel 2008-03-19 09:35:14 +00:00
rodzic 87bf23b6d0
commit db3e10f5a2
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -14,6 +14,7 @@
* @license http://creativecommons.org/licenses/by-sa/2.5/dk/deed.en_GB CC-BY-SA-DK
*/
class SG_iCal_VEvent {
const DEFAULT_CONFIRMED = true;
private $uid;
private $start;
private $end;
@ -103,7 +104,11 @@ class SG_iCal_VEvent {
* @return bool
*/
public function isConfirmed() {
return (isset($this->data['status']) && $this->data['status'] == 'CONFIRMED');
if( !isset($this->data['status']) ) {
return self::DEFAULT_CONFIRMED;
} else {
return $this->data['status'] == 'CONFIRMED';
}
}
/**