note 17609 added to function.system
| From: | ted at qwasicom dot com | Date: | Mon, 17 Dec 2001 04:21:08 +0000 |
| Subject: | note 17609 added to function.system | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-22962@lists.php.net to get a copy of this message | ||
To make sure someone doesn't rm -rf $SERVER_ROOT or something of that nature when taking user
feedback in a command here is a below limiter, $server is the input from a form.
<?php
$bad1=";";
$bad2="|";
$bad3="&";
if(strstr($server,$bad1) || strstr($server,$bad2) || strstr($server,$bad3)) {
echo "<H1>You will not hack me!</H1>";
} else if ((isset($server)) && ($server!="")) {
strip_tags($server);
system("ab -w $server/");
}
?>
--
http://www.php.net/manual/en/function.system.php
http://master.php.net/manage/user-notes.php?action=edit+17609
http://master.php.net/manage/user-notes.php?action=delete+17609
http://master.php.net/manage/user-notes.php?action=reject+17609