-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I've got regexes inserted directly into a MySQL database, how do I convert html entities to their safe equivalents using a MySQL query?
EDI: The data is already in the database.
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi!
I am using an XMLHttpRequest to POST a JSON string to PHP. The JSON object is created in JavaScript and using the JSON2.js from json.org to create an JSON string representing the object.
JSON.stringify(object);
Whenever the object contains a string which has a special character in it, e.g.…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I use DOMDocument. My code here.
$dom = new DOMDocument('1.0', 'utf-8');
$textNode = $dom->createTextNode('<input type="text" name="lastName" />');
$dom->appendChild($textNode);
echo $dom->saveHTML();
Output:
<input type="text" name="lastName" >
But i want to…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a form that, among other things, accepts an image for upload and sticks it in the database. Previously I had a function filtering the POSTed data that was basically:
function processInput($stuff) {
$formdata = $stuff;
$formdata = htmlentities($formdata, ENT_QUOTES);
return "'"…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi everyone,
I was wondering if converting POST input from an HTML form into html entities, (via the PHP function htmlentities() or using the FILTER_SANITIZE_SPECIAL_CHARS constant in tandem with the filter_input() PHP function ), will help defend against any attacks where a user attempts to insert…
>>> More