(bug 15448) YAML output returns empty strings instead of 0. Surprisingly, this was...
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 3 Sep 2008 14:47:49 +0000 (14:47 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 3 Sep 2008 14:47:49 +0000 (14:47 +0000)
RELEASE-NOTES
includes/api/ApiFormatYaml_spyc.php

index 1a81d12..69a8f6d 100644 (file)
@@ -208,8 +208,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Database replication lag doesn't cause all action=edit requests to return the
   nochange flag any more
 * (bug 15392) ApiFormatBase::formatHTML now uses $wgUrlProtocols.
-* (bug 15444) action=edit returned "Unknown error: ``AS_END''" where it should
+* (bug 15444) action=edit returns "Unknown error: ``AS_END''" where it should
   return just "Unknown error"
+* (bug 15448) YAML output returns empty values instead of 0
 
 === Languages updated in 1.14 ===
 
index c0d4093..1cebbd6 100644 (file)
 
       if (is_int($key)) {
         // It's a sequence
-               if ($value)
+               if ($value !== '' && !is_null($value))
                        $string = $spaces.'- '.$value."\n";
                else
                        $string = $spaces . "-\n";
       } else {
                // It's mapped
-               if ($value)
-               $string = $spaces.$key.': '.$value."\n";
+               if ($value !== '' && !is_null($value))
+                       $string = $spaces . $key . ': ' . $value . "\n";
                else
                        $string = $spaces . $key . ":\n";
       }
           $array = $array + $this->_toType($v);
         }
         $value = $array;
-      } elseif (strtolower($value) == 'null' or $value == '' or $value == '~') {
+      } elseif (strtolower($value) == 'null' or $value === '' or $value == '~') {
         $value = NULL;
       } elseif (ctype_digit($value)) {
         $value = (int)$value;