note 96356 modified in reserved.variables.server by danbrown

From: Date: Tue, 23 Feb 2010 01:42:23 +0000
Subject: note 96356 modified in reserved.variables.server by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-166273@lists.php.net to get a copy of this message
It makes sense to want to paste the $_SERVER['REQUEST_URI'] on to a page (like on a footer), but be sure to clean it up first with htmlspecialchars() otherwise it poses a cross-site scripting vulnerability. htmlspecialchars($_SERVER['REQUEST_URI']); e.g. http://www.example.com/foo?<script>... becomes http://www.example.com/foo?&lt;script&gt;... --was-- It makes sense to want to paste the $_SERVER['REQUEST_URI'] on to a page (like on a footer), but be sure to clean it up first with htmlspecialchars() otherwise it poses a cross-site scripting vulnerability. htmlspecialchars($_SERVER['REQUEST_URI']); e.g. http://yoursite/foo?<script>... becomes http://yoursite/foo?&lt;script&gt;... http://php.net/manual/en/reserved.variables.server.php

« previous php.notes (#166273) next »