Problem I need to split a string by a separator but don’t want to split if the separator is prefixed […]
Tag: escaping
Sanitzing input on form submit with PHP
Problem I was hacking around this morning and wanting to use automatically generate safe-to-use variables from $_POST. Probably not the […]
Ask for user input and again on the same line
Problem A function that asks for user input according to some criteria and again on the same line if the […]
My method of escaping MySQL strings in C++
Problem This is how I’m currently escaping MySQL strings in C++: std::string escapeSQL(const char* dataIn) { if (!MySQL_Database_Connection__global->host) int a […]
Displaying text extracted from XML using PHP simplexml
Problem I have this xml file and i am parsing it with php simplexml. My XML file looks like this: […]
Escaped line reader
Problem The idiomatic way of reading lines from a file doesn’t work for my purposes because the files I’m dealing […]
Wielding .NET masterfully to encode non-alphanumeric characters into utf-8 hex representation
Problem I have these two methods that work, but I also hate because they almost certainly can be improved. I’m […]
Escape user input for use in JS regex
Problem I am building a highlight feature for search results on my website and need to escape the user’s input […]
XSS Protection from Query Strings in Java
Problem Looking for input on the code below. Generally, the idea is to take a String representing a URL query […]