r52258 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52257‎ | r52258 | r52259 >
Date:21:32, 21 June 2009
Author:ialex
Status:deferred
Tags:
Comment:
PerSergey Chernyshev's comment on r52236 (and fix for that revision): add SpecialOpenID::scriptUrl() back, should fix some errors with short urls enabled
Modified paths:
  • /trunk/extensions/OpenID/SpecialOpenID.body.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDConvert.body.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDLogin.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php
@@ -344,7 +344,7 @@
345345
346346 wfSuppressWarnings();
347347 $consumer = $this->getConsumer();
348 - $response = $consumer->complete( $this->getTitle( 'Finish' )->getFullUrl() );
 348+ $response = $consumer->complete( $this->scriptUrl( 'Finish' ) );
349349 wfRestoreWarnings();
350350
351351 if ( is_null( $response ) ) {
Index: trunk/extensions/OpenID/SpecialOpenID.body.php
@@ -225,7 +225,7 @@
226226 $auth_request->addExtension( $sreg_request );
227227 }
228228
229 - $process_url = $finish_page->getFullUrl();
 229+ $process_url = $this->scriptUrl( $finish_page );
230230
231231 if ( $auth_request->shouldSendRedirect() ) {
232232 $redirect_url = $auth_request->redirectURL( $trust_root,
@@ -256,6 +256,22 @@
257257 wfRestoreWarnings();
258258 }
259259
 260+ function scriptUrl( $par = false ) {
 261+ global $wgServer, $wgScript;
 262+
 263+ if ( !is_object( $par ) )
 264+ $nt = $this->getTitle( $par );
 265+ else
 266+ $nt = $par;
 267+
 268+ if ( !is_null( $nt ) ) {
 269+ $dbkey = wfUrlencode( $nt->getPrefixedDBkey() );
 270+ return "{$wgServer}{$wgScript}?title={$dbkey}";
 271+ } else {
 272+ return '';
 273+ }
 274+ }
 275+
260276 protected function setupSession() {
261277 global $wgSessionStarted;
262278
Index: trunk/extensions/OpenID/SpecialOpenIDConvert.body.php
@@ -146,7 +146,7 @@
147147
148148 wfSuppressWarnings();
149149 $consumer = $this->getConsumer();
150 - $response = $consumer->complete( $this->getTitle( 'Finish' )->getFullUrl() );
 150+ $response = $consumer->complete( $this->scriptUrl( 'Finish' ) );
151151 wfRestoreWarnings();
152152
153153 if ( is_null( $response ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r52291follow-up r52258: change default trust root to "$wgServer . $wgScriptPath" (r...ialex17:46, 22 June 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52236Big changes to OpenID extension:...ialex12:41, 21 June 2009

Status & tagging log