]> git.andy128k.dev Git - ipf.git/commitdiff
correct merge form data
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 17 Jan 2015 14:43:54 +0000 (16:43 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 17 Jan 2015 14:43:54 +0000 (16:43 +0200)
ipf/admin/component.php
ipf/http/request.php

index e6835316d9a929c55ededc377c7639497653787b..b69bd46ba2685579e868c617f50f4e468f97e4ff 100644 (file)
@@ -174,7 +174,7 @@ abstract class IPF_Admin_Component
     {
         $errors = false;
         if ($this->request->method == 'POST') {
-            $form = $this->_getAddForm(null, $this->request->POST + $this->request->FILES);
+            $form = $this->_getAddForm(null, $this->request->getFormData());
             $this->_setupAddForm($form);
 
             if ($form->isValid()) {
@@ -233,7 +233,7 @@ abstract class IPF_Admin_Component
 
         $errors = false;
         if ($this->request->method == 'POST') {
-            $form = $this->_getEditForm($object, $this->request->POST + $this->request->FILES);
+            $form = $this->_getEditForm($object, $this->request->getFormData());
             $this->_setupEditForm($form);
 
             if ($form->isValid()) {
index 622706f1e0ab5e52fe7155f274d930a2050d41ee..0fd8fd37c3d7bbe29a5c833fe71537dfc2837a52 100644 (file)
@@ -64,5 +64,10 @@ class IPF_HTTP_Request
     {
         return file_get_contents('php://input');
     }
+
+    public function getFormData()
+    {
+        return array_merge_recursive($this->POST, $this->FILES);
+    }
 }