public function attachmentsHaveApprovedFileExtensions($mappedVars) {

        if ($mappedVars['number_of_attachments'] == 0) {
            return true;
        }

        $approvedFileExtensions = config('lasallecmsemail.inbound_attachments_approved_file_extensions');
        if (empty($approvedFileExtensions)) {
            return true;
        }


        for ($i = 1; $i <= $mappedVars['number_of_attachments']; $i++) {
            $fileExtension = strtolower($mappedVars['attachment-'.$i]->getClientOriginalExtension());

            if (!in_array($fileExtension, $approvedFileExtensions)) {
                return false;
            }
        }

        return true;
    }
public function attachmentsHaveApprovedFileExtensions($mappedVars) {

        if ($mappedVars['number_of_attachments'] == 0) {
            return true;
        }

        $approvedFileExtensions = config('lasallecmsemail.inbound_attachments_approved_file_extensions');
        if (empty($approvedFileExtensions)) {
            return true;
        }


        for ($i = 1; $i <= $mappedVars['number_of_attachments']; $i++) {
            $fileExtension = strtolower($mappedVars['attachment-'.$i]->getClientOriginalExtension());

            if (!in_array($fileExtension, $approvedFileExtensions)) {
                return false;
            }
        }

        return true;
    }
public function attachmentsHaveApprovedFileExtensions ( $ mappedVars ) { if ( $ mappedVars [ 'number_of_attachments' ] == 0 ) { return true ; } $ approvedFileExtensions = config ( 'lasallecmsemail.inbound_attachments_approved_file_extensions' ) ; if ( empty ( $ approvedFileExtensions ) ) { return true ; } for ( $ i = 1 ; $ i <= $ mappedVars [ 'number_of_attachments' ] ; $ i ++ ) { $ fileExtension = strtolower ( $ mappedVars [ 'attachment-' . $ i ] -> getClientOriginalExtension ( ) ) ; if ( ! in_array ( $ fileExtension , $ approvedFileExtensions ) ) { return false ; } } return true ; }
All attachments have approved file extensions?

@param  array  $mappedVars     Inbound POST vars mapped to database fields
@return bool
All attachments have approved file extensions?