Assembla home | Assembla project page
 

Changeset 241

Show
Ignore:
Timestamp:
04/14/08 23:49:37 (7 months ago)
Author:
tobias382
Message:

Fixed a bug in the Autojoin plugin where keys in the autojoin.channels setting were not being parsed (thanks to weierophinney)

Files:

Legend:

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

    r232 r241  
    8383                $channels = $this->getPluginIni('channels'); 
    8484                if (!empty($channels)) { 
    85                     $this->doJoin(implode(',', preg_split('#[, ]+#', $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                      } 
    86101                } 
    87102            break;