Skip to content

Commit acd39e4

Browse files
committed
#21 - Fix POST params retrieval
1 parent 10fa264 commit acd39e4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/TgUtils/Request.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,14 @@ public function getPostParam($key, $default = NULL) {
230230
public function getPostParams() {
231231
if ($this->postParams == NULL) {
232232
$this->postParams = array();
233-
$headers = $this->headers;
234233
// Check that we have content-length
235-
if (isset($headers['Content-Length'])) {
236-
$len = intval($headers['Content-Length']);
234+
$len = $this->getHeader('Content-Length');
235+
if ($len) {
236+
$len = intval($len);
237237
// Check that we have a valid content-length
238238
if (($len>0) && ($len<10000)) {
239239
$this->postParams = $_POST;
240+
Log::debug('postParams', $this->postParams);
240241
} else {
241242
Log::registerMessage(new Error('POST content too big'));
242243
}

0 commit comments

Comments
 (0)