{"action":"created","issue":{"url":"https://api.github.com/repos/phingofficial/phing/issues/534","repository_url":"https://api.github.com/repos/phingofficial/phing","labels_url":"https://api.github.com/repos/phingofficial/phing/issues/534/labels{/name}","comments_url":"https://api.github.com/repos/phingofficial/phing/issues/534/comments","events_url":"https://api.github.com/repos/phingofficial/phing/issues/534/events","html_url":"https://github.com/phingofficial/phing/issues/534","id":181881488,"node_id":"MDU6SXNzdWUxODE4ODE0ODg=","number":534,"title":"\"true\" not handled consistently <equals ... arg2=\"true\"> should be the same as <istrue ...>? (Trac #495)","user":{"login":"phing-issues-importer","id":22724931,"node_id":"MDQ6VXNlcjIyNzI0OTMx","avatar_url":"https://avatars2.githubusercontent.com/u/22724931?v=4","gravatar_id":"","url":"https://api.github.com/users/phing-issues-importer","html_url":"https://github.com/phing-issues-importer","followers_url":"https://api.github.com/users/phing-issues-importer/followers","following_url":"https://api.github.com/users/phing-issues-importer/following{/other_user}","gists_url":"https://api.github.com/users/phing-issues-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/phing-issues-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phing-issues-importer/subscriptions","organizations_url":"https://api.github.com/users/phing-issues-importer/orgs","repos_url":"https://api.github.com/users/phing-issues-importer/repos","events_url":"https://api.github.com/users/phing-issues-importer/events{/privacy}","received_events_url":"https://api.github.com/users/phing-issues-importer/received_events","type":"User","site_admin":false},"labels":[{"id":457953567,"node_id":"MDU6TGFiZWw0NTc5NTM1Njc=","url":"https://api.github.com/repos/phingofficial/phing/labels/core","name":"core","color":"FFFFFF","default":false},{"id":457953618,"node_id":"MDU6TGFiZWw0NTc5NTM2MTg=","url":"https://api.github.com/repos/phingofficial/phing/labels/feedback","name":"feedback","color":"FFFFFF","default":false},{"id":457953564,"node_id":"MDU6TGFiZWw0NTc5NTM1NjQ=","url":"https://api.github.com/repos/phingofficial/phing/labels/migrated%20from%20Trac","name":"migrated from Trac","color":"c2e0c6","default":false},{"id":836322202,"node_id":"MDU6TGFiZWw4MzYzMjIyMDI=","url":"https://api.github.com/repos/phingofficial/phing/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"open","locked":false,"assignee":{"login":"mpdude","id":1202333,"node_id":"MDQ6VXNlcjEyMDIzMzM=","avatar_url":"https://avatars0.githubusercontent.com/u/1202333?v=4","gravatar_id":"","url":"https://api.github.com/users/mpdude","html_url":"https://github.com/mpdude","followers_url":"https://api.github.com/users/mpdude/followers","following_url":"https://api.github.com/users/mpdude/following{/other_user}","gists_url":"https://api.github.com/users/mpdude/gists{/gist_id}","starred_url":"https://api.github.com/users/mpdude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpdude/subscriptions","organizations_url":"https://api.github.com/users/mpdude/orgs","repos_url":"https://api.github.com/users/mpdude/repos","events_url":"https://api.github.com/users/mpdude/events{/privacy}","received_events_url":"https://api.github.com/users/mpdude/received_events","type":"User","site_admin":false},"assignees":[{"login":"mpdude","id":1202333,"node_id":"MDQ6VXNlcjEyMDIzMzM=","avatar_url":"https://avatars0.githubusercontent.com/u/1202333?v=4","gravatar_id":"","url":"https://api.github.com/users/mpdude","html_url":"https://github.com/mpdude","followers_url":"https://api.github.com/users/mpdude/followers","following_url":"https://api.github.com/users/mpdude/following{/other_user}","gists_url":"https://api.github.com/users/mpdude/gists{/gist_id}","starred_url":"https://api.github.com/users/mpdude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpdude/subscriptions","organizations_url":"https://api.github.com/users/mpdude/orgs","repos_url":"https://api.github.com/users/mpdude/repos","events_url":"https://api.github.com/users/mpdude/events{/privacy}","received_events_url":"https://api.github.com/users/mpdude/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/phingofficial/phing/milestones/34","html_url":"https://github.com/phingofficial/phing/milestone/34","labels_url":"https://api.github.com/repos/phingofficial/phing/milestones/34/labels","id":2057191,"node_id":"MDk6TWlsZXN0b25lMjA1NzE5MQ==","number":34,"title":"Backlog","description":null,"creator":{"login":"phing-issues-importer","id":22724931,"node_id":"MDQ6VXNlcjIyNzI0OTMx","avatar_url":"https://avatars2.githubusercontent.com/u/22724931?v=4","gravatar_id":"","url":"https://api.github.com/users/phing-issues-importer","html_url":"https://github.com/phing-issues-importer","followers_url":"https://api.github.com/users/phing-issues-importer/followers","following_url":"https://api.github.com/users/phing-issues-importer/following{/other_user}","gists_url":"https://api.github.com/users/phing-issues-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/phing-issues-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phing-issues-importer/subscriptions","organizations_url":"https://api.github.com/users/phing-issues-importer/orgs","repos_url":"https://api.github.com/users/phing-issues-importer/repos","events_url":"https://api.github.com/users/phing-issues-importer/events{/privacy}","received_events_url":"https://api.github.com/users/phing-issues-importer/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":26,"state":"open","created_at":"2016-10-09T11:17:01Z","updated_at":"2018-04-14T16:41:13Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-10-09T11:16:45Z","updated_at":"2018-08-15T16:29:08Z","closed_at":null,"author_association":"NONE","body":"I just ran into a bug/issue where the value \"true\" is not handled consistently. This code shows the problem:\n\n```\n<property name=\"test\" value=\"true\"/>\n\n<if>\n    <equals arg1=\"${test}\" arg2=\"true\"/>\n    <then>\n        <echo msg=\"Test === true\"/>\n    </then>\n    <else>\n        <echo msg=\"Test !== true\"/>\n    </else>\n</if>\n```\n\nOne would expect (or at least I did) that the <equals> test would be true and you'd get the first message ('Test === true'). Instead the test fails and you get the second test.\n\nIn the <property> task, the string \"true\" is actually being converted into \"1\" (\"false\" gets converted to \"\"). But down in the test, <equals> apparently is _not_ converting \"true\" into the same value. What is going on can be seen using the following code:\n\n```\n<property name=\"test\" value=\"true\"/>\n\n<if>\n    <equals arg1=\"${test}\" arg2=\"true\"/>\n    <then>\n        <echo msg=\"Test === true\"/>\n    </then>\n    <else>\n        <echo msg=\"Test !== true\"/>\n    </else>\n</if>\n\n<if>\n    <equals arg1=\"${test}\" arg2=\"1\"/>\n    <then>\n        <echo msg=\"Test === 1\"/>\n    </then>\n</if>\n\n<if>\n    <istrue value=\"${test}\"/>\n    <then>\n        <echo msg=\"Test istrue\"/>\n    </then>\n</if>\n```\n\nWhich generates:\n\nTest !== true\n\nTest === 1\n\nTest istrue\n\nObviously the <istrue> test was created to handle booleans, but the documentation does not make it clear that A) <property> changes \"true\" to \"1\" (i.e. handles it as a boolean rather than a string) or B) that you need to use a separate test for boolean values (if you are just reading the <if> and <equals> parts.\n\nIf possible, it seams like it would make sense that\n\n<equals arg1=\"${test}\" arg2=\"true\"/>\n\nshould evaluate the same as:\n\n<istrue value=\"${test}\"/>\n\nMigrated from https://www.phing.info/trac/ticket/495\n\n``` json\n{\n    \"status\": \"reopened\", \n    \"changetime\": \"2016-10-07T08:28:55\", \n    \"description\": \"I just ran into a bug/issue where the value \\\"true\\\" is not handled consistently. This code shows the problem:\\n\\n<property name=\\\"test\\\" value=\\\"true\\\"/>\\n\\n<if>\\n\\t<equals arg1=\\\"${test}\\\" arg2=\\\"true\\\"/>\\n\\t<then>\\n\\t\\t<echo msg=\\\"Test === true\\\"/>\\n\\t</then>\\n\\t<else>\\n\\t\\t<echo msg=\\\"Test !== true\\\"/>\\n\\t</else>\\n</if>\\n\\nOne would expect (or at least I did) that the <equals> test would be true and you'd get the first message ('Test === true'). Instead the test fails and you get the second test.\\n\\nIn the <property> task, the string \\\"true\\\" is actually being converted into \\\"1\\\" (\\\"false\\\" gets converted to \\\"\\\"). But down in the test, <equals> apparently is *not* converting \\\"true\\\" into the same value. What is going on can be seen using the following code:\\n\\n<property name=\\\"test\\\" value=\\\"true\\\"/>\\n\\n<if>\\n\\t<equals arg1=\\\"${test}\\\" arg2=\\\"true\\\"/>\\n\\t<then>\\n\\t\\t<echo msg=\\\"Test === true\\\"/>\\n\\t</then>\\n\\t<else>\\n\\t\\t<echo msg=\\\"Test !== true\\\"/>\\n\\t</else>\\n</if>\\n\\n<if>\\n\\t<equals arg1=\\\"${test}\\\" arg2=\\\"1\\\"/>\\n\\t<then>\\n\\t\\t<echo msg=\\\"Test === 1\\\"/>\\n\\t</then>\\n</if>\\n\\n<if>\\n\\t<istrue value=\\\"${test}\\\"/>\\n\\t<then>\\n\\t\\t<echo msg=\\\"Test istrue\\\"/>\\n\\t</then>\\n</if>\\n\\nWhich generates:\\n\\nTest !== true[[BR]]\\nTest === 1[[BR]]\\nTest istrue[[BR]]\\n\\n\\nObviously the <istrue> test was created to handle booleans, but the documentation does not make it clear that A) <property> changes \\\"true\\\" to \\\"1\\\" (i.e. handles it as a boolean rather than a string) or B) that you need to use a separate test for boolean values (if you are just reading the <if> and <equals> parts.\\n\\nIf possible, it seams like it would make sense that\\n\\n<equals arg1=\\\"${test}\\\" arg2=\\\"true\\\"/>\\n\\nshould evaluate the same as:\\n\\n<istrue value=\\\"${test}\\\"/>\\n\\n\\n\", \n    \"reporter\": \"lcoffin@cio.com\", \n    \"cc\": \"\", \n    \"resolution\": \"\", \n    \"_ts\": \"1475828935569836\", \n    \"component\": \"phing-core\", \n    \"summary\": \"\\\"true\\\" not handled consistently <equals ... arg2=\\\"true\\\"> should be the same as <istrue ...>?\", \n    \"priority\": \"minor\", \n    \"keywords\": \"\", \n    \"version\": \"2.4.0\", \n    \"time\": \"2010-04-28T18:47:04\", \n    \"milestone\": \"4.0\", \n    \"owner\": \"mp\", \n    \"type\": \"feedback\"\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/phingofficial/phing/issues/comments/413253613","html_url":"https://github.com/phingofficial/phing/issues/534#issuecomment-413253613","issue_url":"https://api.github.com/repos/phingofficial/phing/issues/534","id":413253613,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzI1MzYxMw==","user":{"login":"stale[bot]","id":26384082,"node_id":"MDM6Qm90MjYzODQwODI=","avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-08-15T16:29:08Z","updated_at":"2018-08-15T16:29:08Z","author_association":"NONE","body":"This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.\n"}}
{"actor":{"display_login":"stale"}}