note 96356 modified in reserved.variables.server by danbrown
| From: | danbrown@php.net | 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?<script>...
--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?<script>...
http://php.net/manual/en/reserved.variables.server.php