From 63d7f109d8cf0fdd4898c453bdaf7ebecad8c7ba Mon Sep 17 00:00:00 2001 From: michalis Date: Tue, 24 Oct 2023 18:34:07 +0300 Subject: [PATCH] escape html on adminhtml form + added placeholders on missing text --- .../Translator/Block/Adminhtml/Csv/Edit/Form.php | 6 +++--- composer.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/local/InternetCode/Translator/Block/Adminhtml/Csv/Edit/Form.php b/app/code/local/InternetCode/Translator/Block/Adminhtml/Csv/Edit/Form.php index 6e16f04..2e7fe73 100644 --- a/app/code/local/InternetCode/Translator/Block/Adminhtml/Csv/Edit/Form.php +++ b/app/code/local/InternetCode/Translator/Block/Adminhtml/Csv/Edit/Form.php @@ -59,18 +59,18 @@ protected function _prepareForm() $fieldset->addField('fallback', 'note', [ 'label' => 'Fallback text from another module', - 'text' => $model->getFallback() ?? 'no fallback text', + 'text' => ''.($model->getFallback() ?? 'no fallback text').'', ]); $fieldset->addField('view_text', 'note', [ 'label' => 'Text that needs translation', - 'text' => $model->getText(), + 'text' => ''.$this->escapeHtml($model->getText()).'', ]); $fieldset->addField('new_text', 'text', [ 'name' => 'new_text', 'label' => $this->_getHelper()->__('Enter Translation'), - 'value' => $model->getTranslation(), + 'value' => $model->getTranslation() ?? $model->getText(), 'required' => true ]); diff --git a/composer.json b/composer.json index ebc96e8..4b3cec2 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "m-michalis/om-translator", "type": "magento-module", "license": "GPL-3.0", - "version": "0.1.3", + "version": "0.1.4", "homepage": "https://github.com/m-michalis/om-translator", "description":"The \"Translation Management\" module simplifies translation tasks in OpenMage by providing an efficient way to create and update missing and existing translations from various modules. This module offers a user-friendly grid/edit dashboard in the Admin panel, allowing you to manage translations with ease. Additionally, it can detect and capture missing translations when browsing the frontend.", "keywords": [