jenkins-bot has submitted this change and it was merged.
Change subject: Fixing unexcepted HTML escaping in QuestyCaptcha.
......................................................................
Fixing unexcepted HTML escaping in QuestyCaptcha.
HTML-based questions (e.g. images) will not work well with QuestyCaptcha
on MediaWiki 1.27 due to an unexcepted HTML escape. This commit fixes the
issue by declaring raw HTML form mode, just like MathCaptcha.
Bug: T147606
Change-Id: Icc7c47b88b8aa44425acfa3d58d353ddc73bc87e
---
M QuestyCaptcha/QuestyCaptcha.class.php
1 file changed, 18 insertions(+), 1 deletion(-)
Approvals:
Florianschmidtwelzow: Looks good to me, approved
jenkins-bot: Verified
diff --git a/QuestyCaptcha/QuestyCaptcha.class.php
b/QuestyCaptcha/QuestyCaptcha.class.php
index dfe9fd6..14124df 100644
--- a/QuestyCaptcha/QuestyCaptcha.class.php
+++ b/QuestyCaptcha/QuestyCaptcha.class.php
@@ -8,6 +8,8 @@
* @ingroup Extensions
*/
+use MediaWiki\Auth\AuthenticationRequest;
+
class QuestyCaptcha extends SimpleCaptcha {
// used for questycaptcha-edit, questycaptcha-addurl,
questycaptcha-badlogin,
// questycaptcha-createaccount, questycaptcha-create,
questycaptcha-sendemail via getMessage()
@@ -33,7 +35,7 @@
public function describeCaptchaType() {
return [
'type' => 'question',
- 'mime' => 'text/plain',
+ 'mime' => 'text/html',
];
}
@@ -88,4 +90,19 @@
public function getCaptchaInfo( $captchaData, $id ) {
return $captchaData['question'];
}
+
+ public function onAuthChangeFormFields( array $requests, array
$fieldInfo,
+ array &$formDescriptor, $action ) {
+ /** @var CaptchaAuthenticationRequest $req */
+ $req =
+ AuthenticationRequest::getRequestByClass( $requests,
+ CaptchaAuthenticationRequest::class, true );
+ if ( !$req ) {
+ return;
+ }
+
+ // declare RAW HTML output.
+ $formDescriptor['captchaInfo']['raw'] = true;
+ $formDescriptor['captchaWord']['label-message'] = null;
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/314236
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icc7c47b88b8aa44425acfa3d58d353ddc73bc87e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Ben.imbushuo <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits