cvs: peardoc /en/package/authentication/auth-prefmanager tutorial.xml

From: Date: Fri, 08 Jul 2005 20:32:33 +0000
Subject: cvs: peardoc /en/package/authentication/auth-prefmanager tutorial.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-6486@lists.php.net to get a copy of this message
danielc Fri Jul 8 16:32:33 2005 EDT Modified files: /peardoc/en/package/authentication/auth-prefmanager tutorial.xml Log: * Fix rest of examples to escape user input. http://cvs.php.net/diff.php/peardoc/en/package/authentication/auth-prefmanager/tutorial.xml?r1=1.4&r2=1.5&ty=u Index: peardoc/en/package/authentication/auth-prefmanager/tutorial.xml diff -u peardoc/en/package/authentication/auth-prefmanager/tutorial.xml:1.4 peardoc/en/package/authentication/auth-prefmanager/tutorial.xml:1.5 --- peardoc/en/package/authentication/auth-prefmanager/tutorial.xml:1.4 Mon Jun 13 13:05:17 2005 +++ peardoc/en/package/authentication/auth-prefmanager/tutorial.xml Fri Jul 8 16:32:31 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.authentication.auth-prefmanager.tutorial"> <refnamediv> <refname> @@ -107,10 +107,10 @@ <h1>Set Country</h1> // Allow users to set their country and username. if (isset($_POST['submit'])) { - $username = $_POST['username']; + $username = htmlspecialchars($_POST['username']); $prefmanager->setPref($username, 'country', $_POST['country']); } else if (isset($_POST['reset'])) { - $username = $_POST['username']; + $username = htmlspecialchars($_POST['username']); $prefmanager->deletePref($username, 'country'); } else { $username = 'guest'; @@ -150,10 +150,10 @@ // Allow users to set their country and username. if (isset($_POST['submit'])) { - $username = $_POST['username']; + $username = htmlspecialchars($_POST['username']); $prefmanager->setPref($username, 'country', $_POST['country']); } else if (isset($_POST['reset'])) { - $username = $_POST['username']; + $username = htmlspecialchars($_POST['username']); $prefmanager->deletePref($username, 'country'); } else { $username = 'guest'; @@ -161,7 +161,7 @@ ?> <h1>Welcome to the people of <?=$prefmanager->getPref($username, "country")?>!</h1> <h2>Set Country And Username</h2> -<form method="post" action="<?=$_SERVER['PHP_SELF']?>"> +<form method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>"> <label for="username">Username</label> <input name="username" value="<?=$username?>" /><br/> <label for="country">Country</label> <input name="country" value="<?=$prefmanager->getPref($username, 'country')?>"/><br/> <input type="submit" name="submit" value="Set Country" /> <input type="submit" name="reset" value="Reset Country" />

« previous php.pear.doc (#6486) next »