LP#1243023: Teach oils_xpath() to decode specific enties in text nodes
authorMike Rylander <mrylander@gmail.com>
Mon, 3 Mar 2014 19:07:42 +0000 (14:07 -0500)
committerMike Rylander <mrylander@gmail.com>
Mon, 3 Mar 2014 19:35:31 +0000 (14:35 -0500)
commitcb847254accce2ea2d4d1d1f2e6ca81beb76fb43
tree67f906eb1b3f8c99c0f64dcf97637083bbdd0fea
parentc1e03c02216ed8a5916e44714d621a55b0b95fc7
LP#1243023: Teach oils_xpath() to decode specific enties in text nodes

Because of a behavioral change in Postgres' XML code (specifically, when
casting XML as TEXT, the Famous Five XML entities are not decoded), we
are seeing doubled encodings in XML and HTML output, as well as in indexed
data.  To combat this, we will now check the first character of each
array element returned by XPATH() and, if it is not '<', we will decode
the entities ourselves.

Also included in this commit is some cleanup of the surrounding file
content, which was just confusing and useless in the modern era.

The contents of his commit, followed by:

 =# drop function evergreen.oils_xpath(text,text,anyarray)

are enough to address the OP's complaint about browse data.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/002.functions.config.sql