1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

Fix for $frm->open() when using GET and query strings.

This commit is contained in:
Cameron
2014-08-12 15:51:35 -07:00
parent 0047c655f8
commit 4bc29714a1

View File

@@ -109,8 +109,6 @@ class e_form
parse_str($options,$options); parse_str($options,$options);
$target = str_replace("&", "&", $target);
if(vartrue($options['class'])) if(vartrue($options['class']))
{ {
$class = "class='".$options['class']."'"; $class = "class='".$options['class']."'";
@@ -125,11 +123,11 @@ class e_form
$autoComplete = " autocomplete='".($options['autocomplete'] ? 'on' : 'off')."'"; $autoComplete = " autocomplete='".($options['autocomplete'] ? 'on' : 'off')."'";
} }
$text = "\n<form {$class} action='{$target}' id='".$this->name2id($name)."' method = '{$method}'{$autoComplete}>\n";
if($method == 'get' && strpos($target,'=')) if($method == 'get' && strpos($target,'='))
{ {
list($url,$qry) = explode("?",$target); list($url,$qry) = explode("?",$target);
$text = "\n<form {$class} action='{$url}' id='".$this->name2id($name)."' method = '{$method}'{$autoComplete}>\n";
parse_str($qry,$m); parse_str($qry,$m);
foreach($m as $k=>$v) foreach($m as $k=>$v)
@@ -138,7 +136,11 @@ class e_form
} }
} }
else
{
$target = str_replace("&", "&amp;", $target);
$text = "\n<form {$class} action='{$target}' id='".$this->name2id($name)."' method = '{$method}'{$autoComplete}>\n";
}
return $text; return $text;
} }