tags 668932 + patch
thanks

I found that the bug is unrelated to the RPC API. I believed that first 
because it confluenced with a bug in Banshee, also regarding XML, but they 
are unrelated.

However, why the UI code is run upon receiving an RPC call is a complete 
mytery to me.

Find attached a patch that fixes the xml_from_array() method in ui.lib.php 
by implementing the exact specifications from the linked W3 article 
instead of re-interpretating it to an unreadable form.
--- ui.lib.php.orig	2012-04-15 21:41:34.634428252 +0200
+++ ui.lib.php	2012-04-15 22:25:32.817483635 +0200
@@ -642,7 +642,7 @@ function xml_from_array($array, $callbac
 
 		// Remove invalid XML characters.
 		// See http://www.w3.org/TR/2006/REC-xml-20060816/#charsets
-		$clean = preg_replace('/[\x{0}-\x{8}\x{b}\x{c}\x{e}-\x{1f}\x{d800}-\x{dfff}\x{fffe}-\x{ffff}]/u', '', $string);
+		$clean = preg_replace('/[^\x{9}\x{a}\x{d}\x{20}-\x{d7ff}\x{e000}-\x{fffd}\x{10000}-\x{10ffff}]|[\x{7f}-\x{84}\x{86}-\x{9f}\x{fdd0}-\x{fddf}\x{1fffe}-\x{1ffff}\x{2fffe}-\x{2ffff}\x{3fffe}-\x{3ffff}\x{4fffe}-\x{4ffff}\x{5fffe}-\x{5ffff}\x{6fffe}-\x{6ffff}\x{7fffe}-\x{7ffff}\x{8fffe}-\x{8ffff}\x{9fffe}-\x{9ffff}\x{afffe}-\x{affff}\x{bfffe}-\x{bffff}\x{cfffe}-\x{cffff}\x{dfffe}-\x{dffff}\x{efffe}-\x{effff}\x{ffffe}-\x{fffff}\x{10fffe}-\x{10ffff}]/u', '', $string);
 
 		if ($clean) {
 			return $clean;

Reply via email to