From c21229cb8e91ebd30a28ad63aa87405faeafeee6 Mon Sep 17 00:00:00 2001 From: Carlos Lizaga Date: Tue, 14 Nov 2017 20:07:31 +0100 Subject: [PATCH] New validation: validate-no-utf8mb4-characters. --- .../product/view/options/type/text.phtml | 2 + .../jasmine/tests/lib/mage/validation.test.js | 72 +++++++++++++++++++ lib/web/i18n/en_US.csv | 1 + lib/web/mage/validation.js | 18 +++++ 4 files changed, 93 insertions(+) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml index 79dc8591fd724..11aedc33c2d42 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/text.phtml @@ -29,6 +29,7 @@ $class = ($_option->getIsRequire()) ? ' required' : ''; if ($_option->getMaxCharacters()) { $_textValidate['maxlength'] = $_option->getMaxCharacters(); } + $_textValidate['validate-no-utf8mb4-characters'] = true; ?> getIsRequire()) ? ' required' : ''; if ($_option->getMaxCharacters()) { $_textAreaValidate['maxlength'] = $_option->getMaxCharacters(); } + $_textAreaValidate['validate-no-utf8mb4-characters'] = true; ?>