Changeset 2849

Show
Ignore:
Timestamp:
11/23/08 20:29:23 (7 weeks ago)
Author:
bjohnson
Message:

Fixing a few broken items in the Bitmask class.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/bitmask.php

    r2848 r2849  
    3838                break; 
    3939            default: 
    40                 if ( ! is_bool( $flags ) ) 
     40                if ( ! is_bool( $on ) ) 
    4141                    throw new InvalidArgumentException(_t('Bitmask values must be boolean')); 
    4242                if( is_string( $bit ) ) { 
    43                     $bit = array_search( $bit, $this->value ); 
     43                    $bit = array_search( $bit, $this->flags ); 
    4444                } 
    45                 if( !is_int( $bit ) ) 
     45                else if( ! is_int( $bit ) ) { 
    4646                    throw new InvalidArgumentException(_t('Bitmask names must be pre-defined strings or bitmask indexes')); 
    47                 if( $on ) { 
     47                } 
     48                if ( $on ) { 
    4849                    $this->value |= pow( 2, $bit ); 
    4950                } 
     
    5960     * Magic getter method for flag status 
    6061     * 
    61      * @param bit   integer representing th emask bit to test 
     62     * @param bit integer representing the mask bit to test 
    6263     * @return boolean 
    6364     */ 
    64     public function __get( $bi t) { 
     65    public function __get( $bit ) { 
    6566        if ( is_int( $bit ) ) { 
    6667            $flags = array_values( $this->flags );