Skip to content

Commit

Permalink
fixes json encode for < php 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Shaffer committed Mar 25, 2013
1 parent a8d8025 commit 02be9c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Demo/Twig/JsonStringifyExtension.php
Expand Up @@ -21,7 +21,7 @@ public function jsonStringify($json)
}
$pattern = array(',"', '{', '}');
$replacement = array(",\n\t\"", "{\n\t", "\n}");
return str_replace($pattern, $replacement, $string);
return str_replace($pattern, $replacement, json_encode($json));
}

public function getName()
Expand Down

0 comments on commit 02be9c8

Please sign in to comment.