Commit graph

1259 commits

Author SHA1 Message Date
Yaron Koren 5190b2cd39 Calculate string length separately for each replaced string
If regexes are used, the length of the target string is not always (or even ever) the length of the user-specified "target".

Change-Id: Id693a5f29e4d5bd0a7b420286a525971d56b4b60
2023-03-28 12:50:30 +00:00
Winston Sung 40858a4894 ReplaceText: Special page aliases should not store in zh
Bug: T286291
Change-Id: I01f8dd76334dea0e90820c8b52ccf4df786f7859
2023-03-22 12:22:26 +00:00
libraryupgrader 37a50fa4da build: Updating npm dependencies
* eslint-config-wikimedia: 0.20.0 → 0.24.0
* grunt: 1.5.3 → 1.6.1
* stylelint-config-wikimedia: 0.13.1 → 0.14.0

Change-Id: I2f6b83af9c81ef9160bf14d92d01235a8c83e37c
2023-03-15 22:53:07 +00:00
libraryupgrader 134cfc72ca build: Updating mediawiki/mediawiki-codesniffer to 41.0.0
The following sniffs now pass and were enabled:
* MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage

Change-Id: Ic9a9253e8a249e76b9017d7c3214bce219db7682
2023-03-12 09:15:50 +00:00
jenkins-bot a919ddf8ef Merge "Make Special:ReplaceText work for contents based on TextContent" 2023-02-23 13:00:47 +00:00
Umherirrender 9a9a8c940f build: Resolve npm peer dependencies in package-lock.json
Run "npm dedupe" to resolve peer dependencies in package-lock.json,
a update can fail with missing or invalid packages on peer deps
More information https://github.com/npm/cli/issues/5113 / T325299

Change-Id: I8717bda366d1810973ae3da052c1fb9732811a08
2023-02-17 22:58:15 +01:00
jenkins-bot 9b0f7ff6fe Merge "Don't add a link to Special:ReplaceText if the user has no permission" 2023-01-27 21:34:02 +00:00
Fomafix eb35dd8b85 Remove default value null on second parameter of LinkRenderer::makeLink
Change-Id: Icd566d7dc4f8ed81078f3e9f12f7603afc61012a
2023-01-26 21:43:55 +00:00
jenkins-bot 2dac8f31df Merge "Remove loading of style module 'mediawiki.special'" 2023-01-26 20:29:53 +00:00
Fomafix d42d31a89e Don't add a link to Special:ReplaceText if the user has no permission
Change-Id: I72a9d6ef96a5843ade002dfe1e408e35c1c2d6c4
2023-01-19 22:59:43 +00:00
Fomafix 82cc22a9f2 Inject Config and replace global variables
Change-Id: I824ed32728ab4ce8e532734890ac51a4a4527d8a
2023-01-18 19:39:23 +00:00
Fomafix ad9de84501 Use HookHandlers and inject services
For LinkRenderer use SpecialPage::getLinkRenderer.

Bug: T271025
Change-Id: Ibde96ffce089f77e85826f0ec5b446b81fac8240
2023-01-18 19:39:12 +00:00
Translation updater bot 805e10e058 Localisation updates from https://translatewiki.net.
Change-Id: I4505d94f4871e1a954fafbd5d43e2122bf0cd56d
2023-01-11 09:02:31 +01:00
Translation updater bot 051b7ac8ae Localisation updates from https://translatewiki.net.
Change-Id: I728f3de247e714c99f3c761958950fbba594b9cb
2023-01-09 09:28:45 +01:00
Func a2b09220fe Make Special:ReplaceText work for contents based on TextContent
The check for TextContent is added in ed9c752, which is good, but
not all codes updated to work for contents based on TextContent.

Works well with css, js, sanitized-css (TemplateStyles), and Scribunto
content models acording to my test.

Change-Id: I9ea9d1474de7dd4207924bd038a8c62ec55726bb
2022-12-25 17:03:13 +08:00
Translation updater bot 8d77ba0ee8 Localisation updates from https://translatewiki.net.
Change-Id: Ic6ca932bf7c6f36bb71f930ed547307f19171d4f
2022-12-21 09:17:42 +01:00
Translation updater bot 9414710bac Localisation updates from https://translatewiki.net.
Change-Id: Ibe7700403d76d2ec97f4a87ec7f71b9666e3fc38
2022-12-15 11:36:45 +01:00
Translation updater bot e56d11cb53 Localisation updates from https://translatewiki.net.
Change-Id: I6af5d477802b1bc21ecfacfa654571c0a47aafe6
2022-12-13 08:17:29 +01:00
jenkins-bot a6cc8c6ef4 Merge "Replace $wgLang by $this->getLanguage()" 2022-12-03 20:46:59 +00:00
Translation updater bot ed73238351 Localisation updates from https://translatewiki.net.
Change-Id: I45b8ce2326dba20ca7a2e99534fc8ee5e7f5a3e2
2022-11-29 08:59:14 +01:00
Translation updater bot 0624163acd Localisation updates from https://translatewiki.net.
Change-Id: Ia6282de1593907bdb8eedb6d8f0742f68e25c510
2022-11-28 08:50:11 +01:00
James D. Forrester e41c493a68 Drop backwards-compatibility; this is a tarball extension
Tarball extensions follow the branch versions development policy.

Change-Id: I4ad623f61b4113ec76d2abf9e013de483e56170c
2022-11-17 16:16:59 -05:00
jenkins-bot 4ec204fc3f Merge "Use single quotes instead of double quotes in PHP" 2022-11-17 20:10:31 +00:00
libraryupgrader ae4efcb361 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 38.0.0 → 40.0.1

npm:
* grunt-stylelint: 0.16.0 → 0.18.0
* stylelint-config-wikimedia: 0.11.1 → 0.13.1

Change-Id: I6d7aa02d387497cf5ebadc1165c082b471ce65d5
2022-11-16 14:46:17 +00:00
libraryupgrader 708c7d7ffd build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.11.1 → 0.12.0
* 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:
* grunt: 1.4.0 → 1.5.3
* grunt-banana-checker: 0.9.0 → 0.10.0
* grunt-eslint: 23.0.0 → 24.0.0
* async: 3.2.0 → 3.2.4
  * https://github.com/advisories/GHSA-fwr7-v2mv-hh25
* minimatch: 3.0.4 → 3.0.8
  * https://github.com/advisories/GHSA-f8q6-p94x-37v3
* minimist: 1.2.5 → 1.2.7
  * https://github.com/advisories/GHSA-xvch-5gv4-984h
* nanoid: 3.1.25 → 3.3.4
  * https://github.com/advisories/GHSA-qrpm-p2h7-hrv2

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

Change-Id: I1706b77f713c6446c85f96ae4788eaf05de37b2a
2022-11-11 03:31:07 +00:00
jenkins-bot 0ed04eea34 Merge "build: Remove syntax option from stylelint" 2022-11-09 17:26:18 +00:00
Translation updater bot aa140841dc Localisation updates from https://translatewiki.net.
Change-Id: I011422bbd6ab326432bbbaaae62e38ce88db5e60
2022-11-08 08:21:30 +01:00
Translation updater bot f4fd032307 Localisation updates from https://translatewiki.net.
Change-Id: Id525eec8c9a07c87d5c5d81cb44c55c9144bea3c
2022-11-04 09:03:43 +01:00
Translation updater bot 56109635d5 Localisation updates from https://translatewiki.net.
Change-Id: Ib124ec1dbd2ef935b5d021983e5c6b7ab807f99b
2022-11-01 08:54:20 +01:00
Umherirrender d29dfaf188 build: Remove syntax option from stylelint
Error: The "syntax" option is no longer available. You should install an
appropriate syntax, e.g. postcss-scss, and use the "customSyntax" option

Change-Id: I43a39d8238143e02e9ba3ba2ee3652a63d3d6921
2022-10-27 00:13:14 +02:00
jenkins-bot cb724c0557 Merge "Use short array destructuring instead of list()" 2022-10-26 07:37:10 +00:00
Fomafix 19c2bf2920 Simplify loops over array_keys
Use native PHP feature of iterating over key-value pairs
instead of looking up the value if it's used.

Change-Id: I620add5f0f919923518557047773e5fff90827cf
2022-10-23 10:31:07 +00:00
Fomafix e5896a0b54 Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice.

Change-Id: Id66d048bc6fc720216c7391c7eeb3d315f33948a
2022-10-23 08:39:26 +00:00
jenkins-bot abeebced1c Merge "Use str_replace instead of preg_replace where RegExp are not needed" 2022-10-22 02:39:37 +00:00
jenkins-bot 60a8705ec2 Merge "Use \u{00A0} instead of  " 2022-10-22 02:39:34 +00:00
Translation updater bot 11b05f0410 Localisation updates from https://translatewiki.net.
Change-Id: I3d9772de7520954c756c426e31798da81f36a885
2022-10-19 08:20:41 +02:00
Fomafix 4b86c0bf12 Optimize HTML
* Use no-break space (U+00A0) between checkbox and text like in
  Xml::checkLabel.
* Add </li> to close list item and remove unneeded <br/> here.

Change-Id: I5eb46d497264606552a90b787a3953001a6251e7
2022-09-29 08:29:08 +00:00
Yaron Koren e852e449f4 Add space between checkbox and label in page title replacements
Change-Id: I4fb8651cf8771f9459c3537bb8e3b174e828fb29
2022-09-28 19:32:51 +00:00
Yaron Koren cb570d5609 Suppress Phan error for MW < 1.37
Change-Id: Ia774d264ac00127a3c45031835442838cec8bb70
2022-09-28 19:12:09 +00:00
Translation updater bot 9a11041b12 Localisation updates from https://translatewiki.net.
Change-Id: Ie19a0f6de8ed2d1aae2435d4b37c612404f7a9f4
2022-09-28 08:22:36 +02:00
Yaron Koren eda043b383 Fix page title search in MySQL with alternate DB encodings
Change-Id: I4d6b15ff5e3830fc3d4f2c2aff876a7069b15821
2022-09-26 14:05:03 +00:00
Translation updater bot fd7959dd47 Localisation updates from https://translatewiki.net.
Change-Id: I57c7b5e9b1ec967c9021b301c165b66d7c55663a
2022-09-26 08:16:10 +02:00
Fomafix 836defe8fa Merge "Use \t instead of TAB in the string" 2022-09-12 19:23:47 +00:00
Fomafix 3b6a6802bd Use \t instead of TAB in the string
Change-Id: Ia2052d7ca3f80d0e54ce4a3923f2373c39e7620d
Depends-On: I19c1b42d9a7c76baacfad2632c4f5525532366a9
2022-09-12 19:21:30 +00:00
Fomafix c7d80d1938 Use https://www.gnu.org/ instead of http://www.gnu.org/
Change-Id: I8aa4b4a8ba78fb9268021a3ddeb5e2a9c7b0cfeb
Depends-On: I19c1b42d9a7c76baacfad2632c4f5525532366a9
2022-09-12 19:13:23 +00:00
Fomafix e081ffe320 Use str_replace instead of preg_replace where RegExp are not needed
Change-Id: I60a770034d8a55cf779d9eae48cf2449211caeb9
2022-09-08 22:14:22 +00:00
Fomafix a06719c1d7 Remove loading of style module 'mediawiki.special'
The styles from the module 'mediawiki.special' are not used.

Change-Id: Ie843bdfdc1063acc7e36d2d376a1713e10ccd33b
2022-09-08 21:58:09 +00:00
Fomafix 59f9bc6974 Use single quotes instead of double quotes in PHP
Change-Id: I0f05a6ffbf78a6f8150c9ef751bf92f5d7956fe3
2022-09-08 16:36:16 +00:00
jenkins-bot cb08a9a768 Merge "Check for invalid new titles" 2022-09-08 13:32:34 +00:00
jenkins-bot bf60096c5f Merge "replaceAll.php: Allow empty values as target" 2022-09-08 13:28:20 +00:00