{"action":"created","comment":{"url":"https://api.github.com/repos/thori0908/training/pulls/comments/27269447","id":27269447,"diff_hunk":"@@ -0,0 +1,145 @@\n+<?php \n+class User {\n+    private $fullname = \"\";\n+    private $lastname = \"\";\n+    private $firstname = \"\";\n+    private $gender = \"\";\n+    private $postcodeFirst = \"\";\n+    private $postcodeSecond = \"\";\n+    private $prefecture = \"\";\n+    private $mailaddress = \"\";\n+    private $other = \"\";\n+    private $opinion = \"\";\n+    private $hobbyMusic = \"\";\n+    private $hobbyMovie = \"\";\n+    private $hobbyOther = \"\";\n+    private $hobbyOtherText = \"\";\n+\n+    public function __construct($post) {\n+        if (!empty($post[\"lastname\"])) {\n+            $this->lastname       = $this->escapeFormValue($post[\"lastname\"]);\n+        }\n+\n+        if (!empty($post[\"firstname\"])) {\n+            $this->firstname      = $this->escapeFormValue($post[\"firstname\"]);\n+        }\n+\n+        $this->fullname = $this->fullname($this->lastname, $this->firstname);\n+\n+        if (!empty($post[\"gender\"])) {\n+            $this->gender         = $this->escapeFormValue($post[\"gender\"]);\n+        }\n+        \n+        if (!empty($post[\"postcodeFirst\"])) {\n+            $this->postcodeFirst  = $this->escapeFormValue($post[\"postcodeFirst\"]);\n+        }\n+\n+        if (!empty($post[\"postcodeSecond\"])) {\n+            $this->postcodeSecond = $this->escapeFormValue($post[\"postcodeSecond\"]);\n+        }\n+        \n+        if (!empty($post[\"prefecture\"])) {\n+            $this->prefecture     = $this->escapeFormValue($post[\"prefecture\"]);\n+        }\n+        \n+        if (!empty($post[\"mailaddress\"])) {\n+            $this->mailaddress    = $this->escapeFormValue($post[\"mailaddress\"]);\n+        }\n+        \n+        if (!empty($post[\"other\"])) {\n+            $this->other          = $this->escapeFormValue($post[\"other\"]);\n+        }\n+        if (!empty($post[\"opinion\"])) {\n+            $this->opinion        = $this->escapeFormValue($post[\"opinion\"]);\n+        }\n+        \n+        if (!empty($post[\"hobbyMusic\"])) {\n+            $this->hobbyMusic     = $this->escapeFormValue($post[\"hobbyMusic\"]);\n+        }\n+        \n+        if (!empty($post[\"hobbyMovie\"])) {\n+            $this->hobbyMovie     = $this->escapeFormValue($post[\"hobbyMovie\"]);\n+        }\n+        \n+        if (!empty($post[\"hobbyOther\"])) {\n+            $this->hobbyOther     = $this->escapeFormValue($post[\"hobbyOther\"]);\n+        }\n+        \n+        if (!empty($post[\"hobbyOtherText\"])) {\n+            $this->hobbyOtherText = $this->escapeFormValue($post[\"hobbyOtherText\"]);\n+        }\n+    }\n+\n+    public function escapeFormValue($formValue) {\n+        $modifiedValue;\n+        if (empty($formValue)) { \n+            $modifiedValue = \"\";\n+        } else { \n+            $formValue = mb_ereg_replace('^[\\s　]*(.*?)[\\s　]*$', '\\1', $formValue);//全角空白置換 \n+            $modifiedValue = trim($formValue, \" \");//空白処理 \n+            $modifiedValue = htmlspecialchars($formValue);  //htmlエスケープ処理\n+        }","path":"User.php","position":81,"original_position":81,"commit_id":"b24dae1ee3bc7f59052be14a004f2d8174f7600f","original_commit_id":"b24dae1ee3bc7f59052be14a004f2d8174f7600f","user":{"login":"fr-itaya","id":7111591,"avatar_url":"https://avatars.githubusercontent.com/u/7111591?v=3","gravatar_id":"","url":"https://api.github.com/users/fr-itaya","html_url":"https://github.com/fr-itaya","followers_url":"https://api.github.com/users/fr-itaya/followers","following_url":"https://api.github.com/users/fr-itaya/following{/other_user}","gists_url":"https://api.github.com/users/fr-itaya/gists{/gist_id}","starred_url":"https://api.github.com/users/fr-itaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fr-itaya/subscriptions","organizations_url":"https://api.github.com/users/fr-itaya/orgs","repos_url":"https://api.github.com/users/fr-itaya/repos","events_url":"https://api.github.com/users/fr-itaya/events{/privacy}","received_events_url":"https://api.github.com/users/fr-itaya/received_events","type":"User","site_admin":false},"body":"このようにまとめられると思いますー\r\n```php\r\n$modifiedValue = \"\";\r\nif (!empty($formValue)) {\r\n    $formValue = mb_ereg_replace('^[\\s　]*(.*?)[\\s　]*$', '\\1', $formValue);//全角空白置換 \r\n    $modifiedValue = trim($formValue, \" \");//空白処理 \r\n    $modifiedValue = htmlspecialchars($formValue);  //htmlエスケープ処理\r\n}\r\n```","created_at":"2015-03-27T00:41:07Z","updated_at":"2015-03-27T00:41:07Z","html_url":"https://github.com/thori0908/training/pull/54#discussion_r27269447","pull_request_url":"https://api.github.com/repos/thori0908/training/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/thori0908/training/pulls/comments/27269447"},"html":{"href":"https://github.com/thori0908/training/pull/54#discussion_r27269447"},"pull_request":{"href":"https://api.github.com/repos/thori0908/training/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/thori0908/training/pulls/54","id":31594421,"html_url":"https://github.com/thori0908/training/pull/54","diff_url":"https://github.com/thori0908/training/pull/54.diff","patch_url":"https://github.com/thori0908/training/pull/54.patch","issue_url":"https://api.github.com/repos/thori0908/training/issues/54","number":54,"state":"open","locked":false,"title":"Feature/issue30","user":{"login":"thori0908","id":7833726,"avatar_url":"https://avatars.githubusercontent.com/u/7833726?v=3","gravatar_id":"","url":"https://api.github.com/users/thori0908","html_url":"https://github.com/thori0908","followers_url":"https://api.github.com/users/thori0908/followers","following_url":"https://api.github.com/users/thori0908/following{/other_user}","gists_url":"https://api.github.com/users/thori0908/gists{/gist_id}","starred_url":"https://api.github.com/users/thori0908/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thori0908/subscriptions","organizations_url":"https://api.github.com/users/thori0908/orgs","repos_url":"https://api.github.com/users/thori0908/repos","events_url":"https://api.github.com/users/thori0908/events{/privacy}","received_events_url":"https://api.github.com/users/thori0908/received_events","type":"User","site_admin":false},"body":"- [X] phpタグとhtmlタグにファイルを分割\r\n#30 ","created_at":"2015-03-20T08:00:54Z","updated_at":"2015-03-27T00:41:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17bb2a29e2bca13df3517059ef5a73ec89cd6426","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thori0908/training/pulls/54/commits","review_comments_url":"https://api.github.com/repos/thori0908/training/pulls/54/comments","review_comment_url":"https://api.github.com/repos/thori0908/training/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thori0908/training/issues/54/comments","statuses_url":"https://api.github.com/repos/thori0908/training/statuses/b24dae1ee3bc7f59052be14a004f2d8174f7600f","head":{"label":"thori0908:feature/issue30","ref":"feature/issue30","sha":"b24dae1ee3bc7f59052be14a004f2d8174f7600f","user":{"login":"thori0908","id":7833726,"avatar_url":"https://avatars.githubusercontent.com/u/7833726?v=3","gravatar_id":"","url":"https://api.github.com/users/thori0908","html_url":"https://github.com/thori0908","followers_url":"https://api.github.com/users/thori0908/followers","following_url":"https://api.github.com/users/thori0908/following{/other_user}","gists_url":"https://api.github.com/users/thori0908/gists{/gist_id}","starred_url":"https://api.github.com/users/thori0908/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thori0908/subscriptions","organizations_url":"https://api.github.com/users/thori0908/orgs","repos_url":"https://api.github.com/users/thori0908/repos","events_url":"https://api.github.com/users/thori0908/events{/privacy}","received_events_url":"https://api.github.com/users/thori0908/received_events","type":"User","site_admin":false},"repo":{"id":22746424,"name":"training","full_name":"thori0908/training","owner":{"login":"thori0908","id":7833726,"avatar_url":"https://avatars.githubusercontent.com/u/7833726?v=3","gravatar_id":"","url":"https://api.github.com/users/thori0908","html_url":"https://github.com/thori0908","followers_url":"https://api.github.com/users/thori0908/followers","following_url":"https://api.github.com/users/thori0908/following{/other_user}","gists_url":"https://api.github.com/users/thori0908/gists{/gist_id}","starred_url":"https://api.github.com/users/thori0908/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thori0908/subscriptions","organizations_url":"https://api.github.com/users/thori0908/orgs","repos_url":"https://api.github.com/users/thori0908/repos","events_url":"https://api.github.com/users/thori0908/events{/privacy}","received_events_url":"https://api.github.com/users/thori0908/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thori0908/training","description":"repository for training","fork":false,"url":"https://api.github.com/repos/thori0908/training","forks_url":"https://api.github.com/repos/thori0908/training/forks","keys_url":"https://api.github.com/repos/thori0908/training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thori0908/training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thori0908/training/teams","hooks_url":"https://api.github.com/repos/thori0908/training/hooks","issue_events_url":"https://api.github.com/repos/thori0908/training/issues/events{/number}","events_url":"https://api.github.com/repos/thori0908/training/events","assignees_url":"https://api.github.com/repos/thori0908/training/assignees{/user}","branches_url":"https://api.github.com/repos/thori0908/training/branches{/branch}","tags_url":"https://api.github.com/repos/thori0908/training/tags","blobs_url":"https://api.github.com/repos/thori0908/training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thori0908/training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thori0908/training/git/refs{/sha}","trees_url":"https://api.github.com/repos/thori0908/training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thori0908/training/statuses/{sha}","languages_url":"https://api.github.com/repos/thori0908/training/languages","stargazers_url":"https://api.github.com/repos/thori0908/training/stargazers","contributors_url":"https://api.github.com/repos/thori0908/training/contributors","subscribers_url":"https://api.github.com/repos/thori0908/training/subscribers","subscription_url":"https://api.github.com/repos/thori0908/training/subscription","commits_url":"https://api.github.com/repos/thori0908/training/commits{/sha}","git_commits_url":"https://api.github.com/repos/thori0908/training/git/commits{/sha}","comments_url":"https://api.github.com/repos/thori0908/training/comments{/number}","issue_comment_url":"https://api.github.com/repos/thori0908/training/issues/comments{/number}","contents_url":"https://api.github.com/repos/thori0908/training/contents/{+path}","compare_url":"https://api.github.com/repos/thori0908/training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thori0908/training/merges","archive_url":"https://api.github.com/repos/thori0908/training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thori0908/training/downloads","issues_url":"https://api.github.com/repos/thori0908/training/issues{/number}","pulls_url":"https://api.github.com/repos/thori0908/training/pulls{/number}","milestones_url":"https://api.github.com/repos/thori0908/training/milestones{/number}","notifications_url":"https://api.github.com/repos/thori0908/training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thori0908/training/labels{/name}","releases_url":"https://api.github.com/repos/thori0908/training/releases{/id}","created_at":"2014-08-08T04:53:42Z","updated_at":"2014-12-12T10:30:09Z","pushed_at":"2015-03-26T12:56:28Z","git_url":"git://github.com/thori0908/training.git","ssh_url":"git@github.com:thori0908/training.git","clone_url":"https://github.com/thori0908/training.git","svn_url":"https://github.com/thori0908/training","homepage":null,"size":424,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":0,"default_branch":"master"}},"base":{"label":"thori0908:master","ref":"master","sha":"76c8afaf0f3d6034857be1c62ed5f5d6f7b13294","user":{"login":"thori0908","id":7833726,"avatar_url":"https://avatars.githubusercontent.com/u/7833726?v=3","gravatar_id":"","url":"https://api.github.com/users/thori0908","html_url":"https://github.com/thori0908","followers_url":"https://api.github.com/users/thori0908/followers","following_url":"https://api.github.com/users/thori0908/following{/other_user}","gists_url":"https://api.github.com/users/thori0908/gists{/gist_id}","starred_url":"https://api.github.com/users/thori0908/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thori0908/subscriptions","organizations_url":"https://api.github.com/users/thori0908/orgs","repos_url":"https://api.github.com/users/thori0908/repos","events_url":"https://api.github.com/users/thori0908/events{/privacy}","received_events_url":"https://api.github.com/users/thori0908/received_events","type":"User","site_admin":false},"repo":{"id":22746424,"name":"training","full_name":"thori0908/training","owner":{"login":"thori0908","id":7833726,"avatar_url":"https://avatars.githubusercontent.com/u/7833726?v=3","gravatar_id":"","url":"https://api.github.com/users/thori0908","html_url":"https://github.com/thori0908","followers_url":"https://api.github.com/users/thori0908/followers","following_url":"https://api.github.com/users/thori0908/following{/other_user}","gists_url":"https://api.github.com/users/thori0908/gists{/gist_id}","starred_url":"https://api.github.com/users/thori0908/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thori0908/subscriptions","organizations_url":"https://api.github.com/users/thori0908/orgs","repos_url":"https://api.github.com/users/thori0908/repos","events_url":"https://api.github.com/users/thori0908/events{/privacy}","received_events_url":"https://api.github.com/users/thori0908/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thori0908/training","description":"repository for training","fork":false,"url":"https://api.github.com/repos/thori0908/training","forks_url":"https://api.github.com/repos/thori0908/training/forks","keys_url":"https://api.github.com/repos/thori0908/training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thori0908/training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thori0908/training/teams","hooks_url":"https://api.github.com/repos/thori0908/training/hooks","issue_events_url":"https://api.github.com/repos/thori0908/training/issues/events{/number}","events_url":"https://api.github.com/repos/thori0908/training/events","assignees_url":"https://api.github.com/repos/thori0908/training/assignees{/user}","branches_url":"https://api.github.com/repos/thori0908/training/branches{/branch}","tags_url":"https://api.github.com/repos/thori0908/training/tags","blobs_url":"https://api.github.com/repos/thori0908/training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thori0908/training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thori0908/training/git/refs{/sha}","trees_url":"https://api.github.com/repos/thori0908/training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thori0908/training/statuses/{sha}","languages_url":"https://api.github.com/repos/thori0908/training/languages","stargazers_url":"https://api.github.com/repos/thori0908/training/stargazers","contributors_url":"https://api.github.com/repos/thori0908/training/contributors","subscribers_url":"https://api.github.com/repos/thori0908/training/subscribers","subscription_url":"https://api.github.com/repos/thori0908/training/subscription","commits_url":"https://api.github.com/repos/thori0908/training/commits{/sha}","git_commits_url":"https://api.github.com/repos/thori0908/training/git/commits{/sha}","comments_url":"https://api.github.com/repos/thori0908/training/comments{/number}","issue_comment_url":"https://api.github.com/repos/thori0908/training/issues/comments{/number}","contents_url":"https://api.github.com/repos/thori0908/training/contents/{+path}","compare_url":"https://api.github.com/repos/thori0908/training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thori0908/training/merges","archive_url":"https://api.github.com/repos/thori0908/training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thori0908/training/downloads","issues_url":"https://api.github.com/repos/thori0908/training/issues{/number}","pulls_url":"https://api.github.com/repos/thori0908/training/pulls{/number}","milestones_url":"https://api.github.com/repos/thori0908/training/milestones{/number}","notifications_url":"https://api.github.com/repos/thori0908/training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thori0908/training/labels{/name}","releases_url":"https://api.github.com/repos/thori0908/training/releases{/id}","created_at":"2014-08-08T04:53:42Z","updated_at":"2014-12-12T10:30:09Z","pushed_at":"2015-03-26T12:56:28Z","git_url":"git://github.com/thori0908/training.git","ssh_url":"git@github.com:thori0908/training.git","clone_url":"https://github.com/thori0908/training.git","svn_url":"https://github.com/thori0908/training","homepage":null,"size":424,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thori0908/training/pulls/54"},"html":{"href":"https://github.com/thori0908/training/pull/54"},"issue":{"href":"https://api.github.com/repos/thori0908/training/issues/54"},"comments":{"href":"https://api.github.com/repos/thori0908/training/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/thori0908/training/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/thori0908/training/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thori0908/training/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/thori0908/training/statuses/b24dae1ee3bc7f59052be14a004f2d8174f7600f"}}}}