Under submission settings > custom URL, when I entered a url like: thankyou?template=test the page redirect to a broken url with the special characters replaced by html codes.

This worked fine on 3.x branch, but after uploading to 4-alpha it apparently broke.

Idan

CommentFileSizeAuthor
#5 2032793-query-string-url-5.patch679 bytesianthomas_uk

Comments

Exploratus’s picture

I have this problem.

grahamc’s picture

mjcarter’s picture

ianthomas_uk’s picture

This was broken by a change in #828566-72: Webform Token support on confirmation message (that wasn't in #66), specifically:

@@ function webform_client_form_submit($form, &$form_state) {
   elseif ($redirect_url && strpos($redirect_url, 'http') !== 0) {
-    $parts = drupal_parse_url($redirect_url);
-    $parts['query'] ? ($parts['query']['sid'] = $sid) : ($parts['query'] = array('sid' => $sid));
-    $query = $parts['query'];
-    $redirect = array($parts['path'], array('query' => $query, 'fragment' => $parts['fragment']));
+    $redirect = $redirect_url;
   }

I think the indended change here was:

Removed sid=x from *internal redirects*. We'd been doing this to assist in users wanting to replace tokens on pages other than the confirmation page URL, but unless we add the hash to those pages also, I think that method of token replacement should be discouraged since it's not secure. This annoyed people more than it helped anyway.

I'll write a patch that adds back the drupal_parse_url call but doesn't add the sid.

ianthomas_uk’s picture

Version: 7.x-4.0-alpha8 » 7.x-4.x-dev
Status: Active » Needs review
StatusFileSize
new679 bytes

Here's my patch to restore this functionality

robwilmshurst’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Verified against a couple of different webform instances.

quicksketch’s picture

Thanks for the patch. These seems like it may overlap or affect #1244072: Use of tokens in external URL redirect locations not allowed in some cases and not URL Encoded. Do you think you'd have a chance to see if these could be combined or get working together?

ianthomas_uk’s picture

Status: Reviewed & tested by the community » Closed (duplicate)