From: Bradley Taylor Date: Sat, 8 Jan 2022 17:59:27 +0000 (+0000) Subject: Remove htmlFile validation rule, X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b138c3d2dc36d4ae10169d24acabdf265477d6f6;p=civicrm-core.git Remove htmlFile validation rule, as it can't possibly work. --- diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 3cf3e8304f..5808968e0b 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -374,7 +374,6 @@ class CRM_Core_Form extends HTML_QuickForm_Page { 'date', 'currentDate', 'asciiFile', - 'htmlFile', 'utf8File', 'objectExists', 'optionExists', diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 862e4603f7..6d84ad5ec4 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -755,24 +755,6 @@ class CRM_Utils_Rule { return $success; } - /** - * See how file rules are written in HTML/QuickForm/file.php - * Checks to make sure the uploaded file is html - * - * @param array $elementValue - * - * @return bool - * True if file has been uploaded, false otherwise - */ - public static function htmlFile($elementValue) { - if ((isset($elementValue['error']) && $elementValue['error'] == 0) || - (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none') - ) { - return CRM_Utils_File::isHtmlFile($elementValue['tmp_name']); - } - return FALSE; - } - /** * Check if there is a record with the same name in the db. *