Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php |
— | — | @@ -59,14 +59,24 @@ |
60 | 60 | } |
61 | 61 | |
62 | 62 | $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 | + } |
63 | 67 | |
64 | 68 | global $wgServer; |
65 | 69 | //TODO: Whitelist! We only want to do this for servers we are configured to like! |
66 | 70 | //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, |
67 | 71 | //and then pop out. Maybe. We're probably going to have to test it a couple different ways, for user experience. |
68 | 72 | //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'; |
70 | 75 | $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 | + } |
71 | 81 | $wgOut->allowClickjacking(); |
72 | 82 | $wgOut->addModules( 'iframe.liberator' ); |
73 | 83 | return; |