I received a blank page when trying to generate a sitepass. The error log returned the following information:

PHP Fatal error: Call to undefined function bcadd() in /home/[redacted]/public_html/modules/sitepass/sitepass.module on line 549, referer: http://[redacted]/node/add

Here is the code in question, beginning at line 548:

 //$decimal = ($decimal * $base) + $pos;
 $decimal = bcadd(bcmul($decimal, $base), $pos);

I investigated the offending code on line 549 and discovered that while bcmul was passing a string to bcadd, $pos is an integer. bcadd calls for two strings. Luckily, I commented out that line and uncommented the one above (548) it to make it work properly.

CommentFileSizeAuthor
#2 no_bcmath.patch4.01 KBbardkerbie

Comments

bardkerbie’s picture

Actually, I lied. This module won't work for any host which hasn't configured PHP with BCMath.

bardkerbie’s picture

Status: Active » Needs review
StatusFileSize
new4.01 KB

I have created a patch that will work with hosts that have not configured PHP to support bc_math (like Dreamhost). Please review and advise.