Merge "Removed $wgImgAuthPublicTest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 22 Apr 2014 20:59:02 +0000 (20:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 22 Apr 2014 20:59:02 +0000 (20:59 +0000)
1  2 
img_auth.php
includes/DefaultSettings.php

diff --combined img_auth.php
@@@ -12,8 -12,6 +12,6 @@@
   * - Set $wgImgAuthDetails = true if you want the reason the access was denied messages to
   *       be displayed instead of just the 403 error (doesn't work on IE anyway),
   *       otherwise it will only appear in error logs
-  * - Set $wgImgAuthPublicTest false if you don't want to just check and see if all are public
-  *       must be set to false if using specific restrictions such as LockDown or NSFileRepo
   *
   *  For security reasons, you usually don't want your user to know *why* access was denied,
   *  just that it was. If you want to change this, you can set $wgImgAuthDetails to 'true'
@@@ -50,24 -48,13 +48,17 @@@ $wgActionPaths = array( "$wgUploadPath/
  
  wfImageAuthMain();
  wfLogProfilingData();
 +// Commit and close up!
 +$factory = wfGetLBFactory();
 +$factory->commitMasterChanges();
 +$factory->shutdown();
  
  function wfImageAuthMain() {
-       global $wgImgAuthPublicTest, $wgImgAuthUrlPathMap;
+       global $wgImgAuthUrlPathMap;
  
        $request = RequestContext::getMain()->getRequest();
        $publicWiki = in_array( 'read', User::getGroupPermissions( array( '*' ) ), true );
  
-       // See if this is a public Wiki (no protections).
-       if ( $wgImgAuthPublicTest && $publicWiki ) {
-               // This is a public wiki, so disable this script (for private wikis only)
-               wfForbidden( 'img-auth-accessdenied', 'img-auth-public' );
-               return;
-       }
        // Get the requested file path (source file or thumbnail)
        $matches = WebRequest::getPathInfo();
        if ( !isset( $matches['title'] ) ) {
@@@ -361,13 -361,6 +361,6 @@@ $wgDeletedDirectory = false
   */
  $wgImgAuthDetails = false;
  
- /**
-  * If this is enabled, img_auth.php will not allow image access unless the wiki
-  * is private. This improves security when image uploads are hosted on a
-  * separate domain.
-  */
- $wgImgAuthPublicTest = true;
  /**
   * Map of relative URL directories to match to internal mwstore:// base storage paths.
   * For img_auth.php requests, everything after "img_auth.php/" is checked to see
@@@ -1625,10 -1618,10 +1618,10 @@@ $wgAllDBsAreLocalhost = false
   * $wgSharedPrefix is the table prefix for the shared database. It defaults to
   * $wgDBprefix.
   *
 - * @deprecated In new code, use the $wiki parameter to wfGetLB() to access
 - *   remote databases. Using wfGetLB() allows the shared database to reside on
 - *   separate servers to the wiki's own database, with suitable configuration
 - *   of $wgLBFactoryConf.
 + * @deprecated since 1.21 In new code, use the $wiki parameter to wfGetLB() to
 + *   access remote databases. Using wfGetLB() allows the shared database to
 + *   reside on separate servers to the wiki's own database, with suitable
 + *   configuration of $wgLBFactoryConf.
   */
  $wgSharedDB = null;