Commit graph

639 commits

Author SHA1 Message Date
Translation updater bot af60dcf659 Localisation updates from https://translatewiki.net.
Change-Id: Ibc9ab3ad7329b44f74648d82245b429f9e483fc2
2022-10-13 07:23:27 +02:00
Translation updater bot a4528b4568 Localisation updates from https://translatewiki.net.
Change-Id: Id5517b60f10e710de0046eb4bf1522dbbd205ed0
2022-09-29 07:14:37 +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
Translation updater bot 63dd641e2b Localisation updates from https://translatewiki.net.
Change-Id: I5065f667eada52dad357bb77ce9f12fa910a0735
2021-04-12 08:38:30 +02:00
Umherirrender 5740d02758 Use ::class for class name
This works also for non-existing classes,
because it is resolved on compile time

Change-Id: I789df6994b22529a8bc09123369dae0f1b52d565
2021-04-08 21:02:46 +02:00
libraryupgrader 42afa92436 build: Updating eslint-config-wikimedia to 0.19.0
Additional changes:
* eslint: Renamed `wikimedia/client` profile to `client-es5` (T277085).

Change-Id: If8c84a6f8619a85329264684b8ac94f6892929a4
2021-03-14 07:03:44 +00:00
libraryupgrader 1e5d95d5fa build: Updating eslint-config-wikimedia to 0.18.2
Change-Id: I768aa7211bb69cbeb0b2acdb3e79c82af99ddd45
2021-03-07 13:44:24 +00:00
vladshapik c73192e23d Avoid using User::getDefaultOption
Remove using of User::getDefaultOption since this method will be hard-deprecated. Now it is soft-deprecated

Bug: T276035
Change-Id: I6b489dc7236998bcfee6fa136167c3712757dd39
2021-03-01 12:25:47 +02:00
Reedy f375ff3bde Code cleanup
Change-Id: I8eaba727c73560eadb11ae471853e5cedc547809
2021-02-11 20:33:34 +00:00
Reedy 5f0b70972d Namespace extension
Change-Id: I1e80a32a71e4b15d38e1e91b866dbcca848f188c
2021-02-11 04:14:37 +00:00
libraryupgrader c00da59c93 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
* mediawiki/minus-x: 1.1.0 → 1.1.1

npm:
* eslint-config-wikimedia: 0.17.0 → 0.18.1

Additional changes:
* Added the "composer phan" command to conveniently run phan.
* Removing manual extensions for eslint.

Change-Id: I23c7fdeedbcecb222201311eb0a32608abc99f12
2021-01-30 07:21:55 +00:00
Translation updater bot 27fcbf8784 Localisation updates from https://translatewiki.net.
Change-Id: If56c20739ce71a91b335931e2c88ea7b185298b4
2021-01-18 08:39:17 +01:00
libraryupgrader b579369dd5 build: Updating mediawiki/mediawiki-phan-config to 0.10.6
Change-Id: I883ff3d98b4b6da15eebe3fc7371723d71a6e8be
2020-12-19 23:55:03 +00:00