mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-23 15:56:50 +00:00
Add extension.json dependency on Math to MathCaptcha
Change-Id: I7b20114365cb22536cf9e9e74ee5dd00b85a41d5
This commit is contained in:
parent
f96b1eda5b
commit
ae67c81991
|
@ -3,6 +3,11 @@
|
|||
"author": [
|
||||
"..."
|
||||
],
|
||||
"requires": {
|
||||
"extensions": {
|
||||
"Math": "*"
|
||||
}
|
||||
},
|
||||
"url": "https://www.mediawiki.org/wiki/Extension:ConfirmEdit#MathCaptcha",
|
||||
"descriptionmsg": "mathcaptcha-desc",
|
||||
"license-name": "GPL-2.0-or-later",
|
||||
|
|
|
@ -73,12 +73,7 @@ class MathCaptcha extends SimpleCaptcha {
|
|||
* @return string
|
||||
*/
|
||||
private function fetchMath( $sum ) {
|
||||
if ( class_exists( MathRenderer::class ) ) {
|
||||
$math = MathRenderer::getRenderer( $sum, [], 'png' );
|
||||
} else {
|
||||
throw new LogicException(
|
||||
'MathCaptcha requires the Math extension for MediaWiki versions 1.18 and above.' );
|
||||
}
|
||||
$math = MathRenderer::getRenderer( $sum, [], 'png' );
|
||||
$math->render();
|
||||
$html = $math->getHtmlOutput();
|
||||
return preg_replace( '/alt=".*?"/', '', $html );
|
||||
|
|
Loading…
Reference in a new issue