From b7b9b42c9980322cf3c42908e543608387487790 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sat, 9 Apr 2016 16:32:41 -0400 Subject: [PATCH] ensure # on homepage is a # --- model/CreditApi.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/model/CreditApi.class.php b/model/CreditApi.class.php index 116d646e..8b7fafe5 100644 --- a/model/CreditApi.class.php +++ b/model/CreditApi.class.php @@ -21,7 +21,9 @@ class CreditApi { $rawJSON = file_get_contents('https://spreadsheets.google.com/feeds/cells/1iOC1o5jq_4ySwRzsy2tZPPltw6Tbky2e3lDFdsWV8dU/okf1n52/public/full/R1C1?alt=json'); $json = $rawJSON ? json_decode($rawJSON, true) : []; - return isset($json['entry']) && isset($json['entry']['content']) ? $json['entry']['content']['$t'] : -1; + return isset($json['entry']) && isset($json['entry']['content']) && is_numeric($json['entry']['content']['$t'] ) ? + $json['entry']['content']['$t'] : + 6687; //fallback # } public static function getCreditsPerDollar($days)