]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Support for requests with over 1000 input vars (default value php.ini)
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 29 Nov 2014 15:04:27 +0000 (16:04 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 29 Nov 2014 15:48:03 +0000 (16:48 +0100)
gui/baculum/protected/Class/BaculumAPI.php

index 4c9fb174e3497826695df32ec411f948e414f82d..29029fa6ecbee8c6919d439b80066fc3927efbf6 100644 (file)
@@ -109,7 +109,16 @@ abstract class BaculumAPI extends TPage
                        $params = (object)$this->Request['update'];
                        $this->set($id, $params);
                } else {
-                       parse_str(file_get_contents("php://input"),$responseData);
+                       $inputstr = file_get_contents("php://input");
+                       $chunks = explode('&', $inputstr);
+                       $responseData = array();
+                       for($i = 0; $i<count($chunks); $i++) {
+                               parse_str($chunks[$i], $responseEl);
+                               if(is_array($responseEl) && array_key_exists('update', $responseEl) && is_array($responseEl['update'])) {
+                                       $key = key($responseEl['update']);
+                                       $responseData['update'][$key] = $responseEl['update'][$key];
+                               }
+                       }
                        if(is_array($responseData) && array_key_exists('update', $responseData)) {
                                $params = (object)$responseData['update'];
                                $this->set($id, $params);
@@ -139,4 +148,4 @@ abstract class BaculumAPI extends TPage
                return $this->Application->getModule($name);
        }
 }
-?>
\ No newline at end of file
+?>