When iiurlheight is given without iiurlwidth, we want to limit the
thumbnail by just the height. MediaWiki's file classes don't really
support this, though, so we pass the image's full width as the limiting
width to achieve the same effect.
However, this fails for audio files where $file->getWidth() returns 0,
but we can still get a thumbnail of a placeholder image. In that
situation, we should just choose an arbitrary non-zero limiting width.
Change-Id: I4318a06a96265d39e39e90cc706d49a1c3b6e8e3
This patch set changed some
- "link titles" to "linked titles"
- "transclusion titles" to "transcluded titles"
Change-Id: If536368e95ca5e160d8a69e832e67e3248b787fd
Currently, WatchAction::doWatch and WatchAction::doUnwatch return true
always. Let's have them return a status object instead.
This also cleans up the handling of Status objects in some of the API
modules.
Change-Id: I9dd9f0fd499c37f29fa12bcdb6142238a1f11e4d
The documentation for action=parse needs clarification, particularly in
light of the changes made in Ie4f7324c which were too hastily merged.
Also, add the RELEASE-NOTES entry missing from Ie4f7324c.
Change-Id: Ia8847f7e99620a9f7af24956d972c882f78aae26
action=parse was raising an error about missing 'text' with 'title' even
when 'title' wasn't actually passed, due to a fix for bug 33865. But
this broke using action=parse to parse an edit summary without also
giving it wikitext to parse.
Instead, let's give the client a warning (unless it seems clear they
know what they are doing) and assume the empty string for 'text'.
Also, while we're editing the file, add some more examples as also
requested in bug 48319.
Bug: 48319
Change-Id: I03c1fbcb0bd31dea8bd84e164104f7ced0ace449
The current handling of the bkip parameter assumes IPv4, and breaks for
IPv6 CIDR ranges (it also isn't working right for IPv6 non-CIDR, but not
in an obvious way).
This rewrite handles IPv6 correctly. It also necessarily adds validation
for the bkip parameter, which would formerly return (not very sensible)
results when passed invalid values.
Bug: 48129
Change-Id: I02471bb32c3a217004d07a79d9f98b62133b31ef
In https://gerrit.wikimedia.org/r/#/c/67266/, it was enabled automatically
when a section was specified in preview mode. However, this only works for
previews of a saved page's content, failing for user input previews which
might contain several sections of various degrees of nestedness.
Change-Id: I987144e5e315ed9e0a67f599083461a78879c0df
This became necessary as it's quite hard to
get the rc id of a change from the html after
I1e24733c.
Bug: 49259
Change-Id: Ia7d3960cf11bf8ae0fc06ae1a0f7fcfb3c080f21
Currently notoken is being listed as possible
API error twice if it's explicitly set as
required parameter and needsToken() returns
true.
See:
https://www.wikidata.org/w/api.php?action=paraminfo&modules=edit
Change-Id: Ia17c5cfa634919b43affa146df0d1dc0ff06b758
dieUsage will call encodeParamName, which will already prefix the error code with the module prefix
E.g. for ApiViewFeedbackArticleFeedbackv5 (prefix afvf), this error code was
(incorrectly): afvfafvfinvalidparammix. Should be: afvfinvalidparammix
Change-Id: Ia351678b49e96ef58dce773331ebe9a1b3ebf824
I915c1678 fixed single-chunk chunked uploads for the common case, but
didn't store the data for async uploads under the correct filekey. This
fixes that.
Bug: 48294
Change-Id: Idbeab2fd0d801974b610198dcf02c81798f65a0d
When writing a new extension the source:
public function getExamples() {
return array(
//TODO
);
}
would produce a empty "Example:" header on the help page. Avoid this, by
changing the condition to check for truthy instead of false and empty
string.
Change-Id: I67ecacbbac66b97ed96412abf79b49aebe0ebdbf
SpecialPage::getContext called and $mContext is null. Return
RequestContext::getMain(); for sanity
Change-Id: Ie0ed360835164e8a4eb1c675ec8edd944ab95898
This can be useful to determine the language of a page, for example
javascript has english as page language. MediaWiki pages has it page
language corresponding to the lang code in the sub page.
Change-Id: Idd0412574b314ecf52d92243a3f8a08755474663
action=query&meta=siteinfo&siprop=skins can easily indicate which of the
returned skins is the default and which are unusable (e.g. because
they're listed in $wgSkipSkins). So we may as well do so.
Bug: 47216
Change-Id: Ib4ea5fe85e1b02895dba15f3a245c7a7d8724470
Badcontinue results in
<error code="unknownerror" info="Unknown error: "badcontinue""
/>
because there is one array deep too much.
Change-Id: Iff88c3864f65e5da6cd31594396dffdaa71b5593
I came across people complaining that it was hard to associate
upload log events to actual images since img_timestamp could
be different from log_timestamp, and generally no unique id.
Well I was there I made uploads use the new logging system.
Change-Id: Icd8662ecb9eb0f6c0ff9841bdbd5736d6dd0d015
Squiz.WhiteSpace.LanguageConstructSpacing:
Language constructs must be followed by a single space;
expected "require_once expression" but found
"require_once(expression)"
It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.
Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.
It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.
Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
Wanting to get a thumbnail with only the height constrained is a
reasonable use case, the only reason we don't support it in the
API is because the backend doesn't support it directly. This is
easy enough to emulate by setting the width to the full width of
the image if only the height is specified. This makes the transform
function use a bounding box of size w x h, and if w is the width of
the original image that's equivalent to just bounding the height.
Change-Id: I28c7c22ee91669469cbd9e7d25f09100933582de
It exposes field /rc_type/ as ApiQueryRecentChanges does thus allowing
user to define which (edit, external, new, log) changes to show in feed.
Bug: 47219
Change-Id: If22827129b04d423711f921307dc820d4840d9d1
This adds a new hook called LanguageLinks which is called
whenever a list of language links is returned to the user.
This gives extensions the option to manipulate the links
on the fly.
Note that this change only covers the language links used
in OutputPage and by ApiParse. Adapting ApiQueryLangLinks is
left as a follow-up task.
As explained on bugzilla, this is a precondition to
allowing Wikibase/Wikidata to update languagelinks without
forcing a (redundant) re-parse of the page content.
This change also introduces the notion of link flags that
can be used to associate flags with language links. This
will be integrated with ParserOutput and OutputPage in a
follow-up.
Change-Id: Iaec0faa131413a291fc8f77496e4f371addb3b99
Before showing the contents of a title in the generated feed, check
that the calling user has permissions to read the specific title.
Change-Id: Iba16a5489d80cd4f0958ad6bbcf2e1a948e97f93
This is a followup to I54ab5207, which allowed search backends
to return status objects. We handled it in Special:Search, but
the API was overlooked.
Bug: 47353
Change-Id: Ib7abe8d5bc19d27c472053602c0e43cb1301b078
This allows extensions to modify the array.
This completes the serie of hooks for similar get methods in ApiBase.
Change-Id: Ib398f5815ab57f25d56356b0997c55a03fd96874