The fast case needs to pass the redirlinks subarray through array_values
and set an indexed tag name.
Bug: 71907
Change-Id: I865aad6485a2598c9e574ab5c38e8e0923d11ddd
The original intent of this patch was to have ApiQueryBacklinks use the
*_from_namespace fields added in Icca99b6a. It does that, but in the
process several other bugs were found in the module:
* Continuation could skip pages when blredirect was used.
* The result object would be populated incorrectly if
$wgAPIMaxResultSize was hit and blredirect was used.
* Continuation could (probably) skip or (maybe) repeat pages when
blredirect was used and $wgAPIMaxResultSize was hit.
In the process of analyzing and fixing these problems, the code was
heavily refactored.
Change-Id: I32381c0f082d2f8e063af99ee353ae003c163c23
* This causes problems with some session handlers and it is
also trickier to deal with in non CLI script without leaking
cookie headers.
Change-Id: Iaf2a57f9299e42a5f68bf85115e62e88fa0f8ed6
The replace of $n params can also be done using the Message class. In
case there are no message keys, the RawMessage class is used.
Deprecated wfMsgReplaceArgs, but added no warning, because it is used in
some extensions and from deprecated functions
Change-Id: I62091b09e4490e59ed7258566e0ddf2f8ee799d2
The existing query only works with a single value for augroup, or mostly
if it's combined with auprop=groups or auprop=rights (since most users
don't have every possible group).
When used with multiple values for augroup, it will raise an error if it
happens to encounter enough users who have more than one of the
specified groups. And further, it will lead to repeated groups for these
users if combined with auprop=groups or auprop=rights.
An attempt to use EXISTS instead of a JOIN to query user_groups failed
because it made the planner scan the user table where a smaller scan of
user_groups plus a filesort was faster. So instead, let's just fix it
directly by acknowledging that supplying multiple groups for
augroup is going to give us duplicate rows.
At the same time, let's try using a subquery (with GROUP_CONCAT) to
fetch the actual groups the user belongs to, both to avoid processing so
many duplicate rows and to simplify the row-processing code. And let's
kill the forced index, it's probably not needed anymore.
Bug: 70496
Change-Id: Ic87dbc3b2d933775ca71a72932e0658e2f082bb6
According to I5aae8caf, the parameter is gone now. Found while
tracking down a strict warning in MWSearch.
Change-Id: I571e015814ea756771c66c243cb8db86448db463
ApiPageSet::getAllTitlesByNamespace is fine when that's what you want.
But in all existing uses in core, it's not what's actually wanted.
* ApiQueryBacklinksprop can generate wrong ORDER BY because it considers
redirect and invalid titles that it doesn't acutally query.
* ApiQueryCategoryInfo raises a fatal error with category redirects.
* ApiQueryDuplicateFiles and ApiQueryImageInfo will add information for
redirects, leaving them missing the standard data and missing from
indexpageids.
What all these need is really something along the lines of
"ApiPageSet::getGoodAndMissingTitlesByNamespace". So let's add that,
plus a few similar methods for good measure.
Bug: 71337
Change-Id: I3a205057edcbc303393718e1c8bfb1f1b1f95323
Since 926afc65c3, the transformation assumes < and > occur in pairs.
This assumption is invalid for formats such as JSON.
Implementing proper JSON syntax highlighting falls outside the scope
of this workaround and is left for separate changes, likely including
the addition of a hook. That is part of the API roadmap RfC.
https://www.mediawiki.org/wiki/Requests_for_comment/API_roadmap#Changes_to_pretty-printed_HTML_formats
Bug: 65403
Change-Id: Iff8d444c82f7efd2bd1c9f703defc4f0984e8211
With the success of prop=redirects, let's create prop=linkshere,
prop=transcludedin, and prop=fileusage.
Let's also add a miser-mode-sensitive 'namespace' parameter to
prop=redirects, since the other three have a 'namespace' parameter using
the new *_from_namespace fields.
Change-Id: Ib650db9988a553771582eed0c183d0cae4b71252
$wgDebugAPI is supposed to be a way to quickly (and insecurely) test API
modules using GET where they'd normally require POST. But this purpose
is defeated if token handling still throws mustposttoken.
Change-Id: Iee2fb76da86bf0670f9816f24f68c611fa0728b1
If the file has a duration (e.g. an audio or video file), include
it in the list of dimensions returned. Do not include anything
for still media (normal pictures).
This affects both query=imageinfo and TMH's query=videoinfo.
Bug: 55941
Change-Id: If172a1cbaca08bff2eb709f6c829985b28b0200d
Some file types might not have a specific width/height. As an
example, TimedMediaHandler can specify thumbnails that are
"mid" sized instead of specific width. The requirement for
iiurlwidth was breaking some edge cases with ForeignAPIRepo
and TimedMediaHandler (Specificly with ?embedplayer=yes).
Do not require a width, but also verify that thumbnail parameters
are ok by running through normaliseParams (Formats that require
a width make this function return false if none is specified).
Change-Id: I8bb4c26db56c814ddfbd3e53ca98d05378c2a0bd
This enables factory functions to be registered for special
pages, as an alterative to giving a class name. This follows the
same rationale as Ieb85493a7765, which introduced factory functions
for API modules.
Change-Id: Ia2107dc5af7869187ba5dc02a1bef46d6801e138
Based on the code in Preferences::generateSkinOptions(). This should
probably be turned into a helper method one day…
Bug: 48953
Change-Id: Ib85a783bd19de8a59e7b81a4203a05b786e67772
You can't add or remove a group that doesn't exist, so don't claim that
it's possible on Special:ListGroupRights or the API.
Change-Id: I02d3f00142ca1cb0cdcbf30e79fecb3c96e96405
This change affects list=allusers, list=users
and meta=userinfo.
Note: This change also add block expiry to meta=userinfo.
Unlike this field in other modules, it formats the timestamp
properly, instead of just dumping db contents.
Resurrecting from abandoned change Ifdeac5c5f547
Bug: 63326
Change-Id: I4b3e55fe2d07271e1ded89d36d0b98de0e643177
Soon the simplified continuation will become the default for
action=query. This parameter will then serve select the return of the
raw continuation data. To allow for clients to transition without
"unrecognized parameter" warnings, I'd like to add the parameter now
before even adding deprecation warnings.
Change-Id: I5f6895b6a94c53a231a50707ee9463f91295da8f
Poorly documented and never used anywhere properly.
- No core search backend supports it.
- MWSearch implements it but we've never turned it on.
- SolrStore copies MWSearch but it doesn't even work.
- CirrusSearch doesn't bother because it's silly.
Change-Id: I8b052e8e772030fba6c361fdb2775b10a7f7a15a
The existing query only works with a single value for augroup, or mostly
if it's combined with auprop=groups or auprop=rights (since most users
don't have every possible group).
When used with multiple values for augroup, it will raise an error if it
happens to encounter enough users who have more than one of the
specified groups. And further, it will lead to repeated groups for these
users if combined with auprop=groups or auprop=rights.
To avoid both these issues, let's use EXISTS instead of a JOIN to test
augroup. While auexcludegroup doesn't have this problem, we may as well
make the same change there, too. And doing that, there's no reason to
continue with an error when both augroup and auexcludegroup are used.
Bug: 70496
Change-Id: Ia7086ce87012c22651ac4c7a3f75558347276226
Depending on what method is being used to encode the binary sortkeys,
it's very possible that sending a binary value will be mangled by
WebRequest's UTF-8 normalization.
Rather than trying to fight it, let's just do what should have been done
in the first place when r86257 changed sortkey output to hex-encoded.
Too bad now we have to deprecate the old params and add
differently-named new ones instead of piggybacking on the original
breaking change.
Bug: 70690
Change-Id: I5a031e980967cbe574dddc261d56604cecc7147a