Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty tags created for integer = 0 #14

Closed
maciejmajewski opened this issue Aug 23, 2012 · 0 comments
Closed

Empty tags created for integer = 0 #14

maciejmajewski opened this issue Aug 23, 2012 · 0 comments
Assignees
Labels
Projects
Milestone

Comments

@maciejmajewski
Copy link

Regression bug caused by issue #11.

Given:

$plist = new CFPropertyList();
$dict = new CFDictionary();

$dict->add('string', new CFString(''));
$dict->add('number', new CFNumber(0));
$dict->add('double', new CFNumber(0.0));

$plist->add($dict);

print $plist->toXML();

Current:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict><key>string</key><string/><key>number</key><integer/><key>double</key><real/></dict></plist>

Expected:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict><key>string</key><string/><key>number</key><integer>0</integer><key>double</key><real>0</real></dict></plist>

Actual implementation creates empty tags also for integer and real elements.

@ckruse ckruse closed this as completed in 321b13f Aug 27, 2012
ckruse added a commit that referenced this issue Aug 27, 2012
Fix for creating empty tags for all 'false' PHP values. Fixes issue #14
@ajsb85 ajsb85 added the bug label Apr 18, 2018
@ajsb85 ajsb85 added this to Done in Package Apr 18, 2018
@ajsb85 ajsb85 added this to the 2.0 milestone Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Package
  
Done
Development

No branches or pull requests

5 participants