Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications: apostrophe in name tag is printed as HTML code #3761

Closed
danieldegroot2 opened this issue Oct 21, 2022 · 7 comments · Fixed by #3765
Closed

Notifications: apostrophe in name tag is printed as HTML code #3761

danieldegroot2 opened this issue Oct 21, 2022 · 7 comments · Fixed by #3765

Comments

@danieldegroot2
Copy link
Contributor

URL

No response

How to reproduce the issue?

Expected behaviour
Notification displays regular apostrophe character '.

Observed behaviour
Notification displays apostrophe as HTML code '.

Walkin's Lough Court
https://www.openstreetmap.org/way/248749698/history

Screenshot(s) or anything else?

image

@openbrian
Copy link
Contributor

openbrian commented Oct 23, 2022

Some translation...

b-unicycling has resolved one of your map notes near...

More details about the note can be found at....

@openbrian
Copy link
Contributor

I'm trying to understand what sort of notification this is. After translation, looks like the response to resolving a note. https://www.openstreetmap.org/note/3402263 Is that right?

Must be another note. The screenshot says "has solved" and 3402263 is not solved.

So I assume in general it's the resolution to a note. Is that correct?

(Btw some more context is helpful next time.)

@openbrian
Copy link
Contributor

Is this in an email notification?

@openbrian
Copy link
Contributor

Looks like the relevant code is notes_controller.rb:385, user_mailer.rb:127, and note_comment_notification.html.erb:4.

@openbrian
Copy link
Contributor

Found the note in question https://www.openstreetmap.org/note/3389811

@openbrian
Copy link
Contributor

Call to Nominatim's reverse API returns this

<?xml version='1.0' encoding='UTF-8'?>
<reversegeocode
        attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright'
        querystring='lat=52.6470900&amp;lon=-7.2599700&amp;zoom=14&amp;accept-language=en'
        timestamp='Sun, 23 Oct 22 19:23:58 +0000'>
  <result
          address_rank='22'
          boundingbox='52.6467811,52.6475161,-7.2601399,-7.259252'
          lat='52.6471289'
          lon='-7.259824032278679'
          osm_id='248749698'
          osm_type='way'
          place_id='167011389'
          place_rank='22'
          ref='Walkin&#039;s Lough Court'>
    Walkin&#039;s Lough Court, Kilkenny No.1 Urban, Kilkenny, County Kilkenny, Leinster, Ireland
  </result>
  <addressparts>
    <residential>Walkin&#039;s Lough Court</residential>
    <city_district>Kilkenny No.1 Urban</city_district>
    <town>Kilkenny</town>
    <county>County Kilkenny</county>
    <ISO3166-2-lvl6>IE-KK</ISO3166-2-lvl6>
    <region>Leinster</region>
    <ISO3166-2-lvl5>IE-L</ISO3166-2-lvl5>
    <country>Ireland</country>
    <country_code>ie</country_code>
  </addressparts>
</reversegeocode>

The encoded apostrophe here is fine.

@openbrian
Copy link
Contributor

Got it working. Here's a snippet from my developer logs.

web_1  | Hi,
web_1  | 
web_1  | Groot has reactivated a map note you have commented on. The note is near Walkin's Lough Court, Kilkenny No.1 Urban, Kilkenny, County Kilkenny, Leinster, Ireland.
web_1  | 
web_1  | More details about the note can be found at http://openstreetmap.example.com/note/3.

I need to check all callers of this function to make sure we're not introducing an issue with un-escapped special characters.

Current solution is to replace result.to_s with result.value in nominatim.rb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants