Changeset 519


Ignore:
Timestamp:
May 2, 2015 7:50:19 PM (9 years ago)
Author:
anonymous
Message:
 
Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Upload.inc.php

    r518 r519  
    475475
    476476    /**
    477      * Returns the extension of a file name, or an empty string if non exists.
     477     * Returns the extension of a file name, or an empty string if none exists.
    478478     *
    479479     * @access  public
  • trunk/lib/Utilities.inc.php

    r518 r519  
    563563}
    564564
     565/**
     566 * Returns the extension of a file name, or an empty string if none exists.
     567 *
     568 * @access  public
     569 * @param   string  $file_name  A name of a file, with extension after a dot.
     570 * @return  string              The value found after the dot
     571 */
     572function getFilenameExtension($file_name)
     573{
     574    preg_match('/.*?\.(\w+)$/i', trim($file_name), $ext);
     575    return isset($ext[1]) ? $ext[1] : '';
     576}
     577
    565578/*
    566579* Convert a php.ini value (8M, 512K, etc), into integer value of bytes.
Note: See TracChangeset for help on using the changeset viewer.