RoyaleAPI / cr-api-ux

User Experience and content issue tracker for RoyaleAPI website.
https://royaleapi.com
21 stars 16 forks source link

Error when a clanname starts with a hashtag # #549

Closed Maxigon closed 3 years ago

Maxigon commented 3 years ago

Hi,

every time i try to fav a clan beginning with a # hashtag, there'll be an error.

I hope you can fix that soon.

Regards,

User Maxi

smlbiobot commented 3 years ago

Ha… interesting bug. I will see what I can do. Can you give an example of a clan that starts with # ?

NicolasDer commented 3 years ago

To Reproduce Steps to reproduce the behavior:

  1. Go to a clan page with name starting with special characters, e.g., https://royaleapi.com/clan/8C9JGGU (&) https://royaleapi.com/clan/PPCCR8VU (#)
  2. Click on fav button
  3. Go to https://royaleapi.com/me/clans
  4. See error - different characters throw different errors (# throws 500 server error, & will show None as clan name in the list)

Expected behavior List not throwing errors and showing the names of the clans

Screenshots imagen imagen imagen

Notes -This may be a real issue, may be causing injections in database query code -User and decks seem to work just fine

Maxigon commented 3 years ago

Yes,

we have 4 clans in our family: https://royaleapi.com/clan/family/FTY/clans https://royaleapi.com/clan/family/FTY/clans

I can fav 2 of the clans. The other starting with a # will get an error.

This works: https://royaleapi.com/clan/P009PY9C https://royaleapi.com/clan/P009PY9C

That one not: https://royaleapi.com/clan/GJ9G9R https://royaleapi.com/clan/P009PY9C

Am 08.09.2020 um 12:51 schrieb SML notifications@github.com:

Ha… interesting bug. I will see what I can do. Can you give an example of a clan that starts with # ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RoyaleAPI/cr-api-ux/issues/549#issuecomment-688788156, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7TMIFQWRC6SDIWONWCUBTSEYECHANCNFSM4QYG45YQ.

smlbiobot commented 3 years ago

Noted. I could guess the reason. I’ll let you know when this get fixed.

smlbiobot commented 3 years ago

A fix for this has been deployed (aka live).

If you have previously favorited the clan, the clan will now show up as its clan tag. If you want it to show up in its name, what you need to do is:

This should then fix the clan name not being displayed properly / returning 500 when visiting the page.

Thanks for reporting this issue btw — I have seen some mysterious no name clan in our database from time to time and always just assumed that it was the server restarting while someone was favoriting. I have never thought that it had to do with these problematic characters in the clan name.

Please update about this issue whether the bug fix worked or not.

NicolasDer commented 3 years ago

Seems it is working for me, also while testing if it was ok I found that searching something with a leading # in https://royaleapi.com/clans/search leads to a 503 error.

smlbiobot commented 3 years ago

Noted. I will take a look at what this could be. Would be MUCH BETTER if you open a new issue though.

smlbiobot commented 3 years ago

Seems it is working for me, also while testing if it was ok I found that searching something with a leading # in https://royaleapi.com/clans/search leads to a 503 error.

This should have been fixed. Please check and reply with results.

Maxigon commented 3 years ago

It's working fine. Thank You!