/** A variable inside ($$varname). */
private AbstractVariable variable;
+ private static final String _GET = "_GET";
+ private static final String _POST = "_POST";
+ private static final String _REQUEST = "_REQUEST";
+ private static final String _SERVER = "_SERVER";
+ private static final String _SESSION = "_SESSION";
+ private static final String _this = "this";
+
/**
* Create a new simple variable.
* @param name the name
* @return the variables used
*/
public List getUsedVariable() {
- final ArrayList list = new ArrayList(1);
+ final String varName;
if (name == null) {
- list.add(new VariableUsage(variable.getName(), sourceStart));
+ varName = variable.getName();
} else {
- list.add(new VariableUsage(name, sourceStart));
+ varName = name;
}
+ if (name.equals(_GET) ||
+ name.equals(_POST) ||
+ name.equals(_REQUEST) ||
+ name.equals(_SERVER) ||
+ name.equals(_SESSION) ||
+ name.equals(_this)) {
+ return new ArrayList(1);
+ }
+ final ArrayList list = new ArrayList(1);
+ list.add(new VariableUsage(varName, sourceStart));
return list;
}
}