{"action":"created","issue":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/1953","labels_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/1953/labels{/name}","comments_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/1953/comments","events_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/1953/events","html_url":"https://github.com/bcit-ci/CodeIgniter/issues/1953","id":8026696,"number":1953,"title":"Encoding of form fields","user":{"login":"it-can","id":644288,"avatar_url":"https://avatars.githubusercontent.com/u/644288?v=3","gravatar_id":"","url":"https://api.github.com/users/it-can","html_url":"https://github.com/it-can","followers_url":"https://api.github.com/users/it-can/followers","following_url":"https://api.github.com/users/it-can/following{/other_user}","gists_url":"https://api.github.com/users/it-can/gists{/gist_id}","starred_url":"https://api.github.com/users/it-can/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/it-can/subscriptions","organizations_url":"https://api.github.com/users/it-can/orgs","repos_url":"https://api.github.com/users/it-can/repos","events_url":"https://api.github.com/users/it-can/events{/privacy}","received_events_url":"https://api.github.com/users/it-can/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/labels/Bug","name":"Bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/milestones/2","labels_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/milestones/2/labels","id":29883,"number":2,"title":"v3.0.0","description":"Branch: develop","creator":{"login":"philsturgeon","id":67381,"avatar_url":"https://avatars.githubusercontent.com/u/67381?v=3","gravatar_id":"","url":"https://api.github.com/users/philsturgeon","html_url":"https://github.com/philsturgeon","followers_url":"https://api.github.com/users/philsturgeon/followers","following_url":"https://api.github.com/users/philsturgeon/following{/other_user}","gists_url":"https://api.github.com/users/philsturgeon/gists{/gist_id}","starred_url":"https://api.github.com/users/philsturgeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philsturgeon/subscriptions","organizations_url":"https://api.github.com/users/philsturgeon/orgs","repos_url":"https://api.github.com/users/philsturgeon/repos","events_url":"https://api.github.com/users/philsturgeon/events{/privacy}","received_events_url":"https://api.github.com/users/philsturgeon/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":93,"state":"open","created_at":"2011-08-20T20:31:01Z","updated_at":"2015-01-19T12:48:08Z","due_on":null,"closed_at":null},"comments":18,"created_at":"2012-11-01T10:16:59Z","updated_at":"2015-01-21T14:40:35Z","closed_at":"2012-11-01T13:25:42Z","body":"Hi,\r\n\r\nsince I updated to the latest develop it seems that when I post/save to the database ```&``` it seems to get encoded to ```&amp;```\r\nIn the database it is saved correctly...\r\n\r\nI think it is related to this: https://github.com/EllisLab/CodeIgniter/commit/3ccc386be4e0e1e4b3d47f1785e11d4b8613ef72#diff-25"},"comment":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/comments/70848044","html_url":"https://github.com/bcit-ci/CodeIgniter/issues/1953#issuecomment-70848044","issue_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/1953","id":70848044,"user":{"login":"ivantcholakov","id":1438104,"avatar_url":"https://avatars.githubusercontent.com/u/1438104?v=3","gravatar_id":"","url":"https://api.github.com/users/ivantcholakov","html_url":"https://github.com/ivantcholakov","followers_url":"https://api.github.com/users/ivantcholakov/followers","following_url":"https://api.github.com/users/ivantcholakov/following{/other_user}","gists_url":"https://api.github.com/users/ivantcholakov/gists{/gist_id}","starred_url":"https://api.github.com/users/ivantcholakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivantcholakov/subscriptions","organizations_url":"https://api.github.com/users/ivantcholakov/orgs","repos_url":"https://api.github.com/users/ivantcholakov/repos","events_url":"https://api.github.com/users/ivantcholakov/events{/privacy}","received_events_url":"https://api.github.com/users/ivantcholakov/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T14:40:35Z","updated_at":"2015-01-21T14:40:35Z","body":"What about an additional form helper function that returns raw, unescaped values? Then in some cases we will be able to decide how to apply escaping manually. Here is a code drafting:\r\n\r\n```php\r\n\r\nif ( ! function_exists('form_value'))\r\n{\r\n\t/**\r\n\t * Form Value (Raw)\r\n\t *\r\n\t * Grabs a value from the POST array for the specified field so you can\r\n\t * re-populate fields in some special or cutting-edge cases. If Form Validation\r\n\t * is active it retrieves the info from the validation class.\r\n\t *\r\n\t * Important: The result is not HTML-escaped or HTML-attribute-escaped,\r\n\t * you should do it additionalyy according to the context of usage.\r\n\t *\r\n\t * @param\tstring\t$field\t\tField name\r\n\t * @param\tstring\t$default\tDefault value\r\n\t * @return\tstring\r\n\t */\r\n\tfunction form_value($field, $default = '')\r\n\t{\r\n\t\t$CI =& get_instance();\r\n\r\n\t\t$value = (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field))\r\n\t\t\t? $CI->form_validation->set_value($field, $default)\r\n\t\t\t: $CI->input->post($field, FALSE);\r\n\r\n\t\treturn $value === NULL ? $default : $value;\r\n\t}\r\n}\r\n```"}}