fixed : spaces to only look outside of "quotes"
authorMichael Dale <dale@users.mediawiki.org>
Thu, 27 Aug 2009 16:56:54 +0000 (16:56 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Thu, 27 Aug 2009 16:56:54 +0000 (16:56 +0000)
js2/mwEmbed/php/maintenance/mergeJavascriptMsg.php

index 066642c..32e79dc 100644 (file)
@@ -170,11 +170,13 @@ function jsonReadable( $json ) {
                                                $result .= $char . $newline . str_repeat( $tab, $tabcount );
                                        }
                                break;
-/* FIXME: this will change "key" : "message:" to "key" : "messages : ". Not intended.
-          now "key" : "message" will become "key":"message:", but that's not too big of a problem.
-                                       case ':':
-                                       $result .= ' ' . $char . ' ';
-                                       break; */
+                               case ':':
+                                       if($inquote){
+                                               $result .= $char;
+                                       }else{
+                                               $result .= ' ' . $char . ' ';
+                                       }
+                                       break;
                                case '"':
                                        $inquote = !$inquote;
                                        $result .= $char;