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)
committerDan Wells <dbw2@calvin.edu>
Mon, 10 Mar 2014 21:04:57 +0000 (17:04 -0400)
commit36719fbd799646ae7538c0ac47e16715679e9dc2
tree127e822f840d25fe710792747752db810b06c11f
parentb9f8c5bcd24ccbda14210d9700d3404cb78ede16
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>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/sql/Pg/002.functions.config.sql