src/Service/Cdn.php
protected function isAllowedExt($sExtension, array $aAllowedExt)
    {
        $aAllowedExt = array_filter($aAllowedExt);

        if (empty($aAllowedExt)) {
            return true;
        }

        //  Sanitise and map common extensions
        $sExtension = $this->sanitiseExtension($sExtension);

        //  Sanitize allowed types
        $aAllowedExt = array_map([$this, 'sanitiseExtension'], $aAllowedExt);
        $aAllowedExt = array_unique($aAllowedExt);
        $aAllowedExt = array_values($aAllowedExt);

        //  Search
        return in_array($sExtension, $aAllowedExt);
    }
protected function isAllowedExt($sExtension, array $aAllowedExt)
    {
        $aAllowedExt = array_filter($aAllowedExt);

        if (empty($aAllowedExt)) {
            return true;
        }

        //  Sanitise and map common extensions
        $sExtension = $this->sanitiseExtension($sExtension);

        //  Sanitize allowed types
        $aAllowedExt = array_map([$this, 'sanitiseExtension'], $aAllowedExt);
        $aAllowedExt = array_unique($aAllowedExt);
        $aAllowedExt = array_values($aAllowedExt);

        //  Search
        return in_array($sExtension, $aAllowedExt);
    }
protected function isAllowedExt ( $ sExtension , array $ aAllowedExt ) { $ aAllowedExt = array_filter ( $ aAllowedExt ) ; if ( empty ( $ aAllowedExt ) ) { return true ; } //  Sanitise and map common extensions $ sExtension = $ this -> sanitiseExtension ( $ sExtension ) ; //  Sanitize allowed types $ aAllowedExt = array_map ( [ $ this , 'sanitiseExtension' ] , $ aAllowedExt ) ; $ aAllowedExt = array_unique ( $ aAllowedExt ) ; $ aAllowedExt = array_values ( $ aAllowedExt ) ; //  Search return in_array ( $ sExtension , $ aAllowedExt ) ; }
Determines whether a supplied extension is valid for a given array of acceptable extensions

@param string $sExtension  The extension to test
@param array  $aAllowedExt An array of valid extensions

@return boolean
Determines whether a supplied extension is valid for a given array of acceptable extensions