{"action":"opened","number":22,"pull_request":{"url":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/22","id":65697084,"html_url":"https://github.com/dastinnette/idea-box2.0/pull/22","diff_url":"https://github.com/dastinnette/idea-box2.0/pull/22.diff","patch_url":"https://github.com/dastinnette/idea-box2.0/pull/22.patch","issue_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/22","number":22,"state":"open","locked":false,"title":"Add title and body validations ","user":{"login":"dastinnette","id":10576647,"avatar_url":"https://avatars.githubusercontent.com/u/10576647?v=3","gravatar_id":"","url":"https://api.github.com/users/dastinnette","html_url":"https://github.com/dastinnette","followers_url":"https://api.github.com/users/dastinnette/followers","following_url":"https://api.github.com/users/dastinnette/following{/other_user}","gists_url":"https://api.github.com/users/dastinnette/gists{/gist_id}","starred_url":"https://api.github.com/users/dastinnette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dastinnette/subscriptions","organizations_url":"https://api.github.com/users/dastinnette/orgs","repos_url":"https://api.github.com/users/dastinnette/repos","events_url":"https://api.github.com/users/dastinnette/events{/privacy}","received_events_url":"https://api.github.com/users/dastinnette/received_events","type":"User","site_admin":false},"body":"What's this PR do?\r\n- Adds regex validations to title and body input fields within Idea model to allow for ONLY letters, numbers, and simple punctuation. This will prevent nefarious users from entering scripts as ideas and redirecting my app elsewhere, preventing anyone from using it. \r\n\r\nWhere should the reviewer start?\r\n- Idea.rb file, lines 2 and 3.\r\n\r\nHow should this be manually tested?\r\n- Visit [Ideabox](http://ideabox2-0.herokuapp.com/) and try to enter a <script> or #hashtag. The idea will not post due to only allowing letters, numbers, spaces, and ?,! punctuation.\r\n\r\nAny background context you want to provide?\r\n- My app was brought to its knees by an XSS attack. A fun lesson learned in improving the security of my app.\r\n\r\nScreenshots (if appropriate)\r\n[Idea model](http://i.imgur.com/Q2031wO.png?1)\r\n\r\nWhat gif best describes this PR or how it makes you feel?\r\nhttp://i.imgur.com/va8SE77.gifv","created_at":"2016-04-07T20:48:15Z","updated_at":"2016-04-07T20:48:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/22/commits","review_comments_url":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/22/comments","review_comment_url":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/22/comments","statuses_url":"https://api.github.com/repos/dastinnette/idea-box2.0/statuses/8db3cf052f3a390bc28ad590ae236ac89ff30b58","head":{"label":"dastinnette:21_field_validations","ref":"21_field_validations","sha":"8db3cf052f3a390bc28ad590ae236ac89ff30b58","user":{"login":"dastinnette","id":10576647,"avatar_url":"https://avatars.githubusercontent.com/u/10576647?v=3","gravatar_id":"","url":"https://api.github.com/users/dastinnette","html_url":"https://github.com/dastinnette","followers_url":"https://api.github.com/users/dastinnette/followers","following_url":"https://api.github.com/users/dastinnette/following{/other_user}","gists_url":"https://api.github.com/users/dastinnette/gists{/gist_id}","starred_url":"https://api.github.com/users/dastinnette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dastinnette/subscriptions","organizations_url":"https://api.github.com/users/dastinnette/orgs","repos_url":"https://api.github.com/users/dastinnette/repos","events_url":"https://api.github.com/users/dastinnette/events{/privacy}","received_events_url":"https://api.github.com/users/dastinnette/received_events","type":"User","site_admin":false},"repo":{"id":54419123,"name":"idea-box2.0","full_name":"dastinnette/idea-box2.0","owner":{"login":"dastinnette","id":10576647,"avatar_url":"https://avatars.githubusercontent.com/u/10576647?v=3","gravatar_id":"","url":"https://api.github.com/users/dastinnette","html_url":"https://github.com/dastinnette","followers_url":"https://api.github.com/users/dastinnette/followers","following_url":"https://api.github.com/users/dastinnette/following{/other_user}","gists_url":"https://api.github.com/users/dastinnette/gists{/gist_id}","starred_url":"https://api.github.com/users/dastinnette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dastinnette/subscriptions","organizations_url":"https://api.github.com/users/dastinnette/orgs","repos_url":"https://api.github.com/users/dastinnette/repos","events_url":"https://api.github.com/users/dastinnette/events{/privacy}","received_events_url":"https://api.github.com/users/dastinnette/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dastinnette/idea-box2.0","description":"","fork":false,"url":"https://api.github.com/repos/dastinnette/idea-box2.0","forks_url":"https://api.github.com/repos/dastinnette/idea-box2.0/forks","keys_url":"https://api.github.com/repos/dastinnette/idea-box2.0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dastinnette/idea-box2.0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dastinnette/idea-box2.0/teams","hooks_url":"https://api.github.com/repos/dastinnette/idea-box2.0/hooks","issue_events_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/events{/number}","events_url":"https://api.github.com/repos/dastinnette/idea-box2.0/events","assignees_url":"https://api.github.com/repos/dastinnette/idea-box2.0/assignees{/user}","branches_url":"https://api.github.com/repos/dastinnette/idea-box2.0/branches{/branch}","tags_url":"https://api.github.com/repos/dastinnette/idea-box2.0/tags","blobs_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/refs{/sha}","trees_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dastinnette/idea-box2.0/statuses/{sha}","languages_url":"https://api.github.com/repos/dastinnette/idea-box2.0/languages","stargazers_url":"https://api.github.com/repos/dastinnette/idea-box2.0/stargazers","contributors_url":"https://api.github.com/repos/dastinnette/idea-box2.0/contributors","subscribers_url":"https://api.github.com/repos/dastinnette/idea-box2.0/subscribers","subscription_url":"https://api.github.com/repos/dastinnette/idea-box2.0/subscription","commits_url":"https://api.github.com/repos/dastinnette/idea-box2.0/commits{/sha}","git_commits_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/commits{/sha}","comments_url":"https://api.github.com/repos/dastinnette/idea-box2.0/comments{/number}","issue_comment_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/comments{/number}","contents_url":"https://api.github.com/repos/dastinnette/idea-box2.0/contents/{+path}","compare_url":"https://api.github.com/repos/dastinnette/idea-box2.0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dastinnette/idea-box2.0/merges","archive_url":"https://api.github.com/repos/dastinnette/idea-box2.0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dastinnette/idea-box2.0/downloads","issues_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues{/number}","pulls_url":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls{/number}","milestones_url":"https://api.github.com/repos/dastinnette/idea-box2.0/milestones{/number}","notifications_url":"https://api.github.com/repos/dastinnette/idea-box2.0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dastinnette/idea-box2.0/labels{/name}","releases_url":"https://api.github.com/repos/dastinnette/idea-box2.0/releases{/id}","deployments_url":"https://api.github.com/repos/dastinnette/idea-box2.0/deployments","created_at":"2016-03-21T20:07:59Z","updated_at":"2016-03-21T20:13:17Z","pushed_at":"2016-04-07T20:48:15Z","git_url":"git://github.com/dastinnette/idea-box2.0.git","ssh_url":"git@github.com:dastinnette/idea-box2.0.git","clone_url":"https://github.com/dastinnette/idea-box2.0.git","svn_url":"https://github.com/dastinnette/idea-box2.0","homepage":null,"size":57,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"dastinnette:master","ref":"master","sha":"20964685002c0963d0681c7e8ce664497b29ab54","user":{"login":"dastinnette","id":10576647,"avatar_url":"https://avatars.githubusercontent.com/u/10576647?v=3","gravatar_id":"","url":"https://api.github.com/users/dastinnette","html_url":"https://github.com/dastinnette","followers_url":"https://api.github.com/users/dastinnette/followers","following_url":"https://api.github.com/users/dastinnette/following{/other_user}","gists_url":"https://api.github.com/users/dastinnette/gists{/gist_id}","starred_url":"https://api.github.com/users/dastinnette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dastinnette/subscriptions","organizations_url":"https://api.github.com/users/dastinnette/orgs","repos_url":"https://api.github.com/users/dastinnette/repos","events_url":"https://api.github.com/users/dastinnette/events{/privacy}","received_events_url":"https://api.github.com/users/dastinnette/received_events","type":"User","site_admin":false},"repo":{"id":54419123,"name":"idea-box2.0","full_name":"dastinnette/idea-box2.0","owner":{"login":"dastinnette","id":10576647,"avatar_url":"https://avatars.githubusercontent.com/u/10576647?v=3","gravatar_id":"","url":"https://api.github.com/users/dastinnette","html_url":"https://github.com/dastinnette","followers_url":"https://api.github.com/users/dastinnette/followers","following_url":"https://api.github.com/users/dastinnette/following{/other_user}","gists_url":"https://api.github.com/users/dastinnette/gists{/gist_id}","starred_url":"https://api.github.com/users/dastinnette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dastinnette/subscriptions","organizations_url":"https://api.github.com/users/dastinnette/orgs","repos_url":"https://api.github.com/users/dastinnette/repos","events_url":"https://api.github.com/users/dastinnette/events{/privacy}","received_events_url":"https://api.github.com/users/dastinnette/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dastinnette/idea-box2.0","description":"","fork":false,"url":"https://api.github.com/repos/dastinnette/idea-box2.0","forks_url":"https://api.github.com/repos/dastinnette/idea-box2.0/forks","keys_url":"https://api.github.com/repos/dastinnette/idea-box2.0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dastinnette/idea-box2.0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dastinnette/idea-box2.0/teams","hooks_url":"https://api.github.com/repos/dastinnette/idea-box2.0/hooks","issue_events_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/events{/number}","events_url":"https://api.github.com/repos/dastinnette/idea-box2.0/events","assignees_url":"https://api.github.com/repos/dastinnette/idea-box2.0/assignees{/user}","branches_url":"https://api.github.com/repos/dastinnette/idea-box2.0/branches{/branch}","tags_url":"https://api.github.com/repos/dastinnette/idea-box2.0/tags","blobs_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/refs{/sha}","trees_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dastinnette/idea-box2.0/statuses/{sha}","languages_url":"https://api.github.com/repos/dastinnette/idea-box2.0/languages","stargazers_url":"https://api.github.com/repos/dastinnette/idea-box2.0/stargazers","contributors_url":"https://api.github.com/repos/dastinnette/idea-box2.0/contributors","subscribers_url":"https://api.github.com/repos/dastinnette/idea-box2.0/subscribers","subscription_url":"https://api.github.com/repos/dastinnette/idea-box2.0/subscription","commits_url":"https://api.github.com/repos/dastinnette/idea-box2.0/commits{/sha}","git_commits_url":"https://api.github.com/repos/dastinnette/idea-box2.0/git/commits{/sha}","comments_url":"https://api.github.com/repos/dastinnette/idea-box2.0/comments{/number}","issue_comment_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/comments{/number}","contents_url":"https://api.github.com/repos/dastinnette/idea-box2.0/contents/{+path}","compare_url":"https://api.github.com/repos/dastinnette/idea-box2.0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dastinnette/idea-box2.0/merges","archive_url":"https://api.github.com/repos/dastinnette/idea-box2.0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dastinnette/idea-box2.0/downloads","issues_url":"https://api.github.com/repos/dastinnette/idea-box2.0/issues{/number}","pulls_url":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls{/number}","milestones_url":"https://api.github.com/repos/dastinnette/idea-box2.0/milestones{/number}","notifications_url":"https://api.github.com/repos/dastinnette/idea-box2.0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dastinnette/idea-box2.0/labels{/name}","releases_url":"https://api.github.com/repos/dastinnette/idea-box2.0/releases{/id}","deployments_url":"https://api.github.com/repos/dastinnette/idea-box2.0/deployments","created_at":"2016-03-21T20:07:59Z","updated_at":"2016-03-21T20:13:17Z","pushed_at":"2016-04-07T20:48:15Z","git_url":"git://github.com/dastinnette/idea-box2.0.git","ssh_url":"git@github.com:dastinnette/idea-box2.0.git","clone_url":"https://github.com/dastinnette/idea-box2.0.git","svn_url":"https://github.com/dastinnette/idea-box2.0","homepage":null,"size":57,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/22"},"html":{"href":"https://github.com/dastinnette/idea-box2.0/pull/22"},"issue":{"href":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/22"},"comments":{"href":"https://api.github.com/repos/dastinnette/idea-box2.0/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dastinnette/idea-box2.0/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/dastinnette/idea-box2.0/statuses/8db3cf052f3a390bc28ad590ae236ac89ff30b58"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":2,"deletions":0,"changed_files":1}}