]> git.openstreetmap.org Git - rails.git/commitdiff
get_text("reversegeocode/result") returns an XML node. We want to get the text value...
authorBrian DeRocher <brian@derocher.org>
Sun, 23 Oct 2022 20:00:38 +0000 (16:00 -0400)
committerBrian DeRocher <brian@derocher.org>
Sun, 23 Oct 2022 20:04:01 +0000 (16:04 -0400)
This will unescape &#039; into an apostrophe.

All callers of this function will later re-encode it depending out output whether it be HTML in an email, or XML in an RSS feed.

* app/mailers/user_mail.rb
* app/helpers/geocode_helper.rb
* app/views/api/notes/feed.rss.builder
* app/views/api/notes/_note.rss.builder

Fixes openstreetmap/openstreetmap-website#3761

lib/nominatim.rb

index f847ec84e323e2a6871f35e824b7d7e7bb53ff35..adb041da43857799d2bdbea0a8a1c018e1d536e6 100644 (file)
@@ -19,7 +19,7 @@ module Nominatim
       end
 
       if response && result = response.get_text("reversegeocode/result")
-        result.to_s
+        result.value
       else
         "#{number_with_precision(lat, :precision => 3)}, #{number_with_precision(lon, :precision => 3)}"
       end