Project:Site Pass
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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.

Comments

#1

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

#2

Status:active» needs review

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.

AttachmentSize
no_bcmath.patch 4.01 KB
nobody click here