Sfoglia il codice sorgente

fix buglet in Zend_Json::prettyPrint

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19910 44c647ce-9c0f-0410-b52a-842ac1e357ba
stas 16 anni fa
parent
commit
0af8f8991c
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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);
             $prefix = str_repeat($ind, $indent);
             if($token == "{" || $token == "[") {
             if($token == "{" || $token == "[") {
                 $indent++;
                 $indent++;
-                if($result[strlen($result)-1] == "\n") {
+                if($result != "" && $result[strlen($result)-1] == "\n") {
                     $result .= $prefix;
                     $result .= $prefix;
                 }
                 }
                 $result .= "$token\n";
                 $result .= "$token\n";