Comments

te-brian’s picture

Status: Active » Needs review
StatusFileSize
new447 bytes

FYI, we can't use drupal_urlencode because it preserves '/' characters.

te-brian’s picture

Also, this could probably use a test .. but I am clueless when it comes to writing tests.

berdir’s picture

StatusFileSize
new5.18 KB

I haz test 4 u!

And they revealed that it's not that simple to encode a / properly.

The problem is that when clean_url's are enabled, mod_rewrite already decodes the /. This means we need to explicitly encode it twice and decode it again inside privatemsg_new().

berdir’s picture

And now without debug code and code style fixed.

Status: Needs review » Needs work

The last submitted patch, privatemsg_encode_subject_with_tests_without_debug.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new4.98 KB

Thank you testbot! ;)

Testbot doesn't use clean url's, If I only encode / conditially, then I need to do the same for decoding.

Status: Needs review » Needs work

The last submitted patch, privatemsg_encode_subject_and_with_clean_url_decode_check.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new4.9 KB

Fun stuff.

This patch passes for me both with and without clean_url's. Needs a separate approach. When clean url's are enabled, everything is encoded 2-3 times (because url() is encoding the path again) so that it survives through mod_rewrite and the menu system and everything is passed as a single string as subject.

Wondering about a completely different approach for this, especially since people are asking to control the body field in a similar way. I have no idea how, though.

berdir’s picture

Status: Needs review » Needs work

Needs to be re-rolled.

berdir’s picture

Status: Needs work » Needs review

#8: multiple_encoding_fun.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, multiple_encoding_fun.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new5.01 KB

Re-rolled the patch.

berdir’s picture

Version: » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Commited.

berdir’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new4.75 KB

It looks like the special case isn't necessary anymore in D7, the non-clean_url's solution worked too for me when using clean_url's. Let's see what the test bot has to say about this.

berdir’s picture

Status: Needs review » Fixed

Commited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.