r78253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78252‎ | r78253 | r78254 >
Date:15:50, 12 December 2010
Author:btongminh
Status:ok
Tags:
Comment:
Follow-up r65652: Do not double-slash the path if it came from PATH_INFO
Modified paths:
  • /trunk/phase3/img_auth.php (modified) (history)

Diff [purge]

Index: trunk/phase3/img_auth.php
@@ -43,11 +43,12 @@
4444 if( !$path ) {
4545 wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' );
4646 }
 47+ $path = "/$path";
4748 } else {
4849 $path = $_SERVER['PATH_INFO'];
4950 }
5051
51 -$filename = realpath( $wgUploadDirectory . '/' . $path );
 52+$filename = realpath( $wgUploadDirectory . $path );
5253 $realUpload = realpath( $wgUploadDirectory );
5354
5455 // Basic directory traversal check

Follow-up revisions

RevisionCommit summaryAuthorDate
r805261.17: MFT r78232, r78253, r79722, r79732, r79785, r79817, r79864, r79891, r79...catrope22:19, 18 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65652allow img_auth.php to use path= in place of PATH_INFO, so it can be used in C...daniel10:32, 29 April 2010

Status & tagging log