I just upgraded my server to PHP 5.3.1 from PHP 5.1.6 and the stamps.com plugin stopped working. I got similar errors and made these changes and now it is working.
Changed the function GetServerTimeOffsetFromUTC portion to:
PHP Code:
###################################### Get offset of server time from UTC #######################
/*Calculate offset along with direction i.e. + or - from GMT/UTC*/
##################################################################################################
function GetServerTimeOffsetFromUTC()
{
date_default_timezone_set('America/Los_Angeles');
$offset=date("O") / 100 * 60 * 60;
return $offset; // Seconds from GMT
}
And changed the Function FormatNumber($number) portion to:
PHP Code:
############################################## Function FormatNumber ##########################
//Formats number to money format
##################################################################################################
function FormatNumber($number)
{
if($number!="")
{
$matches="";
$floats="";
preg_match_all('!\d+(?:\.\d+)?!', $number, $matches);
$floats = array_map('floatval', $matches[0]);
if($number==true){
$number=$floats[0];
}
return number_format($number,2,'.','');
}
else
return "0.00";
}
Hope that helps someone. Seems to be back to normal working for me now.
Bookmarks