Changeset 2996

Show
Ignore:
Timestamp:
07/08/2008 04:17:51 AM (5 months ago)
Author:
Geert
Message:

Small optimization to file::extension()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/file.php

    r2646 r2996  
    1515         * Get the extension of a filename. 
    1616         * 
    17          * @param   string   filename 
     17         * @param   string  filename 
    1818         * @return  string 
    1919         */ 
     
    2121        { 
    2222                // Return the extension of the filename 
    23                 return preg_replace('/^.+\.(.+?)$/', '$1', $filename); 
     23                return ltrim(substr($filename, strrpos($filename, '.')), '.'); 
    2424        } 
    2525