{"action":"created","issue":{"url":"https://api.github.com/repos/YahnisElsts/wp-update-server/issues/66","repository_url":"https://api.github.com/repos/YahnisElsts/wp-update-server","labels_url":"https://api.github.com/repos/YahnisElsts/wp-update-server/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/YahnisElsts/wp-update-server/issues/66/comments","events_url":"https://api.github.com/repos/YahnisElsts/wp-update-server/issues/66/events","html_url":"https://github.com/YahnisElsts/wp-update-server/pull/66","id":354056462,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwOTI5MDc2","number":66,"title":"Escape log data before writing to file","user":{"login":"dangoodman","id":345718,"node_id":"MDQ6VXNlcjM0NTcxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/345718?v=4","gravatar_id":"","url":"https://api.github.com/users/dangoodman","html_url":"https://github.com/dangoodman","followers_url":"https://api.github.com/users/dangoodman/followers","following_url":"https://api.github.com/users/dangoodman/following{/other_user}","gists_url":"https://api.github.com/users/dangoodman/gists{/gist_id}","starred_url":"https://api.github.com/users/dangoodman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangoodman/subscriptions","organizations_url":"https://api.github.com/users/dangoodman/orgs","repos_url":"https://api.github.com/users/dangoodman/repos","events_url":"https://api.github.com/users/dangoodman/events{/privacy}","received_events_url":"https://api.github.com/users/dangoodman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-26T01:32:10Z","updated_at":"2018-08-30T11:19:21Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/YahnisElsts/wp-update-server/pulls/66","html_url":"https://github.com/YahnisElsts/wp-update-server/pull/66","diff_url":"https://github.com/YahnisElsts/wp-update-server/pull/66.diff","patch_url":"https://github.com/YahnisElsts/wp-update-server/pull/66.patch"},"body":"This escapes special chars in logged data to avoid breaking the log file with something like `?installed_version=%0D%0A%09+` in url. The purpose of the added method `escapeLogInfo()` is similar to `mysql[_real]_escape_string()`, `htmlspecialchars()`, `escapeshellarg()`, etc."},"comment":{"url":"https://api.github.com/repos/YahnisElsts/wp-update-server/issues/comments/417284113","html_url":"https://github.com/YahnisElsts/wp-update-server/pull/66#issuecomment-417284113","issue_url":"https://api.github.com/repos/YahnisElsts/wp-update-server/issues/66","id":417284113,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzI4NDExMw==","user":{"login":"dangoodman","id":345718,"node_id":"MDQ6VXNlcjM0NTcxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/345718?v=4","gravatar_id":"","url":"https://api.github.com/users/dangoodman","html_url":"https://github.com/dangoodman","followers_url":"https://api.github.com/users/dangoodman/followers","following_url":"https://api.github.com/users/dangoodman/following{/other_user}","gists_url":"https://api.github.com/users/dangoodman/gists{/gist_id}","starred_url":"https://api.github.com/users/dangoodman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangoodman/subscriptions","organizations_url":"https://api.github.com/users/dangoodman/orgs","repos_url":"https://api.github.com/users/dangoodman/repos","events_url":"https://api.github.com/users/dangoodman/events{/privacy}","received_events_url":"https://api.github.com/users/dangoodman/received_events","type":"User","site_admin":false},"created_at":"2018-08-30T11:19:21Z","updated_at":"2018-08-30T11:19:21Z","author_association":"NONE","body":"I was looking to the [:print:] character class but then skipped it since it works differently on windows and linux. Namely, on windows the `Tab (\\t)` character is considered as printable, while on linux it's non-printable.\r\n\r\nThe [:graph:] class doesn't seem to have that issue as per my tests. Looks good to me.\r\n\r\nAs of the unicode-related stuff, to be honest my brain isn't big enough to keep all the details about it required to handle it correctly and safely. All those invalid sequences, 5 and 6 byte length chars, normalization forms, etc. So it's ok to me if it's ok to you ;)\r\n\r\nAgree about re-adding padding. My intention was to keep escaping the last step in the chain to make sure no breaking chars pass by. If we add a protected method, say, `formatLogIngo()`, supposed to pad fields or decorate them in other way, somebody will forget about the requirement to produce output-safe values."}}
{"actor":{"display_login":"dangoodman"}}