Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Datatype.php |
— | — | @@ -628,7 +628,7 @@ |
629 | 629 | |
630 | 630 | function processValue($value,&$datavalue) { |
631 | 631 | if ($value!='') { //do not accept empty strings |
632 | | - $xsdvalue = $value; // encoding is already done by MediaWiki, don't do it twice |
| 632 | + $xsdvalue = smwfXMLContentEncode($value); |
633 | 633 | // 255 below matches smw_attributes.value_xsd definition in smwfMakeSemanticTables() |
634 | 634 | // Note that depending on database encoding and UTF-8 settings, longer or |
635 | 635 | // shorter strings than this with int'l characters may exceed database field. |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -362,10 +362,12 @@ |
363 | 363 | |
364 | 364 | /** |
365 | 365 | * Escapes text in a way that allows it to be used as XML |
366 | | - * content (e.g. as an string value for some property). |
| 366 | + * content (e.g. as a string value for some property). |
367 | 367 | */ |
368 | 368 | function smwfXMLContentEncode($text) { |
369 | | - return str_replace(array('&','<','>'),array('&','<','>'),$text); |
| 369 | + global $IP; |
| 370 | + include_once($IP . '/includes/Sanitizer.php'); |
| 371 | + return Sanitizer::normalizeCharReferences($text); |
370 | 372 | } |
371 | 373 | |
372 | 374 | /** |