Ejegg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/251650
Change subject: Add sanitize wrapper fn to WmfFramework
......................................................................
Add sanitize wrapper fn to WmfFramework
Change-Id: I1a388d8301b7b5577628c6be10e61b12e87f2b44
---
M gateway_common/MessageUtils.php
M gateway_common/WmfFramework.drupal.php
M gateway_common/WmfFramework.mediawiki.php
3 files changed, 9 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/50/251650/1
diff --git a/gateway_common/MessageUtils.php b/gateway_common/MessageUtils.php
index 77c9fb5..df84960 100644
--- a/gateway_common/MessageUtils.php
+++ b/gateway_common/MessageUtils.php
@@ -91,6 +91,6 @@
$stripped = preg_replace( '/[^-_\w]/', '', $string );
// theoretically this is overkill, but better safe than sorry
- return wfEscapeWikiText( htmlspecialchars( $stripped ) );
+ return WmfFramework::sanitize( htmlspecialchars( $stripped ) );
}
}
diff --git a/gateway_common/WmfFramework.drupal.php
b/gateway_common/WmfFramework.drupal.php
index 35b56ac..26e3b98 100644
--- a/gateway_common/WmfFramework.drupal.php
+++ b/gateway_common/WmfFramework.drupal.php
@@ -86,4 +86,8 @@
static function isPosted() {
return false;
}
+
+ static function sanitize( $text ) {
+ return filter_xss( $text );
+ }
}
diff --git a/gateway_common/WmfFramework.mediawiki.php
b/gateway_common/WmfFramework.mediawiki.php
index d513c5d..02a355d 100644
--- a/gateway_common/WmfFramework.mediawiki.php
+++ b/gateway_common/WmfFramework.mediawiki.php
@@ -69,4 +69,8 @@
global $wgRequest;
return $wgRequest->wasPosted();
}
+
+ static function sanitize( $text ) {
+ return wfEscapeWikiText( $text );
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/251650
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a388d8301b7b5577628c6be10e61b12e87f2b44
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits