{"action":"reopened","issue":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/281","labels_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/281/comments","events_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/281/events","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/281","id":51494350,"number":281,"title":"XSS escaping and the ternary operator","user":{"login":"JDGrimes","id":4005415,"avatar_url":"https://avatars.githubusercontent.com/u/4005415?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-12-09T22:57:15Z","updated_at":"2015-01-02T18:50:53Z","closed_at":null,"body":"I got this error:\r\n\r\n> 211 | ERROR | Expected next thing to be a escaping function, not '('\r\n\r\nThe offending line:\r\n```\r\nvalue=\"<?php echo ( $args['placeholders'] && 'hidden' !== $field['type'] ) ? '<% if ( typeof ' . sanitize_key( $name ) . ' !== \"undefined\" ) { print( ' . sanitize_key( $name ) . ' ); } %>' : esc_attr( $value ); ?>\"\r\n```\r\nWhile on the one hand this is messy, I chose to do it anyway because it was the best way to do the escaping immediately before output.\r\n\r\nWhen dealing with the ternary operator, I think we need to ignore everything before the `?`."}}