4 |
* |
* |
5 |
* $Id$ |
* $Id$ |
6 |
* |
* |
7 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
* @author Walter A. Boring IV <waboring@newsblob.com> |
8 |
* @author Dave Brondsema <dave@brondsema.net> |
* @author Dave Brondsema <dave@brondsema.net> |
9 |
* @package phpHtmlLib |
* @package phpHtmlLib |
10 |
* @subpackage FormProcessing |
* @subpackage FormProcessing |
80 |
* @param FormValidation object. |
* @param FormValidation object. |
81 |
*/ |
*/ |
82 |
function validate(&$_FormValidation) { |
function validate(&$_FormValidation) { |
83 |
|
|
84 |
|
if (isset($_REQUEST[FORM_CONFIRM])) { |
85 |
|
//looks like we are in confirmation |
86 |
|
//we should have a populated array already. |
87 |
|
if ($this->_files_info['name']) { |
88 |
|
//we are ok |
89 |
|
return TRUE; |
90 |
|
} else { |
91 |
|
//something bogus happened here. |
92 |
|
$this->set_error_message("The uploaded file was unexpectedly empty."); |
93 |
|
return FALSE; |
94 |
|
} |
95 |
|
} |
96 |
|
|
97 |
switch ($_FILES[$this->get_element_name()]['error']) { |
switch ($_FILES[$this->get_element_name()]['error']) { |
98 |
case 0: |
case 0: |
99 |
if ($_FILES[$this->get_element_name()]['size'] == 0) { |
if ($_FILES[$this->get_element_name()]['size'] == 0) { |
209 |
* @return array |
* @return array |
210 |
*/ |
*/ |
211 |
function get_file_info() { |
function get_file_info() { |
212 |
return $_FILES[$this->get_element_name()]; |
return @$_FILES[$this->get_element_name()]; |
213 |
} |
} |
214 |
|
|
215 |
/** |
/** |