r105032 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105031‎ | r105032 | r105033 >
Date:00:43, 3 December 2011
Author:khorn
Status:ok
Tags:
Comment:
Yet another stab at the whitescreen mystery. Adds more logging, and a check to make sure we're only serving up the iframe liberator once.
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
@@ -59,14 +59,24 @@
6060 }
6161
6262 $referrer = $wgRequest->getHeader( 'referer' );
 63+ $liberated = false;
 64+ if ( array_key_exists( 'order_status', $_SESSION ) && array_key_exists( $qs_oid, $_SESSION['order_status'] ) ){
 65+ $liberated = true;
 66+ }
6367
6468 global $wgServer;
6569 //TODO: Whitelist! We only want to do this for servers we are configured to like!
6670 //I didn't do this already, because this may turn out to be backwards anyway. It might be good to do the work in the iframe,
6771 //and then pop out. Maybe. We're probably going to have to test it a couple different ways, for user experience.
6872 //However, we're _definitely_ going to need to pop out _before_ we redirect to the thank you or fail pages.
69 - if ( !$forbidden && strpos( $referrer, $wgServer ) === false ) {
 73+ if ( ( strpos( $referrer, $wgServer ) === false ) && !$liberated ) {
 74+ $_SESSION['order_status'][$qs_oid] = 'liberated';
7075 $this->adapter->log("Resultswitcher: Popping out of iframe for Order ID " . $qs_oid);
 76+ //TODO: Move the $forbidden check back to the beginning of this if block, once we know this doesn't happen a lot.
 77+ //TODO: If we get a lot of these messages, we need to redirect to something more friendly than FORBIDDEN, RAR RAR RAR.
 78+ if ( $forbidden ) {
 79+ $this->adapter->log("Resultswitcher: " . $qs_oid . "SHOULD BE FORBIDDEN. Reason: $f_message");
 80+ }
7181 $wgOut->allowClickjacking();
7282 $wgOut->addModules( 'iframe.liberator' );
7383 return;

Follow-up revisions

RevisionCommit summaryAuthorDate
r105072MFT r104932, r105032khorn18:46, 3 December 2011

Status & tagging log