mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 11:59:56 +00:00
treat 0 as valid value inside <format> tag
This commit is contained in:
parent
3e2f331eb2
commit
bb7421acb7
|
@ -148,7 +148,7 @@ class Node {
|
|||
if ( !$value && $xmlNode->{self::DEFAULT_TAG_NAME} ) {
|
||||
return $this->getInnerValue( $xmlNode->{self::DEFAULT_TAG_NAME} );
|
||||
}
|
||||
if ( $value && $xmlNode->{self::FORMAT_TAG_NAME} ) {
|
||||
if ( ( $value || $value == '0' ) && $xmlNode->{self::FORMAT_TAG_NAME} ) {
|
||||
return $this->getInnerValue( $xmlNode->{self::FORMAT_TAG_NAME} );
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,8 @@ class NodeDataTest extends WikiaBaseTest {
|
|||
[ 'value' => '{{{not_defined_var}}}%', 'label' => 'l' ] ],
|
||||
[ '<data source="test"><label>l</label><format>{{{test}}}%</format><default>def</default></data>', [ ],
|
||||
[ 'value' => 'def', 'label' => 'l' ] ],
|
||||
[ '<data source="test"><format>{{{test}}}%</format></data>', [ 'test' => 0 ],
|
||||
[ 'value' => '{{{test}}}%', 'label' => '' ] ],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue