Commit graph

649 commits

Author SHA1 Message Date
libraryupgrader 7579f4f3ad build: Updating npm dependencies
* eslint-config-wikimedia: 0.22.1 → 0.24.0
* grunt: 1.5.3 → 1.6.1

Change-Id: Id9da2a580068e3cbf99398972254f4f1083e257a
2023-03-15 22:10:58 +00:00
libraryupgrader 50bd785723 build: Updating mediawiki/mediawiki-codesniffer to 41.0.0
Change-Id: I909778b70d8cdb48b5717587b5fa89a5c56b3a77
2023-03-12 08:03:31 +00:00
Translation updater bot ba728a6c89 Localisation updates from https://translatewiki.net.
Change-Id: Ifb6a9109cd50520987d928cbbdb22fb227e28693
2023-01-12 08:42:42 +01:00
Translation updater bot 69da29482f Localisation updates from https://translatewiki.net.
Change-Id: I89631b6a919b162258adb62abc320c2ce4d79d3a
2022-12-21 09:17:13 +01:00
libraryupgrader f373b0d59d build: Updating mediawiki/mediawiki-codesniffer to 40.0.1
Change-Id: I051a036ffcfed735d88cc484b0db6a0bf3001151
2022-11-16 13:10:02 +00:00
libraryupgrader 792e60be50 build: Updating minimatch to 3.0.8
* https://github.com/advisories/GHSA-f8q6-p94x-37v3

Change-Id: Icf96f0fa9fb673547a0e44cf30e437077659a41f
2022-10-21 12:28:30 +00:00
Translation updater bot 701d081619 Localisation updates from https://translatewiki.net.
Change-Id: Iac327f7fe455cf81bbf3ea9d2500c974c9c401b9
2022-10-10 10:20:52 +02:00
libraryupgrader 16407d97ec build: Updating mediawiki/mediawiki-phan-config to 0.12.0
Change-Id: Ia27765f11934844a40b36c34cde79014f38423d5
2022-10-09 08:29:30 +00:00
libraryupgrader d86556258b build: Updating grunt-banana-checker to 0.10.0
Change-Id: I7a025123fde24556c1f28a1b259a902905a0e662
2022-10-07 03:41:16 +00:00
Translation updater bot 92fe2e7bd2 Localisation updates from https://translatewiki.net.
Change-Id: I96bdbeaed71ce2ac5bcbb2771c5f4a80cd8a3916
2022-09-28 08:22:27 +02:00
jenkins-bot df0a020174 Merge "PdfHandler: Set cache with clearer key group and finite expiry" 2022-09-19 04:48:32 +00:00
Timo Tijhof a43a11136a PdfHandler: Set cache with clearer key group and finite expiry
* The key group should generally reflect a single logical key,
  usually a single getWithSet call, with the rest being variants
  of that key, e.g. not a namespace.

* Give it an explicit expiry. I noticed this issue by reviewing the
  remaining data stored on WMF's mainstash-redis instances.

  There were some old file-pdf:* keys there from long ago. They were
  able to survive this long due to not having an expiry set.

  Ref https://phabricator.wikimedia.org/T280586#8168908
  Ref https://phabricator.wikimedia.org/T314453#8168858

Change-Id: Ibad24c0ac7d1e7f965227f49320814b96375858e
2022-09-02 15:18:23 +02:00
Translation updater bot 65e15cbac4 Localisation updates from https://translatewiki.net.
Change-Id: I21e3cefe84b3aab25ad4328a44169e642a56ede6
2022-09-01 09:34:24 +02:00
Translation updater bot 45aa3def2c Localisation updates from https://translatewiki.net.
Change-Id: If06b8f46b16ca2a653f5952d2fe73da8113c5909
2022-08-12 08:43:48 +02:00
jenkins-bot 7a14e5509d Merge "Use the PDF cropbox for rendering" 2022-08-05 17:45:19 +00:00
Translation updater bot 5719558376 Localisation updates from https://translatewiki.net.
Change-Id: I917bc5c30f52cc98aea8b8038f40c860e03d0333
2022-08-03 08:18:44 +02:00
Translation updater bot 9bce161efa Localisation updates from https://translatewiki.net.
Change-Id: I8da657e7150fa26fc8f82577172c99cd9bdce221
2022-08-01 08:23:14 +02:00
Translation updater bot 72350e99a5 Localisation updates from https://translatewiki.net.
Change-Id: I64db223a3427a514aca95a3e1a3be278dd935c30
2022-07-25 08:38:26 +02:00
Translation updater bot 1e392d855c Localisation updates from https://translatewiki.net.
Change-Id: I831292bbfdb1e0699a09051fa2d6c30367d47b8a
2022-07-01 08:53:23 +02:00
Derk-Jan Hartman b846970ae2 Use the PDF cropbox for rendering
By default the mediabox is used. This is the full potential area of
pages, as also used by PDF editors and can contain areas outside of
the page.
The cropbox is also the size that is reported by pdfinfo as the
pagesize.

Bug: T167420
Change-Id: I92267a9dbe81b6e0e471b8eae1e4c2ba4e5d84e9
2022-06-15 18:39:35 +00:00
Translation updater bot ab9d2d689d Localisation updates from https://translatewiki.net.
Change-Id: I5017c97f94487c2f4b9ed93076b036e5b61b5d60
2022-06-06 09:26:27 +02:00
libraryupgrader 14814e141c build: Updating grunt to 1.5.3
Change-Id: Id5a81e345d9cb21f5ea9c8d914ab103a388cb504
2022-05-26 21:03:05 +00:00
libraryupgrader 9d3c3b0c5b build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 38.0.0 → 39.0.0
* mediawiki/mediawiki-phan-config: 0.11.0 → 0.11.1
* php-parallel-lint/php-console-highlighter: 0.5.0 → 1.0.0
* php-parallel-lint/php-parallel-lint: 1.3.1 → 1.3.2

npm:
* eslint-config-wikimedia: 0.20.0 → 0.22.1
* grunt: 1.4.0 → 1.5.2
* grunt-eslint: 23.0.0 → 24.0.0
* async: 3.2.0 → 3.2.3
  * https://github.com/advisories/GHSA-fwr7-v2mv-hh25

Additional changes:
* Set `name` in package.json.

Change-Id: I7310b118631d24bcd6cea2ffb7bd79490dbb6954
2022-05-21 09:29:19 +00:00
Translation updater bot 17a370c3af Localisation updates from https://translatewiki.net.
Change-Id: Ia0d6046658222fe9ee2ef146d0e322ef78f6dd47
2022-04-15 09:56:49 +02:00
Umherirrender 42c1ee7c0a build: Remove unneeded suppression after ImageHandler::normaliseParams
Depends-On: I8d14e49340d30c56642422cd88169019dd2c4286
Change-Id: Ie4561840fe70e0ef92e8eec1c6edc335f0da6c1f
2022-04-06 21:32:32 +02:00
Translation updater bot 9c8931a74f Localisation updates from https://translatewiki.net.
Change-Id: I81de45fa9b70601c9e149b68a329ab049886f3d2
2022-03-29 08:06:05 +02:00
zoranzoki21 68b4048e0e Fix excluded PHPCS error MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
Change-Id: Iba99ebfc6e96bdfbd61f2a8151c54f1e50272d26
2022-03-06 13:23:43 +00:00
Translation updater bot c966f339e3 Localisation updates from https://translatewiki.net.
Change-Id: Iaacfd67462b558f6413eb4140efe2c357f9c64dd
2022-02-14 08:14:58 +01:00
Translation updater bot 0d4b649d70 Localisation updates from https://translatewiki.net.
Change-Id: I83136c3621c36d29d692c47331f86d18bc7386a7
2022-01-18 08:11:10 +01:00
Umherirrender f07840d997 Require MediaWiki 1.37 for File::getMetadataItems
Used File::getMetadataItems is part of
I039785d5b6439d71dcc21dcb972177dba5c3a67d

Follow-Up: I30d0b0009fcb11c14d14663bd1f2c2a3dfac55d6
Change-Id: Iddacb31efc9ec9da3ba87c7c8cdac04a36a1af39
2022-01-01 16:08:24 +01:00
libraryupgrader 77621e1dee build: Updating mediawiki/mediawiki-codesniffer to 38.0.0
Change-Id: I81f98d5a2afd7cbaca108efd050d95e21d941af1
2021-10-24 09:59:33 +00:00
libraryupgrader 009099c41c build: Updating ansi-regex to 5.0.1
* https://npmjs.com/advisories/5197 (CVE-2021-3807)

Additional changes:
* composer.json: Updated phpcs command in composer test (T280592).
* composer.json: Added phpcs command to scripts (T280592).

Change-Id: Ia80b5eb4c6166aaaadd2c7e5784c16419e75f4f7
2021-10-05 05:59:48 +00:00
Umherirrender 44e2d41b8f build: Disable phan option scalar_implicit_cast and make pass
Change-Id: I30c11acd17334f292c7a83dba49cf59d182728f3
2021-09-26 12:18:33 +00:00
Umherirrender 85fbb12dbe Remove unneeded check for return value of explode
explode returns an array with one item,
but the empty string is already checked before the explode

Change-Id: I441309978b25754bad04eeba69993913de4d48c3
2021-09-26 11:46:08 +00:00
Kunal Mehta b253dc04c4 Port retrieveMetaData to BoxedCommand
Combine all 3 shellouts into one script, retrieveMetaData.sh.

The script is executed by /bin/sh by default, it can be changed for
Windows users by setting $wgPdfHandlerShell.

pdftotext is a bit special since it's behavior varies based on the
program's exit code, so save that in a file so we can check it
independently of the overall exit status.

Bug: T289228
Change-Id: I29750bcc282bd5f9b8e2f79aa340869738ea5f5b
2021-09-20 10:28:27 -07:00
Reedy 7d6a851e1d Code tweaks
* Some better variable names
* Remove some temporary variables

Change-Id: I71ac904c43449891e34769e6dfdc271fe91ef865
2021-09-19 01:56:26 +01:00
Translation updater bot b76bd4b4f9 Localisation updates from https://translatewiki.net.
Change-Id: I74e7eb602d268fe2e4c176809a36cef651276def
2021-09-13 08:30:07 +02:00
libraryupgrader 3bf782945c build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: I595d9b6d549cf75a56be8e2cb151ec329d5919c9
2021-09-09 05:11:44 +00:00
Kunal Mehta bbb15eb87c Remove questionable PdfHandler::isEnabled() implementation
The variables are set to default values in extension.json, so
someone would have to manually set them to null values to trigger
this check. At that point, surely you'd just disable the extension.

A check like is_executable() might've made sense, however with the
introduction of Shellbox, it would be totally fine for the binaries
to not exist on the host where MediaWiki is running, but only in the
container. So just removing the check seems like the most
straightforward thing to do.

Bug: T289228
Change-Id: I5da0625959fdfa01c36c955c82320dbc591b3f23
2021-09-03 01:07:49 -07:00
Kunal Mehta 2328f802b1 Move pdfhandler.messages module to extension.json
These messages have not changed since they were originally defined
in f4f87ceb (2015). Instead of using a hook to register the module
at runtime, put it in extension.json with a note next to the warning
configuration to keep the messages in sync.

Change-Id: I135bf1a9f2cd59926a40cc565e5c8a2a6f2483c0
2021-09-03 00:59:19 -07:00
libraryupgrader 2e5afea2bc build: Updating path-parse to 1.0.7
* https://npmjs.com/advisories/1773 (CVE-2021-23343)

Change-Id: I19f5c12b8b0f6ba6e78c138cd62497d1ea81f8d0
2021-08-12 06:47:48 +00:00
libraryupgrader baacee933a build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: I5cb81cdbefee813e98b8582838bac70e05eab7a5
2021-07-23 07:08:39 +00:00
jenkins-bot 4e38d0ed99 Merge "Remove $wgPdfCreateThumbnailsInJobQueue" 2021-06-29 00:47:10 +00:00
Tim Starling 86df1cd6c6 Fix broken PDF XMP extraction
XMP extraction does not work for me with libpoppler 0.86, because when
the output of the two commands is concatenated, there is no "Metadata:"
prefix introducing the XMP. It ends up splitting every line of the XML
on colon characters in attribute names, spamming lots of little
properties into the final result.

I can confirm that it's also broken in production.

So, just treat the output of pdfinfo -meta as plain XML.

Change-Id: Ia3df17daed0f27e95294b5d97872ec064c79965c
2021-06-11 15:57:04 +10:00
Tim Starling 989b42b8eb Use the new metadata splitting facility to improve PDF performance
* Migrate to the new metadata system: override getSizeAndMetadata()
* Use getHandlerState() instead of a custom property on the File object.
* Opt in to metadata splitting. Avoid loading the text item unless it is
  really needed.
* In getDimensionInfo(), use getHandlerState() instead of the
  WANObjectCache process cache (pcTTL). This is just a
  micro-optimisation, informed by profiling, which showed 90 calls to
  this function during an image page view.

Depends-On: I876ea5c9d3a1881e278f689d2f8a3ae20240c703
Change-Id: I30d0b0009fcb11c14d14663bd1f2c2a3dfac55d6
2021-06-11 15:56:57 +10:00
Tim Starling 06fec68e08 Remove $wgPdfCreateThumbnailsInJobQueue
The feature is nonfunctional due to the page count always being zero
when the hook is called. The core feature $wgUploadThumbnailRenderMap
can be used as a replacement, after I add multipage support to it.

Bug: T284416
Change-Id: Id83a6a148f1ca12f1399b5e11951a9d80afb5c2d
2021-06-07 14:56:34 +10:00
libraryupgrader 5073f572cb build: Updating browserslist to 4.16.6
* https://npmjs.com/advisories/1747 (CVE-2021-23364)

Change-Id: I4a5dce17cc23a0fda7a945525a839c9697862e21
2021-05-26 01:30:24 +00:00
Translation updater bot b11d814d97 Localisation updates from https://translatewiki.net.
Change-Id: If1ec180a7effe48e25eb6bf9606715315eb4e4b1
2021-05-25 08:53:32 +02:00
libraryupgrader d82137564f build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
  The following sniffs now pass and were enabled:
  * MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic

* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

npm:
* grunt: 1.3.0 → 1.4.0
* lodash: 4.17.19 → 4.17.21
  * https://npmjs.com/advisories/1673 (CVE-2021-23337)

Change-Id: I1afc4814a0d4645c4ff08f9c6845f0bbc2353900
2021-05-12 14:12:43 +00:00
libraryupgrader a748147bb6 build: Updating eslint-config-wikimedia to 0.20.0
Change-Id: Ibf806fead4d321a7291ebf315576a1b90aef97be
2021-04-13 23:32:41 +00:00