Skip to content

Commit

Permalink
Fixing issue to serialize 'false' variables in JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
felipernb committed Apr 19, 2012
1 parent bdfe1c7 commit 79854c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/DrSlump/Protobuf/Codec/PhpArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected function filterValue($value, Protobuf\Field $field)
return $this->decodeMessage(new $nested, $value);
}
case Protobuf::TYPE_BOOL:
return filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
return !!$value;
case Protobuf::TYPE_STRING:
case Protobuf::TYPE_BYTES:
return (string)$value;
Expand Down

0 comments on commit 79854c8

Please sign in to comment.