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

Replacetokens treating values as boolean #1719

Closed
mpeter-fv opened this issue May 25, 2023 · 0 comments
Closed

Replacetokens treating values as boolean #1719

mpeter-fv opened this issue May 25, 2023 · 0 comments
Milestone

Comments

@mpeter-fv
Copy link

Describe the bug
In the latest version 3.0.0-RC5, replacing tokens with the value 1, results in them being replaced with true instead.

Steps To Reproduce
build.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="test">
    <target name="test">
        <copy file="test.reference.json" tofile="test.json" overwrite="true">
            <filterchain>
                <replacetokens begintoken="%" endtoken="%">
                    <token key="TEST_TOKEN" value="1"/>
                </replacetokens>
            </filterchain>
        </copy>
    </target>
</project>

test.reference.json

{
  "test": "%TEST_TOKEN%"
}

Command executed:

/usr/bin/php7.4 ./phing-3.0.0-RC5.phar -f build.xml

Result:

cat test.json
{
  "test": "true"
}

Expected behavior
Using a <token> with value="1" should be treated verbatim.

Additional context
This is working fine with Phing 2 or when the value is greater than 1.

@mrook mrook added this to the 3.0.0 milestone Jul 6, 2023
@mrook mrook closed this as completed in e6702dc Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants