cvs: presentations /slides/intro xss1.xml xss_charset.xml

From: Date: Mon, 12 Feb 2007 16:42:53 +0000
Subject: cvs: presentations /slides/intro xss1.xml xss_charset.xml
Groups: php.pres 
Request: Send a blank email to pres+get-1379@lists.php.net to get a copy of this message
rasmus Mon Feb 12 16:42:53 2007 UTC Modified files: /presentations/slides/intro xss1.xml xss_charset.xml Log: Tweaks http://cvs.php.net/viewvc.cgi/presentations/slides/intro/xss1.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/xss1.xml diff -u presentations/slides/intro/xss1.xml:1.2 presentations/slides/intro/xss1.xml:1.3 --- presentations/slides/intro/xss1.xml:1.2 Wed Oct 19 07:53:54 2005 +++ presentations/slides/intro/xss1.xml Mon Feb 12 16:42:53 2007 @@ -1,14 +1,14 @@ <slide title="Fixing XSS"> <break lines="1" /> -<example fontsize="1.4em" title="Safe Form Handling" result="1"><![CDATA[<form action="<?php echo htmlspecialchars($PHP_SELF)?>" method="POST"> +<example fontsize="1.4em" title="Safe Form Handling" result="1"><![CDATA[<form action="<?php echo htmlspecialchars($PHP_SELF, ENT_QUOTES)?>" method="POST"> Your name: <input type=text name=name><br> You age: <input type=text name=age><br> <input type=submit> </form> <?php if($_SERVER['REQUEST_METHOD']=='POST') { - $Oname = htmlspecialchars($_POST['name']); + $Oname = htmlspecialchars($_POST['name'], ENT_QUOTES); $Oage = (int)$_POST['age']; echo <<<EOB Hi $Oname, you are $Oage years old. http://cvs.php.net/viewvc.cgi/presentations/slides/intro/xss_charset.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/xss_charset.xml diff -u presentations/slides/intro/xss_charset.xml:1.2 presentations/slides/intro/xss_charset.xml:1.3 --- presentations/slides/intro/xss_charset.xml:1.2 Wed Sep 13 14:23:24 2006 +++ presentations/slides/intro/xss_charset.xml Mon Feb 12 16:42:53 2007 @@ -3,14 +3,14 @@ <blurb>Common approach to treat user data for display purposes</blurb> -<example fontsize="1.4em" title="Safe Form Handling" result="0"><![CDATA[<form action="<?php echo htmlspecialchars($PHP_SELF)?>" method="POST"> +<example fontsize="1.4em" title="Safe Form Handling" result="0"><![CDATA[<form action="<?php echo htmlspecialchars($PHP_SELF, ENT_QUOTES)?>" method="POST"> Your name: <input type="text" name="name" /><br> You age: <input type="text" name="age" /><br> <input type="submit" /> </form> <?php if($_SERVER['REQUEST_METHOD']=='POST') { - $Oname = htmlspecialchars($_POST['name']); + $Oname = htmlspecialchars($_POST['name'], ENT_QUOTES); $Oage = (int)$_POST['age']; echo "Hi $Oname, you are $Oage years old."; }?>]]></example>

« previous php.pres (#1379) next »