From 6ffaa709780b5a63d029c5e222bb6d5a5a2abb4a Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 17 Jun 2010 23:06:40 +1200 Subject: [PATCH] Don't send multipart/form-data if the form is GET. --- inc/DataEntry.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inc/DataEntry.php b/inc/DataEntry.php index 5923a21..8eeaf4d 100644 --- a/inc/DataEntry.php +++ b/inc/DataEntry.php @@ -436,7 +436,8 @@ class EntryForm } $extra_attributes['action'] = $this->action; if ( !isset($extra_attributes['method']) ) $extra_attributes['method'] = 'post'; - if ( !isset($extra_attributes['enctype']) ) $extra_attributes['enctype'] = 'multipart/form-data'; + if ( strtolower($extra_attributes['method']) != 'get' ) + if ( !isset($extra_attributes['enctype']) ) $extra_attributes['enctype'] = 'multipart/form-data'; if ( !isset($extra_attributes['name']) ) $extra_attributes['name'] = 'form'; if ( !isset($extra_attributes['class']) ) $extra_attributes['class'] = 'formdata'; if ( !isset($extra_attributes['id']) ) $extra_attributes['id'] = $extra_attributes['name']; @@ -474,8 +475,9 @@ class EntryForm * @param string $fvalue The value of the field. * @return string The HTML fragment for the hidden field. */ - function HiddenField($fname,$fvalue) { - return sprintf( '%s', $fname, htmlspecialchars($fvalue), "\n" ); + function HiddenField($fname,$fvaluei,$fid = null) { + return sprintf( '%s', $fname, + htmlspecialchars($fvalue), (isset($id) ? 'id="$id" ' : ''), "\n" ); } /** -- 2.11.4.GIT