Explorar el Código

Removed a double-comma issus in the output JSON.

Iñigo Valentin hace 9 años
padre
commit
6434c6dd48
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      www/API/v3/sync.php

+ 4 - 3
www/API/v3/sync.php

@@ -238,7 +238,7 @@
             $str = $str . json_encode($r) . ",";
         }
         $str = rtrim($str,',');
-        $str = $str . "]";
+        $str = $str . "],";
         return $str;
 
     }
@@ -300,7 +300,7 @@
         while($r = mysqli_fetch_assoc($q)) {
             $str = $str . json_encode($r) . ",";
         }
-        $str = rtrim($str,',');
+        $str = rtrim($str,",");
         $str = $str . "]";
         return $str;
     }
@@ -320,8 +320,9 @@
             foreach($tables as $table){
                 $str = $str . get_table($con, $table) . ",";
             }
-            $str = rtrim($str,',');
+            $str = rtrim($str, ",");
             $str = $str . "}";
+            $str = str_replace(",,", ",", $str);
             echo($str);
             return true;
         }