{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-mail/pulls/comments/31327109","id":31327109,"diff_hunk":"@@ -273,10 +273,7 @@ public function data($data)\n         $this->_send('DATA');\n         $this->_expect(354, 120); // Timeout set for 2 minutes as per RFC 2821 4.5.3.2\n \n-        // Ensure newlines are CRLF (\\r\\n)\n-        $data = str_replace(\"\\n\", \"\\r\\n\", str_replace(\"\\r\", '', $data));\n-\n-        foreach (explode(self::EOL, $data) as $line) {\n+        foreach (preg_split('/\\R/', $data) as $line) {","path":"src/Protocol/Smtp.php","position":8,"original_position":8,"commit_id":"a23c7228dda1a349eff5c771e3016a2bd7fb2904","original_commit_id":"a23c7228dda1a349eff5c771e3016a2bd7fb2904","user":{"login":"echampet","id":2317161,"avatar_url":"https://avatars.githubusercontent.com/u/2317161?v=3","gravatar_id":"","url":"https://api.github.com/users/echampet","html_url":"https://github.com/echampet","followers_url":"https://api.github.com/users/echampet/followers","following_url":"https://api.github.com/users/echampet/following{/other_user}","gists_url":"https://api.github.com/users/echampet/gists{/gist_id}","starred_url":"https://api.github.com/users/echampet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echampet/subscriptions","organizations_url":"https://api.github.com/users/echampet/orgs","repos_url":"https://api.github.com/users/echampet/repos","events_url":"https://api.github.com/users/echampet/events{/privacy}","received_events_url":"https://api.github.com/users/echampet/received_events","type":"User","site_admin":false},"body":"in this case no this is not,\r\nwith the 2 str_replace\r\n\\r => '' (0 eol)\r\n\\r\\n => \\r\\n (1 eol)\r\n\\n => \\r\\n (1 eol)\r\nwith my preg_split all are 1 eol,\r\nbut if my preg_split is unsafe, i'm pretty sure the str_replace is also\r\n\r\nPlease prove with an exemple that it's insecure :)","created_at":"2015-05-29T14:08:33Z","updated_at":"2015-05-29T14:08:33Z","html_url":"https://github.com/zendframework/zend-mail/pull/1#discussion_r31327109","pull_request_url":"https://api.github.com/repos/zendframework/zend-mail/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-mail/pulls/comments/31327109"},"html":{"href":"https://github.com/zendframework/zend-mail/pull/1#discussion_r31327109"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-mail/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-mail/pulls/1","id":36399670,"html_url":"https://github.com/zendframework/zend-mail/pull/1","diff_url":"https://github.com/zendframework/zend-mail/pull/1.diff","patch_url":"https://github.com/zendframework/zend-mail/pull/1.patch","issue_url":"https://api.github.com/repos/zendframework/zend-mail/issues/1","number":1,"state":"open","locked":false,"title":"Headers: rework fromString() function","user":{"login":"echampet","id":2317161,"avatar_url":"https://avatars.githubusercontent.com/u/2317161?v=3","gravatar_id":"","url":"https://api.github.com/users/echampet","html_url":"https://github.com/echampet","followers_url":"https://api.github.com/users/echampet/followers","following_url":"https://api.github.com/users/echampet/following{/other_user}","gists_url":"https://api.github.com/users/echampet/gists{/gist_id}","starred_url":"https://api.github.com/users/echampet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echampet/subscriptions","organizations_url":"https://api.github.com/users/echampet/orgs","repos_url":"https://api.github.com/users/echampet/repos","events_url":"https://api.github.com/users/echampet/events{/privacy}","received_events_url":"https://api.github.com/users/echampet/received_events","type":"User","site_admin":false},"body":"use preg_split instead of explode (don't depend on the caller knowing eol)\r\ndeprecate $EOL parameter\r\nuse more readable regexp to match header name\r\nfix continuation regexp (space or tab followed by something that is not space or tab)\r\n.*$ in a regexp is useless\r\n\r\nSigned-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>","created_at":"2015-05-28T12:09:37Z","updated_at":"2015-05-29T14:08:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2048547f72a4b60be6acb4c83c3a44679fb1c5a2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zendframework/zend-mail/pulls/1/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-mail/pulls/1/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-mail/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-mail/issues/1/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-mail/statuses/a23c7228dda1a349eff5c771e3016a2bd7fb2904","head":{"label":"echampet:mailrework","ref":"mailrework","sha":"a23c7228dda1a349eff5c771e3016a2bd7fb2904","user":{"login":"echampet","id":2317161,"avatar_url":"https://avatars.githubusercontent.com/u/2317161?v=3","gravatar_id":"","url":"https://api.github.com/users/echampet","html_url":"https://github.com/echampet","followers_url":"https://api.github.com/users/echampet/followers","following_url":"https://api.github.com/users/echampet/following{/other_user}","gists_url":"https://api.github.com/users/echampet/gists{/gist_id}","starred_url":"https://api.github.com/users/echampet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echampet/subscriptions","organizations_url":"https://api.github.com/users/echampet/orgs","repos_url":"https://api.github.com/users/echampet/repos","events_url":"https://api.github.com/users/echampet/events{/privacy}","received_events_url":"https://api.github.com/users/echampet/received_events","type":"User","site_admin":false},"repo":{"id":36426659,"name":"zend-mail","full_name":"echampet/zend-mail","owner":{"login":"echampet","id":2317161,"avatar_url":"https://avatars.githubusercontent.com/u/2317161?v=3","gravatar_id":"","url":"https://api.github.com/users/echampet","html_url":"https://github.com/echampet","followers_url":"https://api.github.com/users/echampet/followers","following_url":"https://api.github.com/users/echampet/following{/other_user}","gists_url":"https://api.github.com/users/echampet/gists{/gist_id}","starred_url":"https://api.github.com/users/echampet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echampet/subscriptions","organizations_url":"https://api.github.com/users/echampet/orgs","repos_url":"https://api.github.com/users/echampet/repos","events_url":"https://api.github.com/users/echampet/events{/privacy}","received_events_url":"https://api.github.com/users/echampet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/echampet/zend-mail","description":"Mail component from Zend Framework","fork":true,"url":"https://api.github.com/repos/echampet/zend-mail","forks_url":"https://api.github.com/repos/echampet/zend-mail/forks","keys_url":"https://api.github.com/repos/echampet/zend-mail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/echampet/zend-mail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/echampet/zend-mail/teams","hooks_url":"https://api.github.com/repos/echampet/zend-mail/hooks","issue_events_url":"https://api.github.com/repos/echampet/zend-mail/issues/events{/number}","events_url":"https://api.github.com/repos/echampet/zend-mail/events","assignees_url":"https://api.github.com/repos/echampet/zend-mail/assignees{/user}","branches_url":"https://api.github.com/repos/echampet/zend-mail/branches{/branch}","tags_url":"https://api.github.com/repos/echampet/zend-mail/tags","blobs_url":"https://api.github.com/repos/echampet/zend-mail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/echampet/zend-mail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/echampet/zend-mail/git/refs{/sha}","trees_url":"https://api.github.com/repos/echampet/zend-mail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/echampet/zend-mail/statuses/{sha}","languages_url":"https://api.github.com/repos/echampet/zend-mail/languages","stargazers_url":"https://api.github.com/repos/echampet/zend-mail/stargazers","contributors_url":"https://api.github.com/repos/echampet/zend-mail/contributors","subscribers_url":"https://api.github.com/repos/echampet/zend-mail/subscribers","subscription_url":"https://api.github.com/repos/echampet/zend-mail/subscription","commits_url":"https://api.github.com/repos/echampet/zend-mail/commits{/sha}","git_commits_url":"https://api.github.com/repos/echampet/zend-mail/git/commits{/sha}","comments_url":"https://api.github.com/repos/echampet/zend-mail/comments{/number}","issue_comment_url":"https://api.github.com/repos/echampet/zend-mail/issues/comments{/number}","contents_url":"https://api.github.com/repos/echampet/zend-mail/contents/{+path}","compare_url":"https://api.github.com/repos/echampet/zend-mail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/echampet/zend-mail/merges","archive_url":"https://api.github.com/repos/echampet/zend-mail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/echampet/zend-mail/downloads","issues_url":"https://api.github.com/repos/echampet/zend-mail/issues{/number}","pulls_url":"https://api.github.com/repos/echampet/zend-mail/pulls{/number}","milestones_url":"https://api.github.com/repos/echampet/zend-mail/milestones{/number}","notifications_url":"https://api.github.com/repos/echampet/zend-mail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/echampet/zend-mail/labels{/name}","releases_url":"https://api.github.com/repos/echampet/zend-mail/releases{/id}","created_at":"2015-05-28T08:59:16Z","updated_at":"2015-05-28T08:59:17Z","pushed_at":"2015-05-29T13:31:02Z","git_url":"git://github.com/echampet/zend-mail.git","ssh_url":"git@github.com:echampet/zend-mail.git","clone_url":"https://github.com/echampet/zend-mail.git","svn_url":"https://github.com/echampet/zend-mail","homepage":"https://github.com/zendframework/zf2","size":3018,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zendframework:master","ref":"master","sha":"1e996e756262219134b6d0127993477203412c40","user":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"repo":{"id":35280813,"name":"zend-mail","full_name":"zendframework/zend-mail","owner":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendframework/zend-mail","description":"Mail component from Zend Framework","fork":false,"url":"https://api.github.com/repos/zendframework/zend-mail","forks_url":"https://api.github.com/repos/zendframework/zend-mail/forks","keys_url":"https://api.github.com/repos/zendframework/zend-mail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-mail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-mail/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-mail/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-mail/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-mail/events","assignees_url":"https://api.github.com/repos/zendframework/zend-mail/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-mail/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-mail/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-mail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-mail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-mail/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-mail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-mail/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-mail/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-mail/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-mail/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-mail/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-mail/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-mail/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-mail/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-mail/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-mail/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-mail/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-mail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-mail/merges","archive_url":"https://api.github.com/repos/zendframework/zend-mail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-mail/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-mail/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-mail/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-mail/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-mail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-mail/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-mail/releases{/id}","created_at":"2015-05-08T13:28:04Z","updated_at":"2015-05-28T09:02:04Z","pushed_at":"2015-05-29T13:31:03Z","git_url":"git://github.com/zendframework/zend-mail.git","ssh_url":"git@github.com:zendframework/zend-mail.git","clone_url":"https://github.com/zendframework/zend-mail.git","svn_url":"https://github.com/zendframework/zend-mail","homepage":"https://github.com/zendframework/zf2","size":3239,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-mail/pulls/1"},"html":{"href":"https://github.com/zendframework/zend-mail/pull/1"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-mail/issues/1"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-mail/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-mail/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-mail/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-mail/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-mail/statuses/a23c7228dda1a349eff5c771e3016a2bd7fb2904"}}}}