Commit Graph

40 Commits

Author SHA1 Message Date
libraryupgrader ccc6a0cb48 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 24.0.0 → 26.0.0

npm:
* set-value: 2.0.0 → 2.0.1
  * https://npmjs.com/advisories/1012
  * CVE-2019-10747
* union-value: 1.0.0 → 1.0.1
  * https://npmjs.com/advisories/1012
  * CVE-2019-10747
* mixin-deep: 1.3.1 → 1.3.2
  * https://npmjs.com/advisories/1013
  * CVE-2019-10746

Change-Id: Id7c540a37118f3a89917f467dcb715f504b843ef
2019-07-14 13:30:34 +00:00
James D. Forrester 85d7f039bd build: Upgrade phan-taint-check-plugin from 1.5.x to 2.0.1
Change-Id: I08d38872db05669aa6200fefb410d144fccf2427
2019-07-11 10:03:03 +00:00
Lucas Werkmeister 7abf09a4aa Update for namespace moves
Change-Id: I300aff6fa8e9f2ade8a97c826ef23ad56d40b392
Depends-On: Ie808d49aed00ec97117b04722456f24e96d49e68
2019-06-07 18:01:03 +02:00
jenkins-bot 1792072bcf Merge "Fix call to MathMathMLCli::getError" 2019-05-31 19:11:55 +00:00
Umherirrender 6d4740fa4c Fix call to MathMathMLCli::getError
var_export prints the result,
it needs a true argument to return a string

Change-Id: I3c1275daf465044f1e22548a70e775069a6e94b6
2019-05-31 20:31:51 +02:00
Umherirrender 70517518a0 Pass no argument to MathRender::render
The function does not take any argument, so remove the provided bool

Change-Id: Ib4a51c4a95396a6db8359ceefe81db0a998f9197
2019-05-31 20:05:03 +02:00
Umherirrender 33f9115e43 Add implode to log message to avoid "array" as text
Format it looks like an array [ '...', '...' ]

Change-Id: I30122961a65593be0ab264796cd8a57a421c6395
2019-05-31 15:15:04 +02:00
Tpt d51e0ae06a Make error HTML valid XHTML
Allows easy parsing using XML tools

Change-Id: I27b5a8b719d703636c2c09d513cd04766fc66ce1
2019-04-24 12:06:14 +02:00
Kunal Mehta 1c79c4a2ec Avoid use of func_get_args()
Change-Id: I2b0f50e00cd2c7ba744c75f623b0349930cdfd62
2019-03-09 18:34:56 -08:00
Amir Sarabadani eb7a8371d8 MathWikidataHook.php -> MathWikibaseHook.php
These hooks are related to Wikibase and can be used outside of Wikidata

Change-Id: I90e0abbdc54aa85957b15f60c4e821ee68b9517f
2019-02-08 19:49:08 +01:00
libraryupgrader 54d1b77401 build: Updating mediawiki/mediawiki-codesniffer to 24.0.0
Change-Id: I30daab715920757ec96350c9933fc18c887972c4
2019-02-06 23:08:22 +00:00
RazeSoldier 27091b55a0 Log STDERR from mathoids cli output
When $wgMathoidCli is misconfigured the error message was misleading.
It was reported that the specified file was not executable, even though
other reasons are possible (e.g., nodejs misconfigured).  

Therefore, we capture STDERR and add it to the error log.

Bug: T198564
Change-Id: I7d0ae0f3ab4789124f9ff1533e7712ca31233f9e
2018-11-21 10:12:00 +00:00
AndreG-P 2699479827 Link wikidata items to math tags
Adds a parameter that links individual formulae to their respective wikidata items.

Bug: T71424
Change-Id: I32cfe2039e62f163fe3aebaf77bafbdd84b343c6
2018-11-12 20:59:25 +09:00
jenkins-bot 817ada2cf1 Merge "Add tracking category for deprecated mhchem syntax" 2018-11-09 12:19:12 +00:00
James D. Forrester 428f5a847b Drop support for MediaWiki core's removed "2006 wikitext editor"
Change-Id: I59bad8faee3f0f998344f985eb675087533d3d8f
2018-11-06 17:19:43 -08:00
Umherirrender d37698535a Add method scope visibility
Change-Id: I6b8e90017c9862fc082b216d44bebab34f3a6095
2018-11-02 18:52:06 +01:00
Moritz Schubotz (physikerwelt) a865a8565a
Add tracking category for deprecated mhchem syntax
Gets warning information from restbase and adds tracking categories
for deprecated chemical syntax.
Refactor mechanism to add tracking categories, and avoiding rechecking
already checked formulae.

Depends on: Ieca66f45ae7685d61eece1624bd7ff65ccad2eaa
Change-Id: I10e78ab79015dc1331f645c60b25bbbd237e23fe
2018-10-27 20:38:02 +02:00
C. Scott Ananian 0f32a506a0 Replace deprecated untidy OutputPage::addWikiText() method
The replacement OutputPage::addWikiTextAsInterface() method was added in
MW 1.32; the minimum required MW version has been bumped accordingly.

Bug: T198214
Change-Id: Ie9932b7398d0a9184094a99aec060d78f62dd6f0
2018-10-19 17:53:34 +00:00
Umherirrender 791dcde7f9 Fix caller name in MathRenderer::writeToDatabase
Seeing {closure} in the logs as caller is not helpful

Change-Id: I2b50ead956fa0df5a220b97f7e1523671bf46866
2018-09-30 13:36:12 +02:00
Umherirrender c82458bbbc Remove @global doc annotation
It is unknown to doxygen

Change-Id: I1ef4bf4292b78fcd434f35c31f75b08b9c6a49d8
2018-09-09 20:53:28 +02:00
James D. Forrester 087a973f30 build: Bump mediawiki-codesniffer to 22.0.0
Change-Id: I448e8d368d76eee40fe57c89428a0ce472c48d01
2018-09-06 11:48:25 +00:00
Zoranzoki21 4f5225d612 Fix common typos in code
Bug: T201491
Change-Id: Ib1f2e5ea8a67311702d82c46741903f58449a09b
2018-09-06 11:00:32 +00:00
jenkins-bot b542793035 Merge "Remove @return from MathRenderer::setPurge" 2018-08-07 17:14:53 +00:00
Umherirrender da2b19de0c Remove @return from MathRenderer::setPurge
The function does not return anything

Change-Id: Id3eca085c0419aef02c59be5973bb27a4635ccb7
2018-08-07 09:42:17 +02:00
Moritz Schubotz (physikerwelt) f0c8840148
Add math related styles and script via appropriate hook
Create MathDataUpdater class that checks if statements
are using math and adds the stlyes required for math in that case.

This patch has no effect until
I5bc0622ee7338f3215d14e15331a0a1931ca1ae0
is merged.

After both changes are in effect
I0abd6acbfa12fd503d11476f0c8c8c8a8a851cdc
can be merged.

Bug: T173949
Change-Id: I0e24bbb53e6e01d549f534744780ca1afc49fdd7
2018-07-24 16:40:52 +02:00
Thiemo Kreuz 97000ed8b0 Fix "@param $…" missing the type
Change-Id: I8d20ae852100a6ecc39df05eab3aa8e2b9c09480
2018-06-20 11:10:43 +02:00
Thiemo Kreuz 5648b8e2c3 Make use of the …::class feature whenever possible
Note that a class is not resolved this was. …::class is not a function
call. It's more like a named string constant. Technically still a
string. The advantage is that IDEs and tools like linters can much easier
understand that these strings refer to a class, and list them in usage
reports, renames, and such.

Change-Id: I5225543dbb837685a1840837cb2772dd576cca38
2018-06-06 12:13:04 +02:00
Moritz Schubotz (physikerwelt) aa2c4cf913 Improve tests coverage for MathMathML
* deprecate and fix pickHost. It was broken and never used.
* simplify inputTypeSelection
* remove superfluous is_array check for the result of explode

Change-Id: I392f22f074facfe30b97d53a3002f464a471b67e
2018-06-01 15:36:35 +00:00
Moritz Schubotz (physikerwelt) 4156f1c9b7
Remove dead texvc code from the math extension
In T74240 support for LaTeX based rendering of the <math/>-tags was
removed. This change eliminates the unused code from the repository.

Bug: T195871
Change-Id: Ic57d83fa49f090b574ce8b82fd2ebc84a5350318
2018-05-29 17:41:53 +02:00
libraryupgrader 2587469834 build: Updating mediawiki/mediawiki-codesniffer to 20.0.0
Change-Id: I4385a05df9b40d4da19f280bd211e8c261d22c41
2018-05-26 04:26:21 +00:00
Moritz Schubotz (physikerwelt) b5cf0e0b77
Serve png mode from mathoid
* Use the exactly same routines to deliver png images that are used in
  mathml mode.
* Change the output to use mathoids png image rather than the mathml
  and svg output.
* Locally tested on Firefox and Chrome: Depending on the mode either
  the SVG or the PNG path is used.

Bug: T74240
Change-Id: I4b1cac92eb9a02190f316faab6621940951603d5
2018-05-21 13:47:49 +02:00
jenkins-bot 22d63b1973 Merge "Throw InvalidArgumentException when validating/formatting null" 2018-05-18 19:00:32 +00:00
Thiemo Kreuz b12b4f740f Throw InvalidArgumentException when validating/formatting null
Change-Id: Ia46f76a89b26c830aab70ebf5fcc222711c325d1
2018-05-18 20:02:43 +02:00
Thiemo Kreuz 670f0bb8f9 Don't expect objects by reference in hook handlers
The motivation for this patch is to make the code less complex, better
readable, and less brittle.

Example:

public function onExampleHook( Parser &$parser, array &$result ) {
    /* This is the hook handler */
}

In this example the $result array is meant to be manipulated by the
hook handler. Changes should become visible to the caller. Since PHP
passes arrays by value, the & is needed to make this possible.

But the & is misplaced in pretty much all cases where the parameter is
an object. The only reason we still see these & in many hook handlers
is historical: PHP 4 passed objects by value, which potentially caused
expensive cloning. This was prevented with the &.

Since PHP 5 objects are passed by reference. However, this did not
made the & entirely meaningless. Keeping the & means callees are
allowed to replace passed objects with new ones. The & makes it look
like a function might intentionally replace a passed object, which is
unintended and actually scary in cases like the Parser. Luckily all
Hooks::run I have seen so far ignore unintended out-values. So even if
a hook handler tries to do something bad like replacing the Parser
with a different one, this would not have an effect.

Removing the & does not remove the possibility to manipulate the
object. Changes done to public properties are still visible to the
caller.

Unfortunately these & cannot be removed from the callers as long as
there is a single callee expecting a reference. This patch reduces the
number of such problematic callees.

Change-Id: I21d53c989ea487607dc69e6b3365c023ef6729f5
2018-05-15 17:50:08 +02:00
Kunal Mehta 7a53bd905c Disable PHPCS more narrowly
Change-Id: I20d8b519d5827e865ccd3adf7c2c6ba069f37afb
2018-05-03 19:00:55 -07:00
jenkins-bot dcf8f0926d Merge "MathChemSymbolsDataModule: Remove origin restriction" 2018-04-30 20:42:06 +00:00
Bartosz Dziewoński 7270d702f1 MathMathSymbolsDataModule: Remove origin restriction
Without this change it would no longer load in safe mode (T185303)
because the module would be missing.

I think this has been copy-pasted from VisualEditor, see commit
I6d097ccbf1dc2462843219adcf96bf8313e30289 there for explanation.

Bug: T185303
Change-Id: I6644a361d1450c394a7f82dc3dad97515982846d
2018-04-30 22:26:28 +02:00
Bartosz Dziewoński 4ccb9abe8a MathChemSymbolsDataModule: Remove origin restriction
Without this change it would no longer load in safe mode (T185303)
because the module would be missing.

I think this has been copy-pasted from VisualEditor, see commit
I6d097ccbf1dc2462843219adcf96bf8313e30289 there for explanation.

Bug: T185303
Change-Id: Ieed46488c94c5809e9f17f667c6926a21ffe838b
2018-04-30 22:25:52 +02:00
Moritz Schubotz (physikerwelt) 9fee65ae24
Generate HTML tag using HTML class
Change-Id: I8c37fdaa112cfeac0466f4380e972b63404a8d35
2018-04-23 15:39:30 +02:00
Moritz Schubotz (physikerwelt) 6e28bf8743
Move php source files
Move php source files to scr. This allows jenkins to calculate the test
coverage.

Bug: T126034
Change-Id: If012c6a4fce0fdeaa5a63dad23210a42d1fc80e6
2018-04-23 15:09:23 +02:00