concrete/src/File/ValidationService.php
public function extension($filename, $extensions = null)
    {
        $f = Loader::helper('file');
        $ext = strtolower($f->getExtension($filename));
        if (isset($extensions) && is_array($extensions) && count($extensions)) {
            $allowed_extensions = $extensions;
        } else { // pull from constants
            $extensions_string = strtolower(str_replace(array("*", "."), "", Config::get('concrete.upload.extensions')));
            $allowed_extensions = explode(";", $extensions_string);
        }

        return in_array($ext, $allowed_extensions);
    }
public function extension($filename, $extensions = null)
    {
        $f = Loader::helper('file');
        $ext = strtolower($f->getExtension($filename));
        if (isset($extensions) && is_array($extensions) && count($extensions)) {
            $allowed_extensions = $extensions;
        } else { // pull from constants
            $extensions_string = strtolower(str_replace(array("*", "."), "", Config::get('concrete.upload.extensions')));
            $allowed_extensions = explode(";", $extensions_string);
        }

        return in_array($ext, $allowed_extensions);
    }
public function extension ( $ filename , $ extensions = null ) { $ f = Loader :: helper ( 'file' ) ; $ ext = strtolower ( $ f -> getExtension ( $ filename ) ) ; if ( isset ( $ extensions ) && is_array ( $ extensions ) && count ( $ extensions ) ) { $ allowed_extensions = $ extensions ; } else { // pull from constants $ extensions_string = strtolower ( str_replace ( array ( "*" , "." ) , "" , Config :: get ( 'concrete.upload.extensions' ) ) ) ; $ allowed_extensions = explode ( ";" , $ extensions_string ) ; } return in_array ( $ ext , $ allowed_extensions ) ; }
Parses the file extension for a given file name, checks it to see if it's in the the extension array if provided
if not, it checks to see if it's in the concrete.upload.extensions configuration option.

@param string $filename
@param array $extensions

@return bool
Parses the file extension for a given file name checks it to see if it s in the the extension array if provided if not it checks to see if it s in the concrete . upload . extensions configuration option .