Java

Javaで単純なサニタイズ

More than 3 years have passed since last update.
private String replaceInput(String inputData){
    String outputData = inputData;

    outputData = outputData.replace("&", "&");
    outputData = outputData.replace("\"", """);
    outputData = outputData.replace("<", "&lt;");
    outputData = outputData.replace(">", "&gt;");
    outputData = outputData.replace("'", "&#39;");

    return outputData;
}