r78115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78114‎ | r78115 | r78116 >
Date:03:12, 9 December 2010
Author:werdna
Status:ok (Comments)
Tags:
Comment:
Follow-up to r64937: expand ternary to conditionals because I hate nested ternaries.
Modified paths:
  • /trunk/phase3/includes/Setup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Setup.php
@@ -217,9 +217,14 @@
218218 wfDebug( "Start request\n\n" );
219219 # Output the REQUEST_URI. This is not supported by IIS in rewrite mode,
220220 # so use an alternative
221 - $requestUri = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] :
222 - ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ? $_SERVER['HTTP_X_ORIGINAL_URL'] :
223 - $_SERVER['PHP_SELF'] );
 221+ if ( isset( $_SERVER['REQUEST_URI'] ) ) {
 222+ $requestUri = $_SERVER['REQUEST_URI'];
 223+ } elseif ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
 224+ $requestUri = $_SERVER['HTTP_X_ORIGINAL_URL'];
 225+ } else {
 226+ $requestUri = $_SERVER['PHP_SELF'];
 227+ }
 228+
224229 wfDebug( "{$_SERVER['REQUEST_METHOD']} {$requestUri}\n" );
225230
226231 if ( $wgDebugPrintHttpHeaders ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64937$_SERVER['REQUEST_URI'] is not available using IIS with rewrite rules, so use...btongminh15:38, 11 April 2010

Comments

#Comment by Aaron Schulz (talk | contribs)   03:17, 9 December 2010

I've come to dislike them too.

Status & tagging log