Skip to content

Commit

Permalink
Fix: remove getStringWithoutControlChars (#14964)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertSt7 committed Apr 20, 2023
1 parent 7e32cc2 commit 3b50ac0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 0 additions & 4 deletions bundles/AdminBundle/Resources/public/js/pimcore/helpers.js
Expand Up @@ -3289,7 +3289,3 @@ pimcore.helpers.treeDragDropValidate = function (node, oldParent, newParent) {

return true;
};

pimcore.helpers.getStringWithoutControlChars = function (text) {
return text.replace(/[<>"'`!?/\\%$(){};,:|=]/gi, '');
};
Expand Up @@ -141,7 +141,7 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({
var colId = data.data.colId;
var groupId = data.data.groupId;

Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_collection_relation'), pimcore.helpers.getStringWithoutControlChars(data.data.groupName)), function(btn) {
Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_collection_relation'), Ext.util.Format.htmlEncode(data.data.groupName)), function(btn) {
if (btn == 'yes') {
Ext.Ajax.request({
url: Routing.generate('pimcore_admin_dataobject_classificationstore_deletecollectionrelation'),
Expand Down Expand Up @@ -315,7 +315,7 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({
this.relationsGrid.hide();
this.relationsPanel.disable();

Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_collection'), pimcore.helpers.getStringWithoutControlChars(data.data.name)), function(btn) {
Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_collection'), Ext.util.Format.htmlEncode(data.data.name)), function(btn) {
if (btn == 'yes') {
Ext.Ajax.request({
url: Routing.generate('pimcore_admin_dataobject_classificationstore_deletecollection'),
Expand Down Expand Up @@ -410,7 +410,7 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({
},

addFieldComplete: function (button, value, object) {
value = pimcore.helpers.getStringWithoutControlChars(value).trim();
value = Ext.util.Format.htmlEncode(value).trim();
if (button == "ok" && value.length > 1) {
Ext.Ajax.request({
url: Routing.generate('pimcore_admin_dataobject_classificationstore_createcollection'),
Expand Down
Expand Up @@ -148,7 +148,7 @@ pimcore.object.classificationstore.groupsPanel = Class.create({
var keyId = data.data.keyId;
var groupId = data.data.groupId;

Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_relation'), pimcore.helpers.getStringWithoutControlChars(data.data.keyName)), function(btn) {
Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_relation'), Ext.util.Format.htmlEncode(data.data.keyName)), function(btn) {
if (btn == 'yes') {
Ext.Ajax.request({
url: Routing.generate('pimcore_admin_dataobject_classificationstore_deleterelation'),
Expand Down Expand Up @@ -319,7 +319,7 @@ pimcore.object.classificationstore.groupsPanel = Class.create({
var data = grid.getStore().getAt(rowIndex);
var id = data.data.id;

Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_group'), pimcore.helpers.getStringWithoutControlChars(data.data.name)), function(btn) {
Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_group'), Ext.util.Format.htmlEncode(data.data.name)), function(btn) {
if (btn == 'yes') {

//necessary for aborting all pending proxy requests
Expand Down Expand Up @@ -419,7 +419,7 @@ pimcore.object.classificationstore.groupsPanel = Class.create({
},

addFieldComplete: function (button, value, object) {
value = pimcore.helpers.getStringWithoutControlChars(value).trim();
value = Ext.util.Format.htmlEncode(value).trim();
if (button == "ok" && value.length > 1) {
Ext.Ajax.request({
url: Routing.generate('pimcore_admin_dataobject_classificationstore_creategroup'),
Expand Down
Expand Up @@ -198,7 +198,7 @@ pimcore.object.classificationstore.propertiespanel = Class.create({
var data = grid.getStore().getAt(rowIndex);
var id = data.data.id;

Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_property'), pimcore.helpers.getStringWithoutControlChars(data.data.name)), function(btn) {
Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('classificationstore_property'), Ext.util.Format.htmlEncode(data.data.name)), function(btn) {
if (btn == 'yes') {
Ext.Ajax.request({
url: Routing.generate('pimcore_admin_dataobject_classificationstore_deleteproperty'),
Expand Down Expand Up @@ -327,7 +327,7 @@ pimcore.object.classificationstore.propertiespanel = Class.create({
},

addFieldComplete: function (button, value, object) {
value = pimcore.helpers.getStringWithoutControlChars(value).trim();
value = Ext.util.Format.htmlEncode(value).trim();
if (button == "ok" && value.length > 1) {
Ext.Ajax.request({
url: Routing.generate('pimcore_admin_dataobject_classificationstore_addproperty'),
Expand Down

0 comments on commit 3b50ac0

Please sign in to comment.