mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 20:35:16 +00:00
Fixed security breach in conversations system
This commit is contained in:
@ -289,4 +289,31 @@ function checkString(value){
|
||||
//Success, the string seems to be valid
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove HTML carachters : < and >
|
||||
*
|
||||
* @param {String} input The string to change
|
||||
* @return {String} The updated string
|
||||
*/
|
||||
function removeHtmlTags(input){
|
||||
|
||||
//Prepare update
|
||||
var output = input;
|
||||
|
||||
//Replace opening braces
|
||||
while(output.includes("<")){
|
||||
//Replace an occurence
|
||||
output = output.replace("<", "<");
|
||||
}
|
||||
|
||||
//Replace closing braces
|
||||
while(output.includes(">")){
|
||||
//Replace an occurence
|
||||
output = output.replace(">", ">");
|
||||
}
|
||||
|
||||
//Return result
|
||||
return output;
|
||||
}
|
Reference in New Issue
Block a user