diff options
Diffstat (limited to 'p/api')
| -rw-r--r-- | p/api/greader.php | 5 | ||||
| -rw-r--r-- | p/api/pshb.php | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/p/api/greader.php b/p/api/greader.php index b9942f0bc..62782ce1a 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -23,7 +23,7 @@ Server-side API compatible with Google Reader API layer 2 require('../../constants.php'); require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader -$ORIGINAL_INPUT = file_get_contents('php://input'); +$ORIGINAL_INPUT = file_get_contents('php://input', false, null, -1, 1048576); if (PHP_INT_SIZE < 8) { //32-bit function dec2hex($dec) { @@ -361,6 +361,9 @@ function streamContents($path, $include_target, $start_time, $count, $order, $ex case 'user/-/state/com.google/read': $state = FreshRSS_Entry::STATE_NOT_READ; break; + case 'user/-/state/com.google/unread': + $state = FreshRSS_Entry::STATE_READ; + break; default: $state = FreshRSS_Entry::STATE_ALL; break; diff --git a/p/api/pshb.php b/p/api/pshb.php index 4bb4694b3..7de4cc1a2 100644 --- a/p/api/pshb.php +++ b/p/api/pshb.php @@ -68,6 +68,15 @@ if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'subscribe') { exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); } +if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'unsubscribe') { + if (empty($hubJson['lease_end']) || $hubJson['lease_end'] < time()) { + exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); + } else { + header('HTTP/1.1 422 Unprocessable Entity'); + die('We did not ask to unsubscribe!'); + } +} + if ($ORIGINAL_INPUT == '') { header('HTTP/1.1 422 Unprocessable Entity'); die('Missing XML payload!'); |
