public function validateFileExtension($value, array $validValues)
    {
        if (isset($validValues[0]) && is_array($validValues[0])) {
            $validValues = $validValues[0];
        }

        $partials  = explode('.', $value['name']);
        $extension = array_pop(
            $partials
        );

        return in_array($extension, $validValues);
    }
public function validateFileExtension($value, array $validValues)
    {
        if (isset($validValues[0]) && is_array($validValues[0])) {
            $validValues = $validValues[0];
        }

        $partials  = explode('.', $value['name']);
        $extension = array_pop(
            $partials
        );

        return in_array($extension, $validValues);
    }
public function validateFileExtension ( $ value , array $ validValues ) { if ( isset ( $ validValues [ 0 ] ) && is_array ( $ validValues [ 0 ] ) ) { $ validValues = $ validValues [ 0 ] ; } $ partials = explode ( '.' , $ value [ 'name' ] ) ; $ extension = array_pop ( $ partials ) ; return in_array ( $ extension , $ validValues ) ; }
Validates that passed file upload has extension exactly
matching one within passed valid values for that.

@param array $value       A file upload array structure (object) like $_SESSION
@param array $validValues The valid values to validation against

@author Benjamin Carl <opensource@clickalicious.de>

@return bool TRUE if could be validated, otherwise FALSE
Validates that passed file upload has extension exactly matching one within passed valid values for that .