r81347 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81346‎ | r81347 | r81348 >
Date:23:08, 1 February 2011
Author:mah
Status:ok
Tags:
Comment:
Whitespace cleanup
Modified paths:
  • /trunk/phase3/img_auth.php (modified) (history)
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WebRequest.php
@@ -357,7 +357,7 @@
358358 public function getBool( $name, $default = false ) {
359359 return (bool)$this->getVal( $name, $default );
360360 }
361 -
 361+
362362 /**
363363 * Fetch a boolean value from the input or return $default if not set.
364364 * Unlike getBool, the string "false" will result in boolean false, which is
Index: trunk/phase3/img_auth.php
@@ -10,7 +10,7 @@
1111 *
1212 * Optional Parameters
1313 *
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
1515 * instead of just the 403 error (doesn't work on IE anyway), otherwise will only appear in error logs
1616 * - Set $wgImgAuthPublicTest false if you don't want to just check and see if all are public
1717 * must be set to false if using specific restrictions such as LockDown or NSFileRepo
@@ -31,7 +31,7 @@
3232 require_once( dirname( __FILE__ ) . '/includes/StreamFile.php' );
3333
3434 // See if this is a public Wiki (no protections)
35 -if ( $wgImgAuthPublicTest
 35+if ( $wgImgAuthPublicTest
3636 && in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) )
3737 {
3838 wfForbidden('img-auth-accessdenied','img-auth-public');
@@ -41,7 +41,7 @@
4242 if( !isset( $_SERVER['PATH_INFO'] ) ) {
4343 $path = $wgRequest->getText( 'path' );
4444 if( !$path ) {
45 - wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' );
 45+ wfForbidden( 'img-auth-accessdenied', 'img-auth-nopathinfo' );
4646 }
4747 $path = "/$path";
4848 } else {
@@ -73,16 +73,16 @@
7474 $title = Title::makeTitleSafe( NS_FILE, $name );
7575
7676 // See if could create the title object
77 -if( !$title instanceof Title )
 77+if( !$title instanceof Title )
7878 wfForbidden('img-auth-accessdenied','img-auth-badtitle',$name);
7979
8080 // Run hook
8181 if (!wfRunHooks( 'ImgAuthBeforeStream', array( &$title, &$path, &$name, &$result ) ) )
8282 wfForbidden($result[0],$result[1],array_slice($result,2));
83 -
 83+
8484 // Check user authorization for this title
8585 // UserCanRead Checks Whitelist too
86 -if( !$title->userCanRead() )
 86+if( !$title->userCanRead() )
8787 wfForbidden('img-auth-accessdenied','img-auth-noread',$name);
8888
8989 // Stream the requested file
@@ -93,7 +93,7 @@
9494 /**
9595 * Issue a standard HTTP 403 Forbidden header ($msg1-a message index, not a message) and an
9696 * 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
9898 */
9999 function wfForbidden($msg1,$msg2) {
100100 global $wgImgAuthDetails;

Status & tagging log