Last modified: 2013-05-11 18:51:29 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 T28865, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26865 - API resolved redirects to special pages (wgDisableHardRedirects / wgInvalidRedirectTargets)
API resolved redirects to special pages (wgDisableHardRedirects / wgInvalidRe...
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://test.wikipedia.org/w/api.php?a...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-22 17:53 UTC by Umherirrender
Modified: 2013-05-11 18:51 UTC (History)
6 users (show)

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


Attachments

Description Umherirrender 2011-01-22 17:53:50 UTC
Having a page with a redirect to a special page, than the GUI does not redirect automatically.

When using the api (titles=&redirects), the result show a redirect to the special page. I do not know, if this is intended. When yes, make this INVALID.

Thanks.
Comment 1 Krinkle 2011-01-22 18:17:09 UTC
Sounds like API does not check the $wgDisableHardRedirects setting [0].

The possibility of resolving both normal redirects and redirects to the Special:-namespace is intended. However there is a setting (which is true on wikimedia wikis [1] ) to disable this. The API should check for that also.

I've tried to reproduce this but did not succeed [2] [3].

@Umherirrender: Could you link to an example where this is happening ?

--
Krinkle


[0] http://www.mediawiki.org/wiki/Manual:$wgDisableHardRedirects
[1] http://noc.wikimedia.org/conf/InitialiseSettings.php.txt (search for "wgDisableHardRedirects")

'wgDisableHardRedirects' => array(
	'default' 	 => true,

[2] http://www.mediawiki.org/wiki/User:Krinkle/Testcase/SpecialFilePath
[3] http://www.mediawiki.org/w/api.php?action=query&titles=User:Krinkle/Testcase/SpecialFilePath&redirects&indexpageids
Comment 2 Umherirrender 2011-01-22 18:57:09 UTC
(In reply to comment #1)
> I've tried to reproduce this but did not succeed [2] [3].

I do not know, why Special:FilePath is not working ...

> @Umherirrender: Could you link to an example where this is happening ?

I added a url with a testcase.
Comment 3 Krinkle 2011-01-23 03:03:18 UTC
Thanks, it apparently acts different for Special:FilePath.

Reproduced error in both 1.16 and 1.18-svn [0]


[0]: http://translatewiki.net/w/api.php?action=query&titles=User:Krinkle/RedirectToSpecial&redirects
Comment 4 Umherirrender 2011-01-23 19:07:58 UTC
(In reply to comment #3)
> Thanks, it apparently acts different for Special:FilePath.

See $wgInvalidRedirectTargets in DefaultSettings.php
Comment 5 Sam Reed (reedy) 2012-08-20 19:59:34 UTC
(In reply to comment #0)
> Having a page with a redirect to a special page, than the GUI does not redirect
> automatically.
> 
> When using the api (titles=&redirects), the result show a redirect to the
> special page. I do not know, if this is intended. When yes, make this INVALID.
> 
> Thanks.

The GUI does redirect.. If I visit a page with a redirect to a special page, I'm taken to that page automatically...
Comment 6 Umherirrender 2012-08-24 14:35:59 UTC
(In reply to comment #5)
> (In reply to comment #0)
> > Having a page with a redirect to a special page, than the GUI does not redirect
> > automatically.
> > 
> > When using the api (titles=&redirects), the result show a redirect to the
> > special page. I do not know, if this is intended. When yes, make this INVALID.
> > 
> > Thanks.
> The GUI does redirect.. If I visit a page with a redirect to a special page,
> I'm taken to that page automatically...

Have you set wgDisableHardRedirects to true? It is false by default.
Comment 7 Umherirrender 2013-05-11 18:51:29 UTC
The api will not redirect by itself and does not provide a url for redirecting, so the wgDisableHardRedirects setting must not be respected. The redirects are also stored inside the redirects table, so that are redirects.

wgInvalidRedirectTargets is respected, because those redirects are not in the redirect table (and will not be added by the api)

It is always safer to let index.php doing redirects instead of calling the api to get the right 'to' page and call than index.php with the new page.

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


Navigation
Links