r94171 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94170‎ | r94171 | r94172 >
Date:17:28, 10 August 2011
Author:demon
Status:resolved (Comments)
Tags:
Comment:
(bug 30219) NoLocalSettings.php broken on Windows servers. Per Tim on r70711, can't use pathinfo() on url's since the slashes don't match.
Modified paths:
  • /trunk/phase3/includes/templates/NoLocalSettings.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/templates/NoLocalSettings.php
@@ -9,11 +9,18 @@
1010 if ( !isset( $wgVersion ) ) {
1111 $wgVersion = 'VERSION';
1212 }
13 -$script = $_SERVER['SCRIPT_NAME'];
14 -$path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
15 -$path = str_replace( '//', '/', $path );
16 -$ext = pathinfo( $script, PATHINFO_EXTENSION );
1713
 14+$matches = array();
 15+$ext = 'php';
 16+$path = '/';
 17+foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
 18+ if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
 19+ $path .= "$part/";
 20+ } else {
 21+ $ext = $matches[1] == 'php5' ? 'php5' : 'php';
 22+ }
 23+}
 24+
1825 # Check to see if the installer is running
1926 if ( !function_exists( 'session_name' ) ) {
2027 $installerStarted = false;

Follow-up revisions

RevisionCommit summaryAuthorDate
r94172release notes for r94171, checked in from the wrong directorydemon17:29, 10 August 2011
r100018adding note to code snippet...hashar09:46, 17 October 2011
r102514REL1_18 MFT r92846, r93065, r93834, r94171reedy14:31, 9 November 2011
r104184REL1_17 MFT r94171reedy16:40, 24 November 2011
r104185RELEASE-NOTES for r104184/r94171reedy16:41, 24 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70711Greatly simplify path and extension detection for NoLocalSettings.php. Fixes ...demon16:06, 8 August 2010

Comments

#Comment by Hashar (talk | contribs)   08:23, 12 August 2011

You might want to add a comment above the code for later reference.


Looks like it need a backport to both 1.17 and 1.18. Tagging accordingly.

#Comment by Hashar (talk | contribs)   09:46, 17 October 2011

Comment added by r100018

#Comment by 😂 (talk | contribs)   13:19, 13 August 2011

Grrr insufficient fix. Works on ugly urls, semi-pretty urls (using pathinfo), and rewritten urls. Does not work with Alias directives.

#Comment by Catrope (talk | contribs)   11:15, 18 September 2011

Are you ever gonna fix this? Should this be backported to 1.18 or not?

#Comment by 😂 (talk | contribs)   02:21, 19 September 2011

Been trying to find a volunteer to pick it up since I've been busy. And yes it should be backported, because it's an improvement over what we had.

#Comment by MaxSem (talk | contribs)   17:15, 3 October 2011

I can't imagine how one can fix it for aliases short of parsing httpd.conf. By the way, I reported the original bug 21215 about aliases:P

#Comment by 😂 (talk | contribs)   16:04, 7 November 2011

Setting back to new, there's nothing really left to do here. Release notes and docs were updated.

Status & tagging log