aboutsummaryrefslogtreecommitdiff
path: root/p/api/greader.php
diff options
context:
space:
mode:
Diffstat (limited to 'p/api/greader.php')
-rw-r--r--p/api/greader.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/p/api/greader.php b/p/api/greader.php
index b591e7c44..a9e6398d2 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -392,10 +392,15 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '
function quickadd($url) {
try {
$url = htmlspecialchars($url, ENT_COMPAT, 'UTF-8');
+ if (substr($url, 0, 5) === 'feed/') {
+ $url = substr($url, 5);
+ }
$feed = FreshRSS_feed_Controller::addFeed($url);
exit(json_encode(array(
'numResults' => 1,
- 'streamId' => $feed->id(),
+ 'query' => $feed->url(),
+ 'streamId' => 'feed/' . $feed->id(),
+ 'streamName' => $feed->name(),
), JSON_OPTIONS));
} catch (Exception $e) {
Minz_Log::error('quickadd error: ' . $e->getMessage(), API_LOG);
@@ -1052,8 +1057,8 @@ if ($pathInfos[1] === 'accounts') {
}
break;
case 'quickadd': //https://github.com/theoldreader/api
- if (isset($_GET['quickadd'])) {
- quickadd($_GET['quickadd']);
+ if (isset($_REQUEST['quickadd'])) {
+ quickadd($_REQUEST['quickadd']);
}
break;
}