Prevent type.properties check when accessing properties
of Java objects as skin macros.
This commit is contained in:
parent
a73255d123
commit
dee820e805
1 changed files with 11 additions and 6 deletions
|
@ -1020,7 +1020,7 @@ public class RequestEvaluator implements Runnable {
|
||||||
if (func != null && func instanceof FunctionPrototype)
|
if (func != null && func instanceof FunctionPrototype)
|
||||||
return true;
|
return true;
|
||||||
} catch (EcmaScriptException esx) {
|
} catch (EcmaScriptException esx) {
|
||||||
System.err.println ("Error in getProperty: "+esx);
|
// System.err.println ("Error in getProperty: "+esx);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1040,12 +1040,17 @@ public class RequestEvaluator implements Runnable {
|
||||||
"password".equalsIgnoreCase (propname))
|
"password".equalsIgnoreCase (propname))
|
||||||
return "[macro access to password property not allowed]";
|
return "[macro access to password property not allowed]";
|
||||||
|
|
||||||
|
// if this is a HopObject, check if the property is defined
|
||||||
|
// in the type.properties db-mapping.
|
||||||
|
if (obj instanceof INode) {
|
||||||
DbMapping dbm = app.getDbMapping (prototypeName);
|
DbMapping dbm = app.getDbMapping (prototypeName);
|
||||||
if (dbm != null) {
|
if (dbm != null) {
|
||||||
Relation rel = dbm.propertyToRelation (propname);
|
Relation rel = dbm.propertyToRelation (propname);
|
||||||
if (rel == null || !rel.isPrimitive ())
|
if (rel == null || !rel.isPrimitive ())
|
||||||
return "[property \""+propname+"\" is not defined for "+prototypeName+"]";
|
return "[property \""+propname+"\" is not defined for "+prototypeName+"]";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ESObject eso = getElementWrapper (obj);
|
ESObject eso = getElementWrapper (obj);
|
||||||
try {
|
try {
|
||||||
ESValue prop = eso.getProperty (propname, propname.hashCode());
|
ESValue prop = eso.getProperty (propname, propname.hashCode());
|
||||||
|
|
Loading…
Add table
Reference in a new issue