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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | no_bcmath.patch | 4.01 KB | bardkerbie |
Comments
Comment #1
bardkerbie commentedActually, I lied. This module won't work for any host which hasn't configured PHP with BCMath.
Comment #2
bardkerbie commentedI have created a patch that will work with hosts that have not configured PHP to support bc_math (like Dreamhost). Please review and advise.