summaryrefslogtreecommitdiffstats
path: root/lib/ui.lib.php
diff options
context:
space:
mode:
authorDominik George <nik@naturalnet.de>2012-04-15 23:18:44 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2012-04-15 23:31:17 -0400
commitb64649e720055496fb40d7e6b9dbe4d8246e230c (patch)
tree1538feaad668d10933f4a1c88392bd96af082935 /lib/ui.lib.php
parent4aa37feccc93b6c4508bd5774436d8ba69920b4a (diff)
downloadampache-b64649e720055496fb40d7e6b9dbe4d8246e230c.tar.gz
ampache-b64649e720055496fb40d7e6b9dbe4d8246e230c.tar.bz2
ampache-b64649e720055496fb40d7e6b9dbe4d8246e230c.zip
FS#225 - xml_from_array() produces runtime error
Newer versions of the PCRE library changed behaviour so we can't replace invalid characters by listing them, since it now requires that the characters in a pattern are valid Unicode characters. Use an inverted character class instead. Might work.
Diffstat (limited to 'lib/ui.lib.php')
-rw-r--r--lib/ui.lib.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index ce0a12ed..7c1f62d8 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -619,7 +619,7 @@ function xml_from_array($array, $callback = false, $type = '') {
// 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;