Merge pull request #3169 from Patroklo/develop
Change name didn't work if reset initialization it's true
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 75fc062..7946111 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -327,23 +327,26 @@
$this->$key = $defaults[$key];
}
}
-
- return $this;
+
}
-
- foreach ($config as $key => &$value)
+ else
{
- if ($key[0] !== '_' && $reflection->hasProperty($key))
+
+ foreach ($config as $key => &$value)
{
- if ($reflection->hasMethod('set_'.$key))
+ if ($key[0] !== '_' && $reflection->hasProperty($key))
{
- $this->{'set_'.$key}($value);
- }
- else
- {
- $this->$key = $value;
+ if ($reflection->hasMethod('set_'.$key))
+ {
+ $this->{'set_'.$key}($value);
+ }
+ else
+ {
+ $this->$key = $value;
+ }
}
}
+
}
// if a file_name was provided in the config, use it instead of the user input