The return value of ParserOutput::getPageProperty() has transitioned
to returning `null` instead of `false` when the page property is missing.
Bug: T301915
Depends-On: Iaa25c390118d2db2b6578cdd558f2defd5351d15
Change-Id: Ie746883bd14eb579b40390d5fe824a5c6f93fa1e
The return value of ParserOutput::getPageProperty() will transition to
returning `null` instead of `false` when the page property is missing.
Bug: T301915
Change-Id: I383abb6b7dc5e96c0061af13957609f6e31a1065
Including regression test for T299798.
Bug: T299798
Depends-On: Idc4ac4eb4e20d8e3e2fdbd093ff75f26d3af0d57
Change-Id: I89fa346651e756d1981a950a8b778020359b86a2
I added ParserModifyImageHTML to core to make it easier for PageImages
to identify images in the lead section.
This also allows PageImages to stop writing to LinksUpdate properties.
It is one of only two extensions that do that.
Depends-On: I24528381e8d24ca8d138bceadb9397c83fd31356
Bug: T176520
Bug: T296895
Change-Id: I472f4a023969bfde6298eb56112c16d2ae842199
SearchResultPageIdentityValue will become an alias for
PageIdentityValue, which requires the forth parameter.
Needed-By: I6eb55c78a0a72be66814f8bc854ba663e7c6f62b
Change-Id: I9b1ab02e0acf12ace107361ea2c443aa543c4880
Replace instances of "blacklist" with "denylist" throughout extension.
Bug: T277955
Depends-On: Ib4985ec2fcb22eafad8f3a7cf9fc3161782a71db
Change-Id: Ibe460cb9691d56a9e83686b53c7629b5404af6fb
* any() doesn't do anything. It's the default anyway.
* Prefer the more strict assertSame() where possible.
* Use shortcuts like createMock() where possible.
Change-Id: Iff33f111312448e9fc8ff827e2ef9eb2b583ff6f
As we switch ParserCache to JSON, we can no longer serialized
class instances in extension data. PageImages was writing the
full set of properies it received from Parser into it's extension
data, some of which are sometimes class instances. Instead, only
write the nessessary subset of data into extension-data.
This change is completely forward and backward compatible.
Since before this change we were already writing the same array,
but with many additional unused properties.
Bug: T266251
Change-Id: Ieb4a139465159611e6b3a99c4b68c3c174b1944f
* Images on pages can be localized (eg. SVG text)
* Allow API consumers to select the language the images are rendered in
Bug: T257082
Change-Id: I05f498444c55aea9028a58de80e21ba1e236bf02
SearchResultProvideThumbnail was introduced in T250144. In order to fill
search results with the "thumbnails" field it should be implemented in proper extension.
Bug: T250207
Change-Id: I81d5d70f5237d6399b8ec6bec3058d12e40ca142
Avoid array_map/array_flip + foreach when doing the simple thing also in
the foreach
Swap Title::newFromText to Title::makeTitle to avoid reparsing the
string
Bug: T237068
Change-Id: I745cb9bd817a4b2274c6f778c38c58846ef318c1
This allows to use floats in the $wgPageImagesScores configuration.
Before, decimal places have just been cut off with no warning. I find
this pretty unexpected. When I see the terminology "score" being used,
I always think of float values. I checked all the code that consumes
these scores (it is all internal to LinksUpdateHookHandler), and it's
all fine with floats. I don't see a reason to forcefully cut decimal
places off.
Bug: T212013
Change-Id: I0f1f0ea0865f07b3e58a2fc142dcd838eb687c97
This patch is motivated by Iad694e0.
* I rearranged the code a little bit to avoid a duplicate line of code.
* I added a ksort() and a comment explaining it.
* Additional tests demonstrate why the ksort() is needed.
* I had to refactor the tests a little bit to allow for more test cases
that have been missing before.
Bug: T212013
Change-Id: Ia96dc8c6cf57ddcea410a7300756d0013052ac79
Such @doc… keys are not allowed at this level. They make it to the code
and cause confusion there. I added a test case for an edge case where this
really causes wrong results.
Bug: T212013
Change-Id: Ib391e5639ef5a34f9ee44f8c19b99e1dd19207bc
`$leadImages || $images` will return a boolean, it doesn't work like
JavaScript or Python. Use `?:` to implement what was wanted.
This only worked because `count( true ) === 1`. Using assertCount()
would have caught it also.
Change-Id: I11357b23ad1124ed96d863872014cdca7c59e284