  * @append [see:textField],
  * @encode [see:styleSheetLinkTag].
  */
-public string function endFormTag(string prepend, string append, boolean encode) {
+public string function endFormTag(string prepend, string append, any encode) {
 	$args(name="endFormTag", args=arguments);
 
 	// Encode all prepend / append type arguments if specified.
-	if (arguments.encode && $get("encodeHtmlTags")) {
+	if (IsBoolean(arguments.encode) && arguments.encode && $get("encodeHtmlTags")) {
 		if (Len(arguments.prepend)) {
 			arguments.prepend = EncodeForHtml($canonicalize(arguments.prepend));
 		}

			arguments.append = EncodeForHtml($canonicalize(arguments.append));
		}
	}

	// sets a flag to indicate whether we use get or post on this form, used when obfuscating params
	request.wheels.currentFormMethod = arguments.method;

			arguments.append = EncodeForHtml($canonicalize(arguments.append));
		}
	}
	arguments.encode = IsBoolean(arguments.encode) && !arguments.encode ? false : true;

	local.rv = arguments.prepend;
