Updating in-game text fields.

So, I'm trying to use a script to edit my player profile. Naturally, I'm doing so with visit_url. I assumed that I would have to use url_encode() to take care of spaces and special characters and what not, as the data would be transmitted via GET.

I do this, and what I end up viewing on my profile is still encoded. I thought that was rather weird, because when comparing the POST data sent by editing my profile manually, the url_encode()'d string was -identical-.

I gave up for a while but then noticed later that spaces left in the url transfer properly. As well as parentheses and pounds. I was a bit confused as to why these should work but thought as long as it works I'm happy.

Still can't figure out one thing though, and that's transferring a newline character.

EDIT:
I must be stupid. I tried it with \n and it worked (I swear I had already tried this and gotten "\n" to appear in the body). But if everything's fine then everything is fine. I'm still not sure why it works without url_encode(), but that's a mystery I'll just leave to the gods.
 
Last edited:

Veracity

Developer
Staff member
I was just talking to St. Doodle about something similar and looked at visit_url. It turns out that that assumes that the string you give it is NOT encoded and does its own url_encode on the fields. It does that by breaking outs the fields on & boundaries and url_encoding each field.

The problem with that comes when you want a & in your field.

I think the solution is to make a version of visit_url that accepts an already url_encoded location string. It can then still break out the individual fields on & boundaries for its own use, but would not url_encode the individual fields.
 
Top