fix another '0' problem

This commit is contained in:
Tobias Schultze 2012-07-12 18:43:06 +03:00
parent 1484ca789d
commit d83d65a312
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ class JsonResponse extends Response
*/
public function setCallback($callback = null)
{
if ($callback) {
if (null !== $callback) {
// taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/
$pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u';
$parts = explode('.', $callback);
@ -95,7 +95,7 @@ class JsonResponse extends Response
*/
protected function update()
{
if ($this->callback) {
if (null !== $this->callback) {
// Not using application/javascript for compatibility reasons with older browsers.
$this->headers->set('Content-Type', 'text/javascript', true);