Last modified: 2014-11-18 12:09:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T65282, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63282 - Media selector doesn't find local media in private wiki
Media selector doesn't find local media in private wiki
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-30 20:58 UTC by Stephan Matthiesen
Modified: 2014-11-18 12:09 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Stephan Matthiesen 2014-03-30 20:58:04 UTC
The media selector (both in WikiEditor and Visual Editor) does not find local images in a private wiki. When the same wiki is set to public, it works.

I've tried this with 3 different installations (1.22 and 1.23wmf20) on two different servers, both with Visual Editor and WikiEditor. 

The relevant setting is

$wgGroupPermissions['*']['read'] = false;

When this is set to false, when a user (logged in and registered) edits a page and starts typing the name of an existing file in the media selector, the input box remains empty and does not suggest existing file names. 

When the read permission is set to true, then it works as expected (giving a list of suggestions in the input box) - but of course then the wiki is no longer private.

On the other hand, the link selector finds the files when I type "File:Filename..". Also, the image is actually shown in the article when I insert it with Wiki markup, or when I type in the correct filename in the selector and click on "insert".

So somehow the media selector (but not the link selector) does not understand the permission correctly for a logged-in user.
Comment 1 Bawolff (Brian Wolff) 2014-03-30 21:21:46 UTC
Maybe private only wikis cause api to be disabled.
Comment 2 Stephan Matthiesen 2014-04-11 13:22:16 UTC
(In reply to Bawolff (Brian Wolff) from comment #1)
> Maybe private only wikis cause api to be disabled.

API is not disabled completely. All other API calls seem to work, only image search is affected.

The following workaround in LocalSettings.php also works:

if ( strpos($_SERVER['REQUEST_URI'], "prop=imageinfo") > 0 ) {
    $wgGroupPermissions['*']['read'] = true;
}

This disables read protection selectively for the image search.
Comment 3 Bawolff (Brian Wolff) 2014-04-11 14:26:05 UTC
(In reply to Stephan Matthiesen from comment #2)
> (In reply to Bawolff (Brian Wolff) from comment #1)
> > Maybe private only wikis cause api to be disabled.
> 
> API is not disabled completely. All other API calls seem to work, only image
> search is affected.
> 
> The following workaround in LocalSettings.php also works:
> 
> if ( strpos($_SERVER['REQUEST_URI'], "prop=imageinfo") > 0 ) {
>     $wgGroupPermissions['*']['read'] = true;
> }
> 
> This disables read protection selectively for the image search.

Actually that can be exploited to get around read protection everywhere (including normal web requests). Any url can have that string in it.
Comment 4 Stephan Matthiesen 2014-04-11 14:39:51 UTC
(In reply to Bawolff (Brian Wolff) from comment #3)
> Actually that can be exploited to get around read protection everywhere
> (including normal web requests). Any url can have that string in it.

Of course, and I don't recommend it. It was just meant as an indication that it's a bug in this specific api call for image searches and that other api calls are ok, so it's not a disabled api.
Comment 5 Gabriel Stelmach 2014-10-31 19:49:08 UTC
Hello there,

I just face this issue in my installation. There are any news about solution for this?

In time. Thank you Stephan for the workaround.

[]s
Comment 6 Stephan Matthiesen 2014-11-18 12:09:19 UTC
In 1.25wmf8, it works now correctly without the (unsecure) workaround. I guess some other things with permissions were fixed which solved this one as a side effect too.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links