summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-04-27 20:43:35 -0400
committerMalf Furious <m@lfurio.us>2016-04-27 20:43:35 -0400
commitcaebcb442985496b3bddaa3e7c1a752832e32e0b (patch)
tree52946eff9420871f536d7fc99dbd1cd562afbf4a /app
parentdbf4512ce48c04af4a8332cff3064f29b5690446 (diff)
downloadscrott-caebcb442985496b3bddaa3e7c1a752832e32e0b.tar.gz
scrott-caebcb442985496b3bddaa3e7c1a752832e32e0b.zip
Revert "Update function Form::populate() to initialize fields added with Form::field_file()"
This reverts commit 1f8b53e426b8c0a1546e9d5c21573be9003cb556. See parent commit message.
Diffstat (limited to 'app')
-rw-r--r--app/class/form.class.php36
1 files changed, 1 insertions, 35 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php
index 529c480..e748afc 100644
--- a/app/class/form.class.php
+++ b/app/class/form.class.php
@@ -105,7 +105,7 @@ class Form
/*
* Populate the form with input data from web page
*/
- function populate($input, $files = null)
+ function populate($input)
{
/* detect duplicate names */
$names = array();
@@ -115,8 +115,6 @@ class Form
$names[] = $fld['name'];
foreach ($this->enumFields as $fld)
$names[] = $fld['name'];
- foreach ($this->fileFields as $fld)
- $names[] = $fld['name'];
if (count(array_unique($names)) != count($names))
{
@@ -197,38 +195,6 @@ class Form
$this->logError($fld['name'] . " is required");
}
- /* init file fields */
- foreach ($this->fileFields as $fld)
- {
- if (!is_null($files) && isset($files[$fld['name']]))
- {
- $file = $files[$fld['name']];
-
- if ($file['error'] > 0)
- {
- $this->logError("An unknown error occurred");
- continue;
- }
-
- if ($file['size'] > $fld['maxsize'])
- {
- $this->logError("File must be no larger than " . $fld['maxsize'] . " bytes");
- continue;
- }
-
- if (is_array($fld['mime']) && array_search($file['type'], $fld['mime']) === false)
- {
- $this->logError("File type is not supported");
- continue;
- }
-
- $this->$fld['name'] = $file;
- }
-
- else if ($fld['req'])
- $this->logError($fld['name'] . " is required");
- }
-
/* return */
return count($this->errorlist) == 0;
}