A free, self-hostable news aggregator…
Fix warning with FeedReader (#2947)
Alexandre Alapetite5e18ca840891
diff --git a/p/api/greader.php b/p/api/greader.phpindex 877b91cc7..54b13290c 100644--- a/p/api/greader.php+++ b/p/api/greader.php@@ -32,6 +32,7 @@ if (PHP_INT_SIZE < 8) { //32-bitreturn str_pad(gmp_strval(gmp_init($dec, 10), 16), 16, '0', STR_PAD_LEFT);}function hex2dec($hex) {+ if (!ctype_xdigit($hex)) return 0;return gmp_strval(gmp_init($hex, 16), 10);}} else { //64-bit@@ -39,6 +40,7 @@ if (PHP_INT_SIZE < 8) { //32-bitreturn str_pad(dechex($dec), 16, '0', STR_PAD_LEFT);}function hex2dec($hex) {+ if (!ctype_xdigit($hex)) return 0;return hexdec($hex);}}@@ -729,7 +731,7 @@ function streamContentsItems($e_ids, $order) {header('Content-Type: application/json; charset=UTF-8');foreach ($e_ids as $i => $e_id) {- if (strpos($e_id, '/') !== null) {+ if (strpos($e_id, '/') !== false) {$e_id = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/'}$e_ids[$i] = $e_id;@@ -753,7 +755,7 @@ function streamContentsItems($e_ids, $order) {function editTag($e_ids, $a, $r) {foreach ($e_ids as $i => $e_id) {- if (strpos($e_id, '/') !== null) {+ if (strpos($e_id, '/') !== false) {$e_id = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/'}$e_ids[$i] = $e_id;