jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327019 )

Change subject: Fix warnings and bugs in generateForwardedCookieForCli()
......................................................................


Fix warnings and bugs in generateForwardedCookieForCli()

WebResponse's cookie data structure changed in c3dc3985,
so the elements of the cookie array are now arrays, not strings.
Use $value['value'] instead of $value to get the correct cookie
value and avoid "array to string conversion" warnings.

Also, c3dc3985 added a public getCookies() method, so we don't
need to use a reflection hack to get to the cookie data structure
any more.

Bug: T149579
Change-Id: I4ec67505a581c5d55e1e59b9cfa069ca5f722be9
(cherry picked from commit 502de3986c37ded4715770055fabcceb8df25f81)
---
M includes/Conversion/Utils.php
1 file changed, 2 insertions(+), 5 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  Sbisson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Conversion/Utils.php b/includes/Conversion/Utils.php
index 4e3e886..a8ef242 100644
--- a/includes/Conversion/Utils.php
+++ b/includes/Conversion/Utils.php
@@ -438,16 +438,13 @@
                if ( !$response instanceof FauxResponse ) {
                        throw new FlowException( 'Expected a FauxResponse in 
CLI environment' );
                }
-               // FauxResponse does not yet expose the full set of cookies
-               $reflProp = new \ReflectionProperty( $response, 'cookies' );
-               $reflProp->setAccessible( true );
-               $cookies = $reflProp->getValue( $response );
+               $cookies = $response->getCookies();
 
                // now we need to convert the array into the cookie format of
                // foo=bar; baz=bang
                $output = array();
                foreach ( $cookies as $key => $value ) {
-                       $output[] = "$wgCookiePrefix$key=$value";
+                       $output[] = "$wgCookiePrefix$key={$value['value']}";
                }
 
                return implode( '; ', $output );

-- 
To view, visit https://gerrit.wikimedia.org/r/327019
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ec67505a581c5d55e1e59b9cfa069ca5f722be9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: REL1_27
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to