From: dbs Date: Thu, 26 Mar 2009 15:29:31 +0000 (+0000) Subject: Backport r12684 from trunk: escape raw ampersands as part of entityize X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c0e37d5994356d73a24c7d44963dea2e10b2705f;p=Evergreen.git Backport r12684 from trunk: escape raw ampersands as part of entityize git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4@12685 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index e9bb29bec5..1d7895a013 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1510,6 +1510,9 @@ sub entityize { $string = NFC($string); } + # Convert raw ampersands to ampersand entities + $string =~ s/&(?!\S+;)/&/gso; + $string =~ s/([\x{0080}-\x{fffd}])/sprintf('&#x%X;',ord($1))/sgoe; return $string; }