Bug 1813650 - Mediawiki can't render maths with Math extension when when REST API is used
Summary: Mediawiki can't render maths with Math extension when when REST API is used
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: mediawiki
Version: 31
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Michael Cronenworth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-15 08:39 UTC by NickPGSmith@gmail.com
Modified: 2023-06-25 23:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 18:01:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description NickPGSmith@gmail.com 2020-03-15 08:39:57 UTC
Description of problem:
Installed mediawiki on Postgress, with latest Math extension, configured using Wikimedia's REST API. Broken due to incorrect handling of HTTP header.

Version-Release number of selected component (if applicable):
mediawiki: 1.32.6-1.fc31
Math: 1.34

How reproducible:
Always in the given configuration

Steps to Reproduce:
1. Install mediawiki and Math extension

2. Configure with:
wfLoadExtension( 'Math' );
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL = 'https://en.wikipedia.org/api/rest_';

3. Try displaying some simple maths, like:
<math>y = x^5</math>

Actual results:

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle y = x^5}

Expected results:
Correct rendering of Maths

Additional info:
In order to fix, I edited the preg_match regex in /usr/share/mediawiki/includes/libs/MultiHttpClient.php to accept an HTTP 2 response:

if ( preg_match( "/^(HTTP\/(?:1\.[01]|2)) (\d{3}) (.*)/", $header, $matches ) ) {

Also found this was noted here: https://www.mediawiki.org/wiki/Topic:Uo3kkmmop1jj9vhw

Comment 1 Michael Cronenworth 2020-03-16 13:03:50 UTC
Please file a bug against the extension. The 'mediawiki' package does not ship this extension by default.

https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=Math

Comment 2 NickPGSmith@gmail.com 2020-03-16 13:30:03 UTC
It is true that the extension is not distributed with the core mediawiki package, but the HTTP version check I highlight is. So the extension, presumably, would not be able to work around this. It's not clear to me why we even need to check the HTTP version.

Are you sure it's not something that can be changed in MultiHttpClient.php ?

Comment 3 Ben Cotton 2020-11-03 17:08:40 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2020-11-24 18:01:59 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 HelenBriggs 2022-10-19 15:17:20 UTC Comment hidden (spam)
Comment 6 Tami J. Powell 2023-01-24 12:02:39 UTC
Thank you for sharing!


Note You need to log in before you can comment on or make changes to this bug.