Explorar o código

fix buglet in Zend_Json::prettyPrint

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19910 44c647ce-9c0f-0410-b52a-842ac1e357ba
stas %!s(int64=16) %!d(string=hai) anos
pai
achega
0af8f8991c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      library/Zend/Json.php

+ 1 - 1
library/Zend/Json.php

@@ -363,7 +363,7 @@ class Zend_Json
             $prefix = str_repeat($ind, $indent);
             if($token == "{" || $token == "[") {
                 $indent++;
-                if($result[strlen($result)-1] == "\n") {
+                if($result != "" && $result[strlen($result)-1] == "\n") {
                     $result .= $prefix;
                 }
                 $result .= "$token\n";