{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/172","repository_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards","labels_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/172/comments","events_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/172/events","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/172","id":33859289,"number":172,"title":"Enforce wp_slash() on functions that expect slashed data","user":{"login":"westonruter","id":134745,"avatar_url":"https://avatars2.githubusercontent.com/u/134745?v=4","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"labels":[{"id":38677308,"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/labels/Component:%20Extras","name":"Component: Extras","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":{"login":"JDGrimes","id":4005415,"avatar_url":"https://avatars3.githubusercontent.com/u/4005415?v=4","gravatar_id":"","url":"https://api.github.com/users/JDGrimes","html_url":"https://github.com/JDGrimes","followers_url":"https://api.github.com/users/JDGrimes/followers","following_url":"https://api.github.com/users/JDGrimes/following{/other_user}","gists_url":"https://api.github.com/users/JDGrimes/gists{/gist_id}","starred_url":"https://api.github.com/users/JDGrimes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JDGrimes/subscriptions","organizations_url":"https://api.github.com/users/JDGrimes/orgs","repos_url":"https://api.github.com/users/JDGrimes/repos","events_url":"https://api.github.com/users/JDGrimes/events{/privacy}","received_events_url":"https://api.github.com/users/JDGrimes/received_events","type":"User","site_admin":false},"assignees":[{"login":"JDGrimes","id":4005415,"avatar_url":"https://avatars3.githubusercontent.com/u/4005415?v=4","gravatar_id":"","url":"https://api.github.com/users/JDGrimes","html_url":"https://github.com/JDGrimes","followers_url":"https://api.github.com/users/JDGrimes/followers","following_url":"https://api.github.com/users/JDGrimes/following{/other_user}","gists_url":"https://api.github.com/users/JDGrimes/gists{/gist_id}","starred_url":"https://api.github.com/users/JDGrimes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JDGrimes/subscriptions","organizations_url":"https://api.github.com/users/JDGrimes/orgs","repos_url":"https://api.github.com/users/JDGrimes/repos","events_url":"https://api.github.com/users/JDGrimes/events{/privacy}","received_events_url":"https://api.github.com/users/JDGrimes/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/milestones/3","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/milestone/3","labels_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/milestones/3/labels","id":1061458,"number":3,"title":"Future Release","description":"Fixes and improvements that are considered accepted, but have no schedule for being added.","creator":{"login":"GaryJones","id":88371,"avatar_url":"https://avatars2.githubusercontent.com/u/88371?v=4","gravatar_id":"","url":"https://api.github.com/users/GaryJones","html_url":"https://github.com/GaryJones","followers_url":"https://api.github.com/users/GaryJones/followers","following_url":"https://api.github.com/users/GaryJones/following{/other_user}","gists_url":"https://api.github.com/users/GaryJones/gists{/gist_id}","starred_url":"https://api.github.com/users/GaryJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaryJones/subscriptions","organizations_url":"https://api.github.com/users/GaryJones/orgs","repos_url":"https://api.github.com/users/GaryJones/repos","events_url":"https://api.github.com/users/GaryJones/events{/privacy}","received_events_url":"https://api.github.com/users/GaryJones/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":1,"state":"open","created_at":"2015-04-10T06:38:57Z","updated_at":"2017-10-24T02:06:58Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2014-05-20T05:25:36Z","updated_at":"2017-11-01T23:11:37Z","closed_at":null,"author_association":"OWNER","body":"Since WordPress forces global input vars to get magic quoted, any access to them should pass through `wp_unslash()`. Likewise, any data data sent into a function that expects pre-slashed input should require an explicit `wp_slash()`.\r\n\r\nFor example, `wp_unslash()` and `wp_slash()` could be enforced in situations like this:\r\n\r\n``` php\r\n$title = sanitize_text_field( wp_unslash( $_POST['title'] ) );\r\n// ...\r\nwp_insert_post( wp_slash( array(\r\n    'post_title' => $title,\r\n) ) );\r\n```\r\n\r\nAs a `WordPress-Extra` rule, this will help enforce a discipline of unslashing, sanitizing, and slashing when slashing is required (e.g. in `wp_update_post()`, `update_post_meta()`, etc). It's easy to forget and for slashing to sneak in or to get stripped out, `\\\\o/` `o/`, yay.\r\n\r\nhttps://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/pull/395 implements the sniff for `wp_unslash()`\r\n"},"comment":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/comments/341270611","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/172#issuecomment-341270611","issue_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/172","id":341270611,"user":{"login":"westonruter","id":134745,"avatar_url":"https://avatars2.githubusercontent.com/u/134745?v=4","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"created_at":"2017-11-01T23:11:37Z","updated_at":"2017-11-01T23:11:37Z","author_association":"OWNER","body":"Yes, it\\'s a very important effort!"}}
{"actor":{"display_login":"westonruter"}}