{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5277","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-framework","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5277/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5277/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5277/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/5277","id":146134190,"number":5277,"title":"FIeldnames cannot contain [ if value contains & character (e.g. <p>apple &amp; orange</p>)","user":{"login":"hailwood","id":709773,"avatar_url":"https://avatars.githubusercontent.com/u/709773?v=3","gravatar_id":"","url":"https://api.github.com/users/hailwood","html_url":"https://github.com/hailwood","followers_url":"https://api.github.com/users/hailwood/followers","following_url":"https://api.github.com/users/hailwood/following{/other_user}","gists_url":"https://api.github.com/users/hailwood/gists{/gist_id}","starred_url":"https://api.github.com/users/hailwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hailwood/subscriptions","organizations_url":"https://api.github.com/users/hailwood/orgs","repos_url":"https://api.github.com/users/hailwood/repos","events_url":"https://api.github.com/users/hailwood/events{/privacy}","received_events_url":"https://api.github.com/users/hailwood/received_events","type":"User","site_admin":false},"labels":[{"id":395787592,"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/affects/v3","name":"affects/v3","color":"d4c5f9","default":false},{"id":421035839,"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/type/bug","name":"type/bug","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-04-05T23:11:07Z","updated_at":"2016-12-08T14:55:19Z","closed_at":null,"body":"TLDR: field values are truncated at an ampersand if the fieldname contains [\n\n**Expected Output**\n\n``` html\n\"<p>apple &amp; banana</p>\"\n```\n\n**Actual Output**\n\n``` html\n\"<p>apple \"\n```\n\n**How to reproduce**\n\nadd the following to a form on a dataobject.\n\n``` php\nHtmlEditorField::create('Geocontent[AU]', 'Content for Australia');\n```\n\nIn the form set the value to \"apple & banana\" - html view should show\n\n``` html\n<p>apple &amp; banana</p>\n```\n\nIn onbeforeWrite attempt to read the value\n\n``` php\n$val = $this->{\"Geocontent[AU]\"};\ndie($val);\n```\n\n**What's happening?**\nThis is the offending line https://github.com/silverstripe/silverstripe-framework/blob/3ee8f505b75af39817d394bcf48623e092f43ed2/forms/Form.php#L1431\n\nFrom what I can tell it's splitting the string on the `&` to get the parts, but due to `Title=Awesome Page&GeoContent[AU]=<p>Apple &amp; Orange</p>` it's truncating the data.\n"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/265759402","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/5277#issuecomment-265759402","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5277","id":265759402,"user":{"login":"dhensby","id":563596,"avatar_url":"https://avatars.githubusercontent.com/u/563596?v=3","gravatar_id":"","url":"https://api.github.com/users/dhensby","html_url":"https://github.com/dhensby","followers_url":"https://api.github.com/users/dhensby/followers","following_url":"https://api.github.com/users/dhensby/following{/other_user}","gists_url":"https://api.github.com/users/dhensby/gists{/gist_id}","starred_url":"https://api.github.com/users/dhensby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhensby/subscriptions","organizations_url":"https://api.github.com/users/dhensby/orgs","repos_url":"https://api.github.com/users/dhensby/repos","events_url":"https://api.github.com/users/dhensby/events{/privacy}","received_events_url":"https://api.github.com/users/dhensby/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T14:55:19Z","updated_at":"2016-12-08T14:55:19Z","body":"why are we trying to manually parse form data like this? https://github.com/silverstripe/silverstripe-framework/blob/3ee8f505b75af39817d394bcf48623e092f43ed2/forms/Form.php#L1431\r\n\r\nI'd imagine it's not just `&amp;` it's any encoded char that has an `&` in it..."}}
{"actor":{"display_login":"dhensby"}}