Google Speed Tips Get Picked Apart
mashable.com
mashable.com
GOOD: echo $_POST['description'];
That really should not have made it past their editorial process.Had they concatenated a small string to the end then PHP wouldn't copied the data and used the MB of memory they alluded to.
That whole document was half baked at best.
EDIT: I went to look at the document to reference the example and noticed that they changed their example. It used to be:
$description = $_POST['description'];
echo $description;
And now it's:
In the following example, imagine if a malicious user had inserted 512KB worth of characters into a textarea field. This would result in 1MB of memory being used!
$description = strip_tags($_POST['description']);
echo $description;
There's no reason to copy the variable above, you can simply do this operation inline and avoid the extra memory consumption:
echo strip_tags($_POST['description']);
So someone is definitely working on making the examples at least match the description.
#foo p span{
color: #fff;
}#my_foo_span{ color:#fff }.