Skip to content

Commit

Permalink
XSS in the tree
Browse files Browse the repository at this point in the history
  • Loading branch information
AgelxNash committed Feb 6, 2019
1 parent 2004980 commit 5b090a6
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions manager/assets/modext/util/utilities.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Ext.namespace('MODx.util.Progress');
/**
* A JSON Reader specific to MODExt
*
*
* @class MODx.util.JSONReader
* @extends Ext.util.JSONReader
* @param {Object} config An object of configuration properties
Expand All @@ -20,7 +20,7 @@ Ext.extend(MODx.util.JSONReader,Ext.data.JsonReader);
Ext.reg('modx-json-reader',MODx.util.JSONReader);

/**
* @class MODx.util.Progress
* @class MODx.util.Progress
*/
MODx.util.Progress = {
id: 0
Expand Down Expand Up @@ -66,7 +66,7 @@ Ext.override(Ext.form.BasicForm,{
nodeToRecurse = nodeToRecurse || this;
nodeToRecurse.items.each(function(f){
if (!f.getValue) return;

if(f.items){
this.clearDirty(f);
} else if(f.originalValue != f.getValue()){
Expand All @@ -77,7 +77,7 @@ Ext.override(Ext.form.BasicForm,{
});


/**
/**
* Static Textfield
*/
MODx.StaticTextField = Ext.extend(Ext.form.TextField, {
Expand All @@ -91,7 +91,7 @@ MODx.StaticTextField = Ext.extend(Ext.form.TextField, {
});
Ext.reg('statictextfield',MODx.StaticTextField);

/**
/**
* Static Boolean
*/
MODx.StaticBoolean = Ext.extend(Ext.form.TextField, {
Expand All @@ -103,7 +103,7 @@ MODx.StaticBoolean = Ext.extend(Ext.form.TextField, {
MODx.StaticBoolean.superclass.onRender.apply(this, arguments);
this.on('change',this.onChange,this);
}

,setValue: function(v) {
if (v === 1) {
this.addClass('green');
Expand Down Expand Up @@ -147,13 +147,13 @@ Ext.form.setCheckboxValues = function(form,id,mask) {
while ((f = form.findField(id+n)) !== null) {
f.setValue((mask & (1<<n))?'true':'false');
n=n+1;
}
}
};

Ext.form.getCheckboxMask = function(cbgroup) {
var mask='';
if (typeof(cbgroup) !== 'undefined') {
if ((typeof(cbgroup)==='string')) {
if ((typeof(cbgroup)==='string')) {
mask = cbgroup+'';
} else {
for(var i=0,len=cbgroup.length;i<len;i=i+1) {
Expand Down Expand Up @@ -218,7 +218,7 @@ Ext.form.HourField = function(id,name,v){
,editable: false
,value: v || 1
,transform: id
});
});
};


Expand All @@ -229,7 +229,7 @@ Ext.override(Ext.tree.TreeNodeUI,{
return className && (' '+el.dom.className+' ').indexOf(' '+className+' ') !== -1;
}
,renderElements : function(n, a, targetNode, bulkRender){

this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';

var cb = Ext.isBoolean(a.checked),
Expand All @@ -247,7 +247,7 @@ Ext.override(Ext.tree.TreeNodeUI,{
iconMarkup,
cb ? ('<input class="x-tree-node-cb" type="checkbox" ' + (a.checked ? 'checked="checked" />' : '/>')) : '',
'<a hidefocus="on" class="x-tree-node-anchor" href="',href,'" tabIndex="1" ',
a.hrefTarget ? ' target="'+a.hrefTarget+'"' : "", '><span unselectable="on">',n.text,"</span></a></div>",
a.hrefTarget ? ' target="'+a.hrefTarget+'"' : "", '><span unselectable="on">',Ext.util.Format.htmlEncode(n.text),"</span></a></div>",
'<ul class="x-tree-node-ct" style="display:none;"></ul>',
"</li>"].join('');

Expand All @@ -266,7 +266,7 @@ Ext.override(Ext.tree.TreeNodeUI,{
var index = 3;
if(cb){
this.checkbox = cs[3];

this.checkbox.defaultChecked = this.checkbox.checked;
index++;
}
Expand Down Expand Up @@ -295,8 +295,8 @@ Ext.override(Ext.tree.TreeNodeUI,{


/* allows for messages in JSON responses */
Ext.override(Ext.form.Action.Submit,{
handleResponse : function(response){
Ext.override(Ext.form.Action.Submit,{
handleResponse : function(response){
var m = Ext.decode(response.responseText); /* shaun 7/11/07 */
if (this.form.errorReader) {
var rs = this.form.errorReader.read(response);
Expand All @@ -320,7 +320,7 @@ Ext.override(Ext.form.Action.Submit,{
});

/* QTips to form fields */
Ext.form.Field.prototype.afterRender = Ext.form.Field.prototype.afterRender.createSequence(function() {
Ext.form.Field.prototype.afterRender = Ext.form.Field.prototype.afterRender.createSequence(function() {
if (this.description) {
Ext.QuickTips.register({
target: this.getEl()
Expand Down Expand Up @@ -350,7 +350,7 @@ Ext.applyIf(Ext.form.Field,{
}
wrapDiv = field.getEl().up('div.x-form-item');
if(wrapDiv) {
label = wrapDiv.child('label');
label = wrapDiv.child('label');
}
if(label){
return label;
Expand All @@ -365,7 +365,7 @@ MODx.util.Clipboard = function() {
text = encodeURIComponent(text);
return text.replace(/%0A/g, "%0D%0A");
}

,copy: function(text){
if (Ext.isIE) {
window.clipboardData.setData("Text", text);
Expand All @@ -375,10 +375,10 @@ MODx.util.Clipboard = function() {
var divholder = document.createElement('div');
divholder.id = flashcopier;
document.body.appendChild(divholder);
}
document.getElementById(flashcopier).innerHTML = '';
}
document.getElementById(flashcopier).innerHTML = '';
var divinfo = '<embed src="' + MODx.config.manager_url
+ 'assets/modext/_clipboard.swf" FlashVars="clipboard='
+ 'assets/modext/_clipboard.swf" FlashVars="clipboard='
+ MODx.util.Clipboard.escape(text)
+ '" width="0" height="0" type="application/x-shockwave-flash"></embed>';
document.getElementById(flashcopier).innerHTML = divinfo;
Expand Down Expand Up @@ -408,7 +408,7 @@ Ext.ns('Ext.ux.grid');if('function'!==typeof RegExp.escape){RegExp.escape=functi
* Ext JS Library 0.30
* Copyright(c) 2006-2009, Ext JS, LLC.
* [email protected]
*
*
* http://extjs.com/license
*/
Ext.SwitchButton = Ext.extend(Ext.Component, {
Expand Down Expand Up @@ -489,7 +489,7 @@ Ext.SwitchButton = Ext.extend(Ext.Component, {
}
return item;
},

onClick : function(e){
var target = e.getTarget('td', 2);
if(!this.disabled && target){
Expand Down

0 comments on commit 5b090a6

Please sign in to comment.