Changeset 2675

Show
Ignore:
Timestamp:
05/15/08 14:22:13 (3 months ago)
Author:
Shadowhand
Message:

Fixing a bug in Calendar_Event due to strict type checking. This should solve some user complaints.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Calendar_Event.php

    r2598 r2675  
    1111 */ 
    1212class Calendar_Event_Core extends Event_Observer { 
     13 
     14    // Boolean conditions 
     15    protected $booleans = array 
     16    ( 
     17        'current', 
     18        'weekend', 
     19        'first_day', 
     20        'last_day', 
     21        'last_occurrence', 
     22        'easter', 
     23    ); 
    1324 
    1425    // Rendering conditions 
     
    5465        else 
    5566        { 
     67            if ($key === 'callback') 
     68            { 
     69                // Do nothing 
     70            } 
     71            elseif (in_array($key, $this->booleans)) 
     72            { 
     73                // Make the value boolean 
     74                $value = (bool) $value; 
     75            } 
     76            else 
     77            { 
     78                // Make the value an int 
     79                $value = (int) $value; 
     80            } 
     81 
    5682            $this->conditions[$key] = $value; 
    5783        }