The field names are fully transported over, some values are not.
The issue: if you have an array (i.e. select field) and the ckform wants to redirect that, it will encounter an array and try to concat that to the URL for redirection.
That's not working.
/components/com_ckforms/controller.php
Lines 103:
- Code: Select all
100 if ($ckform->redirectdata == 1)
101 {
102 foreach ($post as $key => $value) {
103 $params = $params . '&'. $key.'='.htmlentities($value);
104 }
105 if (strlen($params) > 0 && strpos($ckform->redirecturl, '?') === false)
106 {
107 $params = '?'.substr($params, 1);
108 }
109 }
And my fix:
- Code: Select all
100 if ($ckform->redirectdata == 1)
101 {
102 foreach ($post as $key => $value) {
103 if (is_array($value)) $value=array_shift($value);
104 $params = $params . '&'. $key.'='.rawurlencode($value);
105 }
106 if (strlen($params) > 0 && strpos($ckform->redirecturl, '?') === false)
107 {
108 $params = '?'.substr($params, 1);
109 }
110 }
I lose the key for the array, but well.
And htmlentities is not good for links - as it adds bad codes a link cannot process ( i.e. ä = ä) where & is not escaped.
Instead, rawurlencode does the trick.
I am not very fond of the fact that the entire info is not transferred via POST but via GET.
But well.
EDIT:
if will also break the Joomla url rewriting if it submits the "id" of the form.
Add after line 102
103 if ($key=="id") continue; //we do not need the ID, it will not work with url rewriting