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

Tags are randomly surrounded by quotes #250

Open
mardy opened this issue Dec 9, 2017 · 11 comments
Open

Tags are randomly surrounded by quotes #250

mardy opened this issue Dec 9, 2017 · 11 comments

Comments

@mardy
Copy link

mardy commented Dec 9, 2017

Hi!
I've uploaded a photo with the following tags: uno, due, tre, quattro, cinque, sei. It succeeded, but the tags which have been set on the photo are:
uno "due" tre "quattro" cinque "sei"
It looks like every other one has extra quotes around it.

@mck182
Copy link
Contributor

mck182 commented Dec 18, 2017

Hey Alberto,

can you send the full request (the body) you're sending?

Cheers,
Martin

@mardy
Copy link
Author

mardy commented Dec 18, 2017

Sure, here it is (tokens redacted):

auto_activate=true&category=0&description=&name=&privacy=0&tags=%22uno%22,%22due%22,%22tre%22,%22quattro%22,%22cinque%22,%22sei%22&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_consumer_key=AAA&oauth_token=BBB&oauth_timestamp=1513629238&oauth_nonce=966420642&oauth_signature=CCC

And the photo has been uploaded here

@mardy
Copy link
Author

mardy commented Dec 18, 2017

Actually, the tags are not visible in the link I sent you, but in my "manage photos" page I can see them: and "due", "quattro" and "sei" have double quotes around them.

@mck182
Copy link
Contributor

mck182 commented Dec 18, 2017

I see, so just to make sure - you're trying to have
tags with quotes around them but only every other
tag ends up with the quotes, correct?

@mardy
Copy link
Author

mardy commented Dec 19, 2017

Correct, except that I don't want to have any quotes around tags. :-)

@mck182
Copy link
Contributor

mck182 commented Dec 19, 2017

So what if you just set them without quotes?

auto_activate=true&category=0&description=&name=&privacy=0&tags=uno,due,tre,quattro,cinque,sei&oauth_signature_method=...

That wouldn't work?

@mardy
Copy link
Author

mardy commented Dec 19, 2017

I need to try. But then, can I add tags containing a comma? Or are there some restrictions on what characters can be used in tags?

@mck182
Copy link
Contributor

mck182 commented Dec 19, 2017

can I add tags containing a comma?

Not really, no. But then tags with a comma don't
make that much sense, no? Do you have some
examples in mind?

@mardy
Copy link
Author

mardy commented Dec 19, 2017

Well, in some cases they are used, but I agree it's not a typical use-case. The important thing is to know which characters are allowed and which are not. :-)

@mck182
Copy link
Contributor

mck182 commented Dec 19, 2017

If you really need to have comma in a tag, you
can send an array of tags, eg.

auto_activate=true&category=0&description=&name=&privacy=0&tags[]=uno&tags[]=due,tre&tags[]=quattro&tags[]=cinque,sei&oauth_signature_method=...

should result in tags uno, due,tre, quattro, cinque,sei

But then again, I'd argue that if you need to have
a comma in a tag, those should be two standalone
tags. Like you have Roma, Italy, it should really
be Roma, Italy.

@mardy
Copy link
Author

mardy commented Dec 19, 2017

OK, I've tried it and it seems to be working. I can even upload tags with quotes in them, which is good. However, I tried to upload a tag that's life and it failed. This is the body:

auto_activate=true&category=0&description=&name=&privacy=0&tags=that%27s life&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_consumer_key=AAA&oauth_token=BBB&oauth_timestamp=1513711992&oauth_nonce=1662534350&oauth_signature=CCC

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

No branches or pull requests

2 participants