{"action":"created","issue":{"url":"https://api.github.com/repos/wpmetabox/meta-box/issues/1271","repository_url":"https://api.github.com/repos/wpmetabox/meta-box","labels_url":"https://api.github.com/repos/wpmetabox/meta-box/issues/1271/labels{/name}","comments_url":"https://api.github.com/repos/wpmetabox/meta-box/issues/1271/comments","events_url":"https://api.github.com/repos/wpmetabox/meta-box/issues/1271/events","html_url":"https://github.com/wpmetabox/meta-box/issues/1271","id":355541227,"node_id":"MDU6SXNzdWUzNTU1NDEyMjc=","number":1271,"title":"Online generator does not escape single quotes properly","user":{"login":"rlafuente","id":159868,"node_id":"MDQ6VXNlcjE1OTg2OA==","avatar_url":"https://avatars2.githubusercontent.com/u/159868?v=4","gravatar_id":"","url":"https://api.github.com/users/rlafuente","html_url":"https://github.com/rlafuente","followers_url":"https://api.github.com/users/rlafuente/followers","following_url":"https://api.github.com/users/rlafuente/following{/other_user}","gists_url":"https://api.github.com/users/rlafuente/gists{/gist_id}","starred_url":"https://api.github.com/users/rlafuente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlafuente/subscriptions","organizations_url":"https://api.github.com/users/rlafuente/orgs","repos_url":"https://api.github.com/users/rlafuente/repos","events_url":"https://api.github.com/users/rlafuente/events{/privacy}","received_events_url":"https://api.github.com/users/rlafuente/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-30T11:22:56Z","updated_at":"2018-09-06T11:07:57Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nBEFORE POSTING YOUR ISSUE:\r\n- Try to add as much detail as possible. Be specific!\r\n- Please add the version of Meta Box and extensions you are using in the description.\r\n- Post the code that register meta boxes if needed for debug.\r\n- If you use a bundled version of Meta Box inside a theme or plugin, please ask the theme / plugin author to update that version first.\r\n- If you're requesting a new feature, explain why you'd like it to be added.\r\n-->\r\n\r\n## Issue Overview\r\n<!-- This is a brief overview of the issue --->\r\nThis happens in the Online Generator. If a field description contains single quotes, they are not escaped in the generated code, causing errors when pasting the code into functions.php.\r\n\r\n## Steps to Reproduce (for bugs)\r\n<!-- Provide a link to a live example, or an unambiguous set of steps to -->\r\n<!-- reproduce this bug. Include code to reproduce, if relevant -->\r\n1. Open the Online Generator\r\n2. Create a new field and input a Description which includes a single quote character (`'`)\r\n3. The generated code contains the character as is, messing up the remaining code.\r\n<!-- Provide what browser you are using and any other specifics to your setup -->\r\n\r\n## Expected Behavior\r\n<!-- If you're describing a bug, tell us what should happen -->\r\n<!-- If you're suggesting a change/improvement, tell us how it should work -->\r\nThe single quote character should be escaped in the generated code (`\\'`).\r\n\r\n## Current Behavior\r\n<!-- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!-- If suggesting a change/improvement, explain the difference from current behavior -->\r\nThe quote character is not escaped, which screws up the rest of the code (evident in the syntax highlighting). \r\n\r\n## Possible Solution\r\n<!-- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!-- or ideas how to implement the addition or change -->\r\nScan the input strings and escape problematic characters accordingly.\r\n"},"comment":{"url":"https://api.github.com/repos/wpmetabox/meta-box/issues/comments/419055322","html_url":"https://github.com/wpmetabox/meta-box/issues/1271#issuecomment-419055322","issue_url":"https://api.github.com/repos/wpmetabox/meta-box/issues/1271","id":419055322,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTA1NTMyMg==","user":{"login":"matchlessweb","id":43032055,"node_id":"MDQ6VXNlcjQzMDMyMDU1","avatar_url":"https://avatars1.githubusercontent.com/u/43032055?v=4","gravatar_id":"","url":"https://api.github.com/users/matchlessweb","html_url":"https://github.com/matchlessweb","followers_url":"https://api.github.com/users/matchlessweb/followers","following_url":"https://api.github.com/users/matchlessweb/following{/other_user}","gists_url":"https://api.github.com/users/matchlessweb/gists{/gist_id}","starred_url":"https://api.github.com/users/matchlessweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matchlessweb/subscriptions","organizations_url":"https://api.github.com/users/matchlessweb/orgs","repos_url":"https://api.github.com/users/matchlessweb/repos","events_url":"https://api.github.com/users/matchlessweb/events{/privacy}","received_events_url":"https://api.github.com/users/matchlessweb/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T11:07:57Z","updated_at":"2018-09-06T11:07:57Z","author_association":"NONE","body":"That instantly fixed it. When I ran the code through the linter it didn't indicate the specific issue with the syntax, so I felt lost. But that added space did seem to be the issue. I'm very grateful for your help! "}}
{"actor":{"display_login":"matchlessweb"}}