forked from loafle/openapi-generator-original
better code injectino handling for perl client
This commit is contained in:
@@ -373,7 +373,8 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
return underscore("call_" + operationId);
|
||||
}
|
||||
|
||||
return underscore(operationId);
|
||||
//return underscore(operationId).replaceAll("[^A-Za-z0-9_]", "");
|
||||
return underscore(sanitizeName(operationId));
|
||||
}
|
||||
|
||||
public void setModuleName(String moduleName) {
|
||||
@@ -403,4 +404,15 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeQuotationMark(String input) {
|
||||
return input.replace("'", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeUnsafeCharacters(String input) {
|
||||
// remove =end, =cut to avoid code injection
|
||||
return input.replace("=end", "").replace("=cut", "");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user