Are you 100% sure that line 12 is checking $quota? Could it be a check on $limit?
If user_can_set_email_limit=0 then it the $limit wouldn't be passed at all.
But checking the code, if quota is not a number, it shouldn't be able to get past that point.
If "quota=unlimited" is set, it should error out before anything with "That is not a valid quota".
Anyway, please confirm exactly what check is done on your line 12, and we can continue to dig.
Side-note, I've added:
user_can_set_email_limit=0|1
to the script, as that would be required info to know if the $limit variable should even be checked, as if user_can_set_email_limit=0, then $limit won't be present at all.
John