From 3ca3019668ec6415a5a5eb1106d0b25e10df9a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Thu, 21 Apr 2016 11:15:38 +0200 Subject: [PATCH 1/3] Wipe record ids out of API search response Fix PHRAS-1085 --- lib/Alchemy/Phrasea/Controller/Api/V1Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php index add7eccc8c..c6d3a068a2 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php @@ -1275,7 +1275,7 @@ class V1Controller extends Controller 'dc:title' => $format($caption, \databox_Field_DCESAbstract::Title), 'dc:type' => $format($caption, \databox_Field_DCESAbstract::Type), ], - 'records' => $this->listRecords($request, $story->getChildren()->get_elements()), + 'records' => $this->listRecords($request, array_values($story->getChildren()->get_elements())), ]; } From 7109131f783e94a09ab5d85d19c4f7c3dc86f1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Thu, 21 Apr 2016 12:13:26 +0200 Subject: [PATCH 2/3] Fixup CookiesDisablerSubscriber for all API routes --- .../Event/Subscriber/CookiesDisablerSubscriber.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php index 37df6ed2d9..56472b103d 100644 --- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php +++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php @@ -1,5 +1,4 @@ getResponse(); - foreach ($response->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY) as $cookie_domains) { - foreach ($cookie_domains as $cookie_paths) { - foreach ($cookie_paths as $cookie) { - $response->headers->removeCookie($cookie->getName(), $cookie->getPath(), $cookie->getDomain()); - } - } + /** @var Cookie $cookie */ + foreach ($response->headers->getCookies() as $cookie) { + $response->headers->removeCookie($cookie->getName(), $cookie->getPath(), $cookie->getDomain()); } } } From ceb8cb55eb755ab62fc4aacc412823be376a3b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Thu, 21 Apr 2016 12:14:09 +0200 Subject: [PATCH 3/3] Add request query parameter check for oauth_token --- .../Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php index a7679abd3a..689ae02837 100644 --- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php +++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php @@ -71,6 +71,7 @@ class SessionManagerSubscriber implements EventSubscriberInterface $request = $event->getRequest(); if ($request->request->has('oauth_token') + || $request->query->has('oauth_token') || $request->query->has('LOG') || null === $moduleId = $this->getModuleId($request->getPathInfo()) ) {