Skip to content

Commit

Permalink
Set variable (type) in case of an empty requests
Browse files Browse the repository at this point in the history
  • Loading branch information
matrikular committed Jun 1, 2017
1 parent 9ba22b7 commit c14749c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/joomla/input/json.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public function __construct(array $source = null, array $options = array())
if (is_null($source))
{
$this->_raw = file_get_contents('php://input');
$this->data = json_decode($this->_raw, true);
$this->data = json_decode($this->_raw, true) ?: array();
}
else
{
$this->data = & $source;
$this->data = &$source;
}

// Set the options for the class.
Expand Down

0 comments on commit c14749c

Please sign in to comment.