Skip to content

Commit

Permalink
feat(Webforms) permit user to define return URL protocol so we suppor…
Browse files Browse the repository at this point in the history
…t https, by default we still use http to maintain backward compatibility
  • Loading branch information
joebordes committed Mar 24, 2019
1 parent 0a0520d commit 962db7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Smarty/templates/modules/Webforms/DetailView.tpl
Expand Up @@ -138,7 +138,7 @@
{'LBL_RETURNURL'|@getTranslatedString:$MODULE}
</td>
<td class="dvtCellInfo" align="left" >
http://{$WEBFORMMODEL->getReturnUrl()}
{$WEBFORMMODEL->getReturnUrl()}
</td>
</tr>
<tr style="height:25px;">
Expand Down
2 changes: 1 addition & 1 deletion Smarty/templates/modules/Webforms/EditView.tpl
Expand Up @@ -149,7 +149,7 @@
{'LBL_RETURNURL'|@getTranslatedString:$MODULE}
</td>
<td class="dvtCellInfo" align="left" >
http:// <input type="text" onblur="this.className='detailedViewTextBox';" onfocus="this.className='detailedViewTextBoxOn';" class="detailedViewTextBox" id="returnurl" name="returnurl" value="{$WEBFORM->getReturnUrl()}">
<input type="text" onblur="this.className='detailedViewTextBox';" onfocus="this.className='detailedViewTextBoxOn';" class="detailedViewTextBox" id="returnurl" name="returnurl" value="{$WEBFORM->getReturnUrl()}">
</td>
</tr>
{if $WEBFORM->hasId()}
Expand Down
6 changes: 5 additions & 1 deletion modules/Webforms/capture.php
Expand Up @@ -123,7 +123,11 @@ protected function sendResponse($url, $success = false, $failure = false) {
echo $response;
}
} else {
header(sprintf("Location: http://%s?%s=%s", $url, ($success? 'success' : 'error'), ($success? $success: $failure)));
if (strpos($url, '://')) {
header(sprintf('Location: %s?%s=%s', $url, ($success? 'success' : 'error'), ($success? $success: $failure)));
} else {
header(sprintf('Location: http://%s?%s=%s', $url, ($success? 'success' : 'error'), ($success? $success: $failure)));
}
}
}
}
Expand Down

0 comments on commit 962db7d

Please sign in to comment.