Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

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
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" "https://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" "https://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 the 2.0 milestone Apr 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants