Assembla home | Assembla project page
 

Changeset 160

Show
Ignore:
Timestamp:
03/11/08 05:00:59 (9 months ago)
Author:
Seldaek
Message:

* Base: Some "undefined index" notices fixed

Files:

Legend:

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

    r153 r160  
    224224    public function decodeTranslit($text, $charSetFrom = 'UTF-8', $charSetTo = 'ISO-8859-1') { 
    225225        $text = html_entity_decode($text, ENT_QUOTES, $charSetFrom); 
    226         $text = preg_replace('/&#0*([0-9]+);/me', "$this->codeToUtf(\\1)", $text); 
    227         $text = preg_replace('/&#x0*([a-f0-9]+);/mei', "$this->codeToUtf(hexdec(\\1))", $text); 
     226        $text = preg_replace('/&#0*([0-9]+);/me', '$this->codeToUtf(\\1)', $text); 
     227        $text = preg_replace('/&#x0*([a-f0-9]+);/mei', '$this->codeToUtf(hexdec(\\1))', $text); 
    228228 
    229229        // Use the translit extension if installed else fallback on to basic transliteration 
     
    234234            $text = transliterate($text, array('han_transliterate', 'diacritical_remove'), $charSetFrom, $charSetTo); 
    235235        } else { 
    236             $text = strtr($text, '��������������������������', 
     236            $text = strtr($text, '��������������������������������������������������������������', 
    237237                                 'AAAAAAACEEEEIIIIDNOOOOOOUUUUYPYaaaaaaaceeeeiiiidnoooooouuuuypy'); 
    238238            $text = preg_replace('{[^a-z0-9&|"#\'\{\}()�^!�\[\]$*���%�`~=+:/;.,?><\\ _-]}i', '', $text); 
     
    507507        // Silence output calls if the plugin is muted for that source or globally 
    508508        $source = trim($arguments[0]); 
    509         if (($source && $this->muted[$source] || $this->muted['global']) && substr($method, 0, 2) === 'do') { 
     509        if ((($source && isset($this->muted[$source]) && $this->muted[$source]) || 
     510                (isset($this->muted['global']) && $this->muted['global'])) && 
     511                substr($method, 0, 2) === 'do') { 
    510512                return false; 
    511513        }