r101764 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101763‎ | r101764 | r101765 >
Date:00:34, 3 November 2011
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
follow-up to r101576 to address comments. Next I will be experimenting with pulling the data in a more sensible way.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -116,9 +116,16 @@
117117 unset( $data['referrer'] );
118118 $data['amount'] = $data['amount']/100;
119119 $data['error'] = $declinedDefault;
 120+ $params = wfArrayToCGI( $data );
120121
121 - $params = wfArrayToCGI( $data );
122 - $returnto = htmlspecialchars_decode( $referrer ) . '&' . $params;
 122+ // Make sure the referrer has a query string
 123+ if ( strpos( $referrer, '?' ) === false ) {
 124+ $returnto = htmlspecialchars_decode( $referrer ) . '?' . $params;
 125+ } else {
 126+ $returnto = htmlspecialchars_decode( $referrer ) . '&' . $params;
 127+ }
 128+
 129+ // Return the referrer URL with the data included in the query string
123130 return $returnto;
124131 }
125132 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r101768MFT r101576, r101764awjrichards00:41, 3 November 2011
r101779follow-up to r101764, better URL building and switching to getDisplayDatakaldari02:30, 3 November 2011
r101781follow-up to r101764 and r101576, fixing bogus call to $datakaldari02:43, 3 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101576begining to handle transaction errors for globalcollect - this might be all w...kaldari02:22, 2 November 2011

Comments

#Comment by 😂 (talk | contribs)   00:55, 3 November 2011

Rather than DIY with the query string strpos, we have wfAppendUrl() for this exact purpose :)

#Comment by 😂 (talk | contribs)   00:55, 3 November 2011

wfAppendUrl, but same point.

#Comment by 😂 (talk | contribs)   00:55, 3 November 2011

wfAppendQuery...grrr

#Comment by Kaldari (talk | contribs)   02:26, 3 November 2011

oooh, a new toy :)

#Comment by Kaldari (talk | contribs)   02:31, 3 November 2011

should be fixed in r101779.

Status & tagging log