Another quick and dirty sanitisation:
$var = $_GET["somevar"];
$i = 0;
while ($i < strlen($var) && $var[$i] != ";" && $var != "'") $i++;
$var = substr($var, 0, $i);
This will trim $var to the first instance of ; or ' appearing, or leave the string as-is if neither appear
(note: this particular implementation from memory, & untested)
|