{"id":226,"date":"2005-01-20T20:23:29","date_gmt":"2005-01-21T02:23:29","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=226"},"modified":"2005-01-20T20:23:29","modified_gmt":"2005-01-21T02:23:29","slug":"expresso-and-dbobjects-and-ampersands","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/226","title":{"rendered":"Expresso and dbobjects and ampersands"},"content":{"rendered":"<p>If you&#8217;re ever pulling a url from a database via an <a href='http:\/\/jcorporate.com'>Expresso<\/a> dbobject (Expresso&#8217;s O-R layer) and you find yourself with mysterious &amp;amp; characters being inserted, you may want to visit <a href='http:\/\/www.jcorporate.com\/econtent\/Content.do?state=template&amp;template=2&amp;db=default&amp;resource=636'>this thread<\/a> and the <a href='http:\/\/www.jcorporate.com\/expresso\/doc\/javadocs\/com\/jcorporate\/expresso\/core\/security\/filters\/FilterManager.html'>FilterManager<\/a> javadoc.  Long story short, add this line:<\/p>\n<p><code>setStringFilter(\"fieldname\", FilterManager.RAW_FILTER);<\/code><\/p>\n<p>to any fields of the dbobject that you don&#8217;t want &#8216;made safe&#8217; by the default filter (which screens out dangerous HTML characters).  Tested on Expresso 5.5.<\/p>\n<p>(I&#8217;m omitting the rant about changing data pulled from the database without making it loud and clear that default behavior is to filter certain characters.  But it&#8217;s a Bad Idea.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re ever pulling a url from a database via an Expresso dbobject (Expresso&#8217;s O-R layer) and you find yourself with mysterious &amp;amp; characters being inserted, you may want to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-226","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}