Changeset 5930


Ignore:
Timestamp:
01/12/12 19:45:25 (4 months ago)
Author:
vain
Message:
  • just fetch the extension when using pathinfo
  • ESCAPE_CHARS on addcslashes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/gettext.core.php

    r5706 r5930  
    194194     * 
    195195     * @param string $message 
     196     * 
     197     * @return string Html Log Message if logHandler resource is false. 
    196198     */ 
    197199    public function log($message) 
     
    245247        # It's a directory 
    246248        $resource = realpath($resource); 
     249 
    247250        if(false === $resource) 
    248251        { 
     
    317320 
    318321            # Check file extension 
    319             $info = pathinfo($inputFile); 
     322            $fileExtension = pathinfo($inputFile, PATHINFO_EXTENSION); 
    320323 
    321324            foreach($this->extractors as $extension => $extractor) 
    322325            { 
    323                 if($info['extension'] !== $extension) 
     326                if($fileExtension !== $extension) 
    324327                { 
    325328                    continue; 
     
    465468     * 
    466469     * @param boolean $return_string Boolean true returns string (default) and false returns array. 
     470     * 
    467471     * @return mixed Array or String. Returns string by default. 
    468472     */ 
     
    544548 
    545549    /** 
    546      * Escapes the given string, so it does not break the gettext syntax. 
     550     * Escapes a string without breaking gettext syntax. 
    547551     * 
    548552     * @param string $string 
     
    552556    public static function addSlashes($string) 
    553557    { 
    554         return addcslashes($string, '"'); 
     558        return addcslashes($string, self::ESCAPE_CHARS); 
    555559    } 
    556560} 
Note: See TracChangeset for help on using the changeset viewer.