Index: trunk/phase3/img_auth.php |
— | — | @@ -38,11 +38,14 @@ |
39 | 39 | } |
40 | 40 | |
41 | 41 | // Extract path and image information |
42 | | -if( !isset( $_SERVER['PATH_INFO'] ) ) |
43 | | - wfForbidden('img-auth-accessdenied','img-auth-nopathinfo'); |
| 42 | +if( !isset( $_SERVER['PATH_INFO'] ) ) { |
| 43 | + if( isset( $_GET['path'] ) ) $path = $_GET['path']; |
| 44 | + else wfForbidden('img-auth-accessdenied','img-auth-nopathinfo'); |
| 45 | +} else { |
| 46 | + $path = $_SERVER['PATH_INFO']; |
| 47 | +} |
44 | 48 | |
45 | | -$path = $_SERVER['PATH_INFO']; |
46 | | -$filename = realpath( $wgUploadDirectory . $_SERVER['PATH_INFO'] ); |
| 49 | +$filename = realpath( $wgUploadDirectory . '/' . $path ); |
47 | 50 | $realUpload = realpath( $wgUploadDirectory ); |
48 | 51 | |
49 | 52 | // Basic directory traversal check |