cr-api-ux icon indicating copy to clipboard operation
cr-api-ux copied to clipboard

Error when a clanname starts with a hashtag #

Open Maxigon opened this issue 6 years ago • 9 comments

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

Maxigon avatar Sep 04 '20 12:09 Maxigon

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

smlbiobot avatar Sep 08 '20 10:09 smlbiobot

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

NicolasDer avatar Sep 08 '20 12:09 NicolasDer

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 [email protected]:

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.

Maxigon avatar Sep 08 '20 13:09 Maxigon

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

smlbiobot avatar Sep 08 '20 13:09 smlbiobot

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:

  • Go to https://royaleapi.com/me/clans
  • Remove the clan from the list
  • Wait 3-5 minutes
  • Visit the clan you wish to favorite
  • Favorite the clan again

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.

smlbiobot avatar Sep 11 '20 10:09 smlbiobot

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.

NicolasDer avatar Sep 11 '20 11:09 NicolasDer

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

smlbiobot avatar Sep 11 '20 11:09 smlbiobot

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.

smlbiobot avatar Sep 11 '20 11:09 smlbiobot

It's working fine. Thank You!

Maxigon avatar Sep 11 '20 12:09 Maxigon