Does Stumble Have a Singular Plural Bug
September 22nd, 2007 adminI have noticed by chance that word “Fan” follows the number of fans for some stumblers, but for other stumblers the word “Fans” follows the number of fans. My be this is not a big deal and it does not even worth a blog post but curiosity kills the cat!
Ok after some investigations I think I know what is the problem .. it is most likely a bug in SU was caused by wrong comparison in PHP.
I think what happened is that the programmers in SU are using some thing like this to append the word “Fan” or “Fans”
<?
if ($fans > 1) {
print “fans” ;
else {
print “fan” ;
}
But the issue is that the programmers left the variable $fans without stripping the coma “,” so the comparison will be done on the number to the left of the coma “,” the numbers to the right will be ignored in this case .. so in this case stumblers with 2-999 fans and +2,000 fans are ok your will see “fans” follows their fans number .. But stumblers with 1,000-1,999 fans will see “fan” follows their fans number.
FANS
FAN
My StumbleUpon Page

