brusselopole / Worldopole

Worldopole is a third party extension for RocketMap showing some nice statistics.
MIT License
85 stars 79 forks source link

Link to gym history does not work when gym name contains accented chars #361

Closed na-ji closed 6 years ago

na-ji commented 6 years ago

Expected Behavior

On the gym page, when I click on Show history, I go to the gym history for the gym I clicked.

Current Behavior

If the gym name contains accented chars, the page does not find the gym. The filter is then reset and all the gyms are displayed.

Possible Solution

The link generated contains html character codes likes É. Sanitizing the gym name solves the problem. For instance: My gym name is La faune de la vallée

Steps to Reproduce (for bugs)

  1. Go to the gym page
  2. Find a gym with a name that contains accented chars
  3. Click on Show history

Context

I run Worldopole on a french city. I have a lot of gym with accented chars.

Your Environment

Thanks PoGo Map for default issue text. Thanks for this awesome tool!

michikrug commented 6 years ago

Can you please check if #362 solves your problem?

Obihoernchen commented 6 years ago

Merged #362 please test @na-ji

na-ji commented 6 years ago

Thank you @michikrug. I just tested, but I still have problem viewing the history page. Now the problem is coming from the gymhistory page itself.

With the same example as before, I have a gym named La faune de la vallée This is the link generated now : gymhistory?name=La%20faune%20de%20la%20vall%C3%A9e When I click on it, I go to the page gymhistory?name=La%20faune%20de%20la%20vall%C3%A9e Then just after the URL is rewriten to gymhistory?name=La faune de la vallée

I think the problem is coming from the function htmlentities used here : https://github.com/brusselopole/Worldopole/blob/master/pages/gymhistory.page.php#L72

michikrug commented 6 years ago

@na-ji Thanks for the hint 👍 Will check this too

Obihoernchen commented 6 years ago

@na-ji please check the latest pr (#364)

na-ji commented 6 years ago

Sorry, I was in vacation. Now with this fix it is working perfectly, thanks!

Obihoernchen commented 6 years ago

thx merged