diff --git a/sites/all/modules/contrib/webform/includes/webform.pages.inc b/sites/all/modules/contrib/webform/includes/webform.pages.inc
index 97c9395..411db28 100644
--- a/sites/all/modules/contrib/webform/includes/webform.pages.inc
+++ b/sites/all/modules/contrib/webform/includes/webform.pages.inc
@@ -64,7 +64,7 @@ function webform_configure_form($form, &$form_state, $node) {
     '#type' => 'item',
     '#title' => t('Redirection location'),
     '#theme' => 'webform_advanced_redirection_form',
-    '#description' => t('Choose where to redirect the user upon successful submission.') . ' ' . t('The <em>Custom URL</em> option supports Webform token replacements.') . theme('webform_token_help', array('groups' => array('basic', 'node', 'special', 'submission'))),
+    '#description' => t('Choose where to redirect the user upon successful submission.') . ' ' . t('The <em>Custom URL</em> option supports Webform token replacements.') . ' ' . t('Prepending "urlencode_" to any token name gives a URLencoded version.') . theme('webform_token_help', array('groups' => array('basic', 'node', 'special', 'submission'))),
   );
   $form['submission']['redirection']['redirect']= array(
     '#type' => 'radios',
@@ -261,10 +261,15 @@ function webform_configure_form_validate($form, &$form_state) {
   // Ensure the entered redirect URL is valid.
   if ($form_state['values']['redirect'] == 'url') {
     $redirect_url = trim($form_state['values']['redirect_url']);
+    // Do token replacement in URL before checking for validity
+    $redirect_url_for_checking = _webform_filter_values($redirect_url, $form['#node'], NULL, NULL, FALSE, TRUE, TRUE);
+    foreach (array('%urlencode_value', '%value') as $token) {
+      $redirect_url_for_checking = preg_replace('/\\' . $token . '\[\w+\]/', '', $redirect_url_for_checking);
+    }
     if (empty($redirect_url)) {
       form_error($form['submission']['redirection']['redirect_url'], t('A valid URL is required for custom redirection.'));
     }
-    elseif (strpos($redirect_url, 'http') === 0 && !valid_url($redirect_url, TRUE)) {
+    elseif (strpos($redirect_url_for_checking, 'http') === 0 && !valid_url($redirect_url_for_checking, TRUE)) {
       form_error($form['submission']['redirection']['redirect_url'], t('The entered URL is not a valid address.'));
     }
     else {
diff --git a/sites/all/modules/contrib/webform/webform.module b/sites/all/modules/contrib/webform/webform.module
index 6ff3c85..98baa71 100644
--- a/sites/all/modules/contrib/webform/webform.module
+++ b/sites/all/modules/contrib/webform/webform.module
@@ -2516,7 +2516,7 @@ function webform_client_form_submit($form, &$form_state) {
 
   // Clean up the redirect URL and filter it for webform tokens.
   $redirect_url = trim($node->webform['redirect_url']);
-  $redirect_url = _webform_filter_values($redirect_url, $node, $submission, NULL, FALSE, TRUE);
+  $redirect_url = _webform_filter_values($redirect_url, $node, $submission, NULL, FALSE, TRUE, TRUE);
 
 
   // Remove the domain name from the redirect.
@@ -2901,8 +2901,11 @@ function _webform_fetch_draft_sid($nid, $uid) {
  *   %ip_address. This is disabled by default to prevent user data from being
  *   preserved in the anonymous page cache and should only be used in
  *   non-cached situations, such as e-mails.
+ * @param $urlencode
+ *   provide url encoded versions of all safe tokens prefixed with urlencode_
+ *   for use in URL redirection
  */
-function _webform_filter_values($string, $node = NULL, $submission = NULL, $email = NULL, $strict = TRUE, $allow_anonymous = FALSE) {
+function _webform_filter_values($string, $node = NULL, $submission = NULL, $email = NULL, $strict = TRUE, $allow_anonymous = FALSE, $urlencode = FALSE) {
   global $user;
   static $replacements;
 
@@ -3054,7 +3057,13 @@ function _webform_filter_values($string, $node = NULL, $submission = NULL, $emai
       $safe_replacements[$key] = '';
     }
   }
-
+  if($urlencode) {
+    // Provide URLEncoded replacements for use in URL redirects
+    foreach ($safe_replacements as $k => $r) {
+      $k = substr($k, 1);
+      $safe_replacements['%urlencode_' . $k] = urlencode($r);
+    }
+  }
   $find = array_keys($safe_replacements);
   $replace = array_values($safe_replacements);
   $string = str_replace($find, $replace, $string);
