Невозможно развернуть приложение реагирования на AWS beanstalk, код ошибки: ошибка 128

Для тех, у кого есть тот же вопрос, здесь мое решение:

В wp-includes/functions.php:

add_filter('wpcf7_validate_file*', 'cf7_custom_file_validation', 10, 2);
add_filter('wpcf7_validate_file', 'cf7_custom_file_validation', 10, 2);

function cf7_custom_file_validation ($result, $tag) {
    if ($tag->name === 'file-586') {
        $contentType = mime_content_type($_FILES[$tag->name]['tmp_name']);

        if ($contentType !== 'image/png' && $contentType !== 'image/jpeg' && $contentType !== 'application/pdf') {
            $result->invalidate($tag, 'Ce type de fichier n\'est pas supporté');
        }
    }

    return $result;
}
1
задан James Z 19 January 2019 в 10:07
поделиться