I apologize, that code was really lame.... Here is some better code:
(I've read that some versions of PHP don't null terminate strings-if that is the case and $signature is not null terminated this code will run right off the buffer, so be sure to test this before deploying.)
Code:
if ($maxlinessig!=0) {
// check signature lines
$a = 1;
$counter =0;
$linecount =0;
$maxcounter = 50;
while($signature[$a] <> ""){
$counter++;
if($signature[$a]==" "){
$maxcounter=67;
}
if($signature[$a] == "\n" or $counter > $maxcounter)
{
$linecount++;
$counter = 0;
$maxcounter=50;
}
$a++;
}
if($linecount>=$maxlinessig){
eval("standarderror(\"".gettemplate("error_sigtoolong")."\");");
exit;
}
}