Skip to content

Commit 3541747

Browse files
authored
Fix stringification of falsy non-empty strings (eg. "0") (#30)
1 parent b6b1dd8 commit 3541747

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/HJSON/HJSONStringifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private function quoteReplace($string)
122122

123123
private function quote($string = null, $gap = null, $hasComment = null, $isRootObject = null)
124124
{
125-
if (!$string) {
125+
if ($string === '' || $string === null) {
126126
return '""';
127127
}
128128

0 commit comments

Comments
 (0)