Assembla home | Assembla project page
 

Changeset 243

Show
Ignore:
Timestamp:
04/15/08 00:33:00 (7 months ago)
Author:
tobias382
Message:

Fixed a bug with the last patch to the Autojoin plugin where JOIN commands for non-keyed channels weren't working correctly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Phergie/Plugin/Autojoin.php

    r241 r243  
    8383                $channels = $this->getPluginIni('channels'); 
    8484                if (!empty($channels)) { 
    85                       $spec = preg_split('/(?<!,) /', $channels); 
    86                       if (count($spec) > 1) { 
    87                           $channels = explode(',', $spec[0]); 
    88                           $keys = explode(',', $spec[1]); 
    89                           array_walk($channels, 'trim'); 
    90                           array_walk($keys, 'trim'); 
    91                           foreach ($channels as $key => $channel) { 
    92                               if (array_key_exists($key, $keys)) { 
    93                                   $this->doJoin($channel, $keys[$key]); 
    94                               } else { 
    95                                   $this->doJoin($channel); 
    96                               } 
    97                           } 
    98                       } else { 
    99                           $this->doJoin(implode(' ', preg_split('#[, ]+#', $channels))); 
    100                       } 
     85                    $spec = explode(' ', $channels);  
     86                    if (count($spec) > 1) { 
     87                        $this->doJoin($spec[0], $spec[1]); 
     88                    } else { 
     89                        $this->doJoin($spec[0]); 
     90                    } 
    10191                } 
    102             break; 
     92                               break; 
    10393        } 
    10494    }