Withoutaname has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/147337

Change subject: Move function xmlsafe from Export.php to OAI extension
......................................................................

Move function xmlsafe from Export.php to OAI extension

Change-Id: I4bac5cf0a3dcd6b74d08408c3cdb881a9eea6800
---
M OAIRepo_body.php
1 file changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAI 
refs/changes/37/147337/1

diff --git a/OAIRepo_body.php b/OAIRepo_body.php
index d74d096..dc5436a 100644
--- a/OAIRepo_body.php
+++ b/OAIRepo_body.php
@@ -29,6 +29,23 @@
 */
 
 /**
+ * @param string $string
+ * @return string
+ */
+function xmlsafe( $string ) {
+       wfProfileIn( __FUNCTION__ );
+
+       /**
+        * The page may contain old data which has not been properly normalized.
+        * Invalid UTF-8 sequences or forbidden control characters will make our
+        * XML output invalid, so be sure to strip them out.
+        */
+       $string = htmlspecialchars( UtfNormal::cleanUp( $string ) );
+       wfProfileOut( __FUNCTION__ );
+       return $string;
+}
+
+/**
  * @param string $element
  * @param array $attribs Name=>value pairs. Values will be escaped.
  * @param bool $contents NULL to make an open tag only

-- 
To view, visit https://gerrit.wikimedia.org/r/147337
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bac5cf0a3dcd6b74d08408c3cdb881a9eea6800
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAI
Gerrit-Branch: master
Gerrit-Owner: Withoutaname <drevit...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to