utils: html_xss(): Add ' and &
They REALLY should have been there from the beginning...
This commit is contained in:
		@@ -46,6 +46,12 @@ std::string utils::html_xss(std::string_view str)
 | 
				
			|||||||
		case '%':
 | 
							case '%':
 | 
				
			||||||
			result += "%";
 | 
								result += "%";
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
 | 
							case '\'':
 | 
				
			||||||
 | 
								result += "'";
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
 | 
							case '&':
 | 
				
			||||||
 | 
								result += "&";
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
			result += c;
 | 
								result += c;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -93,7 +99,7 @@ std::vector<std::string> utils::split(const std::string &str, char delim)
 | 
				
			|||||||
// TODO: can easily break if we pass a regex here
 | 
					// TODO: can easily break if we pass a regex here
 | 
				
			||||||
std::vector<std::string> utils::split(const std::string &str, const std::string &delim)
 | 
					std::vector<std::string> utils::split(const std::string &str, const std::string &delim)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	std::regex regex { delim + "+" };
 | 
						std::regex regex{delim + "+"};
 | 
				
			||||||
	return split(str, regex);
 | 
						return split(str, regex);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user