Page MenuHomePhabricator

Don't calculate size of a thumbnail
Closed, ResolvedPublic

Description

In SearchResultThumbnailProvider.php, the size of a thumbnail is calculated.

Not only is this intensive to compute (and could be an attack vector), it's also quite pointless as it's derived from thumbnails, which in turn are derived concepts for which the implementation may change.

AFAICT, none of the consumers of this API even use this data (so it's inclusion is negatively affecting them by slowing response times down)
It's also not consistently available: for most of the thumbnails, this data is usually null.

See T321006#8376587 for more context.

Event Timeline

Change 856992 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/core@master] Don't calculate size of thumbnails

https://gerrit.wikimedia.org/r/856992

Change 857021 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/PageImages@master] Remove size check

https://gerrit.wikimedia.org/r/857021

Change 857021 merged by jenkins-bot:

[mediawiki/extensions/PageImages@master] Remove size check

https://gerrit.wikimedia.org/r/857021

Change 856992 merged by jenkins-bot:

[mediawiki/core@master] search: Don't calculate thumbnail sizes in SearchResultThumbnailProvider

https://gerrit.wikimedia.org/r/856992

TheDJ subscribed.

Pretty sure this one was resolved with the above patches, but please reopen when required. Follow-up is T323126.