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
The file page for an image should include the `og:image` meta tag. Thus,
a thumbnail is shown for the image when posting a link via social media.
Relates to Ide250d489a1ceedd7e896a3b44471752f0971fb1.
Change-Id: I81435289a4a6c7749462ba447aa626120a9c821c
The hook is called during page move. If you try to fetch the current
page content from the replica, it won't be there with the specified
title, causing an exception.
Bug: T221763
Change-Id: Ib91bf399f251fc715d8f27a4f8f7f4c9db9d30c8
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
Original image info is now a first-class output property, and the
'original' property of the 'thumbnail' object has been deprecated since
December 2016 (with an API warning provided since then when original image
info is requested). It should be safe to remove at this point.
(N.B. The 'original' property was an undocumented piprop before the format
update, and the legacy output likely sees little if any usage.)
Bug: T152163
Change-Id: I73b476f9e50c14f705a30e20bc836b8db371f5f0
The following sniffs are failing and were disabled:
* MediaWiki.Files.ClassMatchesFilename.NotMatch
* MediaWiki.Files.ClassMatchesFilename.WrongCase
* MediaWiki.Files.OneClassPerFile.MultipleFound
The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
Change-Id: Ibb3e8fbef168f886d2385565df85015c08b2f02a
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment
Change-Id: I3554682b5c8686299dc8cf23a3ec8c59514ff008
This tag is useless and does nothing without og:title and
og:description also being present, which is not the case
right now. A more complete patch should re-introduce all
three tags in one go.
It is also questionable if this tag belongs to this
extension, because it is explicitly said that the image is
an optional element of a Twitter card. og:title and
og:description are not optional. og:description would
probably be set by the TextExtract extension. This means
this Twitter card tag belongs more to TextExtracts and not
to PageImages.
This reverts commit 2e83a2c1dc.
Bug: T157145
Change-Id: I17ffe8f83d91156a79facb4c35b4a15ecc49f108
This is still only testing negative cases with no page image.
In addition this patch does sort all the hook handlers
alphabetically, and adds a missing PHPDoc block.
Bug: T51859
Change-Id: Iea65f2181dd3cac3ec2ceac191f002f74af3ec24