Mailto plugin - plus signs

Development-related discussion, including bundled plugins
lignumaqua
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 10 Apr 2013, 19:22

Mailto plugin - plus signs

Postby lignumaqua » 10 Apr 2013, 19:26

I use the mailto plugin and found that it inserts + signs for every space in the subject line and message - this makes the resultant email very hard to read.

Taking a look at the code, these come from the use of urlencode() in lines 71 and 72 of init.php in the mailto plugin. If I replace urlencode() with rawurlencode() then the spaces are left alone and it all works well for me. Is there any reason why I shouldn't make this change?

Many thanks!

jaybe
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 07 Apr 2013, 23:34

Re: Mailto plugin - plus signs

Postby jaybe » 10 Apr 2013, 21:26

I noticed this behavior when initially trying the mailto: plugin as well. I did not continue using it due to this behavior, despite wanting a mailto: option.

Curious if the behavior is expected or not; and if not, why is it occurring?

lignumaqua
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 10 Apr 2013, 19:22

Re: Mailto plugin - plus signs

Postby lignumaqua » 10 Apr 2013, 21:33

As I mentioned, it happens because of the use of urlencode(). Changing to rawurlencode() fixes it but I wanted to make sure that urlencode() hadn't been deliberately used for some other reason. :-)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Mailto plugin - plus signs

Postby fox » 10 Apr 2013, 22:35

File a pull request.

(why does php have two functions for urlencode wait I know the answer because php)

jaybe
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 07 Apr 2013, 23:34

Re: Mailto plugin - plus signs

Postby jaybe » 10 Apr 2013, 22:37

I understood what you described. My point was to determine if that behavior was purposely intended for technical reasons or otherwise. We are searching for the same explanations and answers! :)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Mailto plugin - plus signs

Postby fox » 10 Apr 2013, 22:45

No I definitely never intended to replace spaces with plus signs, this would be largely retarded, wouldn't you agree. I'm not a space hater or anything.

Edit: as far as I can see + vs %20 is the only difference between the two.

Edit2: updated in trunk.

jaybe
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 07 Apr 2013, 23:34

Re: Mailto plugin - plus signs

Postby jaybe » 10 Apr 2013, 23:02

I+would+tend+to+agree.
+
Thanks+for+TT-RSS+and+for+updating/fixing+this!
+
++ATH^fsldkfjlfsdkjk

lignumaqua
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 10 Apr 2013, 19:22

Re: Mailto plugin - plus signs

Postby lignumaqua » 11 Apr 2013, 02:15

fox - perfect, thanks for jumping on this! I had made the same change in my version without apparent problems, but, as a 'newbie' here, didn't know if there had been some reason in the past for this.

jaybe - my apologies, I misunderstood your initial question. Yes, we both were asking the same thing!


Return to “Development”

Who is online

Users browsing this forum: No registered users and 15 guests