| Index: trunk/phase3/includes/WebRequest.php |
| — | — | @@ -357,7 +357,7 @@ |
| 358 | 358 | public function getBool( $name, $default = false ) { |
| 359 | 359 | return (bool)$this->getVal( $name, $default ); |
| 360 | 360 | } |
| 361 | | - |
| | 361 | + |
| 362 | 362 | /** |
| 363 | 363 | * Fetch a boolean value from the input or return $default if not set. |
| 364 | 364 | * Unlike getBool, the string "false" will result in boolean false, which is |
| Index: trunk/phase3/img_auth.php |
| — | — | @@ -10,7 +10,7 @@ |
| 11 | 11 | * |
| 12 | 12 | * Optional Parameters |
| 13 | 13 | * |
| 14 | | - * - Set $wgImgAuthDetails = true if you want the reason the access was denied messages to be displayed |
| | 14 | + * - Set $wgImgAuthDetails = true if you want the reason the access was denied messages to be displayed |
| 15 | 15 | * instead of just the 403 error (doesn't work on IE anyway), otherwise will only appear in error logs |
| 16 | 16 | * - Set $wgImgAuthPublicTest false if you don't want to just check and see if all are public |
| 17 | 17 | * must be set to false if using specific restrictions such as LockDown or NSFileRepo |
| — | — | @@ -31,7 +31,7 @@ |
| 32 | 32 | require_once( dirname( __FILE__ ) . '/includes/StreamFile.php' ); |
| 33 | 33 | |
| 34 | 34 | // See if this is a public Wiki (no protections) |
| 35 | | -if ( $wgImgAuthPublicTest |
| | 35 | +if ( $wgImgAuthPublicTest |
| 36 | 36 | && in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) ) |
| 37 | 37 | { |
| 38 | 38 | wfForbidden('img-auth-accessdenied','img-auth-public'); |
| — | — | @@ -41,7 +41,7 @@ |
| 42 | 42 | if( !isset( $_SERVER['PATH_INFO'] ) ) { |
| 43 | 43 | $path = $wgRequest->getText( 'path' ); |
| 44 | 44 | if( !$path ) { |
| 45 | | - wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' ); |
| | 45 | + wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' ); |
| 46 | 46 | } |
| 47 | 47 | $path = "/$path"; |
| 48 | 48 | } else { |
| — | — | @@ -73,16 +73,16 @@ |
| 74 | 74 | $title = Title::makeTitleSafe( NS_FILE, $name ); |
| 75 | 75 | |
| 76 | 76 | // See if could create the title object |
| 77 | | -if( !$title instanceof Title ) |
| | 77 | +if( !$title instanceof Title ) |
| 78 | 78 | wfForbidden('img-auth-accessdenied','img-auth-badtitle',$name); |
| 79 | 79 | |
| 80 | 80 | // Run hook |
| 81 | 81 | if (!wfRunHooks( 'ImgAuthBeforeStream', array( &$title, &$path, &$name, &$result ) ) ) |
| 82 | 82 | wfForbidden($result[0],$result[1],array_slice($result,2)); |
| 83 | | - |
| | 83 | + |
| 84 | 84 | // Check user authorization for this title |
| 85 | 85 | // UserCanRead Checks Whitelist too |
| 86 | | -if( !$title->userCanRead() ) |
| | 86 | +if( !$title->userCanRead() ) |
| 87 | 87 | wfForbidden('img-auth-accessdenied','img-auth-noread',$name); |
| 88 | 88 | |
| 89 | 89 | // Stream the requested file |
| — | — | @@ -93,7 +93,7 @@ |
| 94 | 94 | /** |
| 95 | 95 | * Issue a standard HTTP 403 Forbidden header ($msg1-a message index, not a message) and an |
| 96 | 96 | * error message ($msg2, also a message index), (both required) then end the script |
| 97 | | - * subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2 |
| | 97 | + * subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2 |
| 98 | 98 | */ |
| 99 | 99 | function wfForbidden($msg1,$msg2) { |
| 100 | 100 | global $wgImgAuthDetails; |