{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-mime/pulls/comments/31301292","id":31301292,"diff_hunk":"@@ -102,43 +101,32 @@ public static function splitMessageStruct($message, $boundary, $EOL = Mime::LINE\n     public static function splitMessage($message, &$headers, &$body, $EOL = Mime::LINEEND, $strict = false)\n     {\n         if ($message instanceof Headers) {\n-            $message = $message->toString();\n-        }\n-        // check for valid header at first line\n-        $firstline = strtok($message, \"\\n\");\n-        if (!preg_match('%^[^\\s]+[^:]*:%', $firstline)) {\n-            $headers = array();\n-            // TODO: we're ignoring \\r for now - is this function fast enough and is it safe to assume noone needs \\r?\n-            $body = str_replace(array(\"\\r\", \"\\n\"), array('', $EOL), $message);\n+            $headers = $message;\n+            $body = null;\n             return;\n         }\n \n-        // see @ZF2-372, pops the first line off a message if it doesn't contain a header\n-        if (!$strict) {\n-            $parts = explode(':', $firstline, 2);\n-            if (count($parts) != 2) {\n-                $message = substr($message, strpos($message, $EOL)+1);\n+        // check for valid header at first line\n+        if (!preg_match('%^[!-9;-~]+:%', $message)) {\n+            //check for valid header at second line for @ZF2-372\n+            if (!$strict && preg_match('%^.*\\R([!-9;-~]+:.*)$%sU', $message, $matches)) {","path":"src/Decode.php","position":33,"original_position":33,"commit_id":"ca9693f58948c044f34657c5c81e51b7398b5ab8","original_commit_id":"ca9693f58948c044f34657c5c81e51b7398b5ab8","user":{"login":"Maks3w","id":1301698,"avatar_url":"https://avatars.githubusercontent.com/u/1301698?v=3","gravatar_id":"","url":"https://api.github.com/users/Maks3w","html_url":"https://github.com/Maks3w","followers_url":"https://api.github.com/users/Maks3w/followers","following_url":"https://api.github.com/users/Maks3w/following{/other_user}","gists_url":"https://api.github.com/users/Maks3w/gists{/gist_id}","starred_url":"https://api.github.com/users/Maks3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maks3w/subscriptions","organizations_url":"https://api.github.com/users/Maks3w/orgs","repos_url":"https://api.github.com/users/Maks3w/repos","events_url":"https://api.github.com/users/Maks3w/events{/privacy}","received_events_url":"https://api.github.com/users/Maks3w/received_events","type":"User","site_admin":false},"body":"Ok. parent if require to match at the begin of line","created_at":"2015-05-29T06:12:30Z","updated_at":"2015-05-29T06:12:30Z","html_url":"https://github.com/zendframework/zend-mime/pull/1#discussion_r31301292","pull_request_url":"https://api.github.com/repos/zendframework/zend-mime/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-mime/pulls/comments/31301292"},"html":{"href":"https://github.com/zendframework/zend-mime/pull/1#discussion_r31301292"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-mime/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-mime/pulls/1","id":36387248,"html_url":"https://github.com/zendframework/zend-mime/pull/1","diff_url":"https://github.com/zendframework/zend-mime/pull/1.diff","patch_url":"https://github.com/zendframework/zend-mime/pull/1.patch","issue_url":"https://api.github.com/repos/zendframework/zend-mime/issues/1","number":1,"state":"open","locked":false,"title":"mail parsing rework","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":"Hi,\r\n\r\nthis PR include a small fix for base64 quoted printable encoding (wrapping must be modulo 4)\r\nand a rework of Decode::splitMessage() (i'm only interested in mail header parsing, so i haven't reworked other Decode parts)\r\n\r\noriginal PR (without tests)\r\nhttps://github.com/zendframework/zf2/pull/7372","created_at":"2015-05-28T09:27:42Z","updated_at":"2015-05-29T06:12:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e2cdff0bf13a986b47e73bb8c5ba26e90b3907f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zendframework/zend-mime/pulls/1/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-mime/pulls/1/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-mime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-mime/issues/1/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-mime/statuses/ca9693f58948c044f34657c5c81e51b7398b5ab8","head":{"label":"echampet:mailrework","ref":"mailrework","sha":"ca9693f58948c044f34657c5c81e51b7398b5ab8","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":36426712,"name":"zend-mime","full_name":"echampet/zend-mime","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-mime","description":"Mime component from Zend Framework","fork":true,"url":"https://api.github.com/repos/echampet/zend-mime","forks_url":"https://api.github.com/repos/echampet/zend-mime/forks","keys_url":"https://api.github.com/repos/echampet/zend-mime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/echampet/zend-mime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/echampet/zend-mime/teams","hooks_url":"https://api.github.com/repos/echampet/zend-mime/hooks","issue_events_url":"https://api.github.com/repos/echampet/zend-mime/issues/events{/number}","events_url":"https://api.github.com/repos/echampet/zend-mime/events","assignees_url":"https://api.github.com/repos/echampet/zend-mime/assignees{/user}","branches_url":"https://api.github.com/repos/echampet/zend-mime/branches{/branch}","tags_url":"https://api.github.com/repos/echampet/zend-mime/tags","blobs_url":"https://api.github.com/repos/echampet/zend-mime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/echampet/zend-mime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/echampet/zend-mime/git/refs{/sha}","trees_url":"https://api.github.com/repos/echampet/zend-mime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/echampet/zend-mime/statuses/{sha}","languages_url":"https://api.github.com/repos/echampet/zend-mime/languages","stargazers_url":"https://api.github.com/repos/echampet/zend-mime/stargazers","contributors_url":"https://api.github.com/repos/echampet/zend-mime/contributors","subscribers_url":"https://api.github.com/repos/echampet/zend-mime/subscribers","subscription_url":"https://api.github.com/repos/echampet/zend-mime/subscription","commits_url":"https://api.github.com/repos/echampet/zend-mime/commits{/sha}","git_commits_url":"https://api.github.com/repos/echampet/zend-mime/git/commits{/sha}","comments_url":"https://api.github.com/repos/echampet/zend-mime/comments{/number}","issue_comment_url":"https://api.github.com/repos/echampet/zend-mime/issues/comments{/number}","contents_url":"https://api.github.com/repos/echampet/zend-mime/contents/{+path}","compare_url":"https://api.github.com/repos/echampet/zend-mime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/echampet/zend-mime/merges","archive_url":"https://api.github.com/repos/echampet/zend-mime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/echampet/zend-mime/downloads","issues_url":"https://api.github.com/repos/echampet/zend-mime/issues{/number}","pulls_url":"https://api.github.com/repos/echampet/zend-mime/pulls{/number}","milestones_url":"https://api.github.com/repos/echampet/zend-mime/milestones{/number}","notifications_url":"https://api.github.com/repos/echampet/zend-mime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/echampet/zend-mime/labels{/name}","releases_url":"https://api.github.com/repos/echampet/zend-mime/releases{/id}","created_at":"2015-05-28T09:00:31Z","updated_at":"2015-05-28T09:00:32Z","pushed_at":"2015-05-28T20:53:25Z","git_url":"git://github.com/echampet/zend-mime.git","ssh_url":"git@github.com:echampet/zend-mime.git","clone_url":"https://github.com/echampet/zend-mime.git","svn_url":"https://github.com/echampet/zend-mime","homepage":"https://github.com/zendframework/zf2","size":1783,"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":"51c30c25270b106a27e4d47855a02fbf6ead42c1","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":35280817,"name":"zend-mime","full_name":"zendframework/zend-mime","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-mime","description":"Mime component from Zend Framework","fork":false,"url":"https://api.github.com/repos/zendframework/zend-mime","forks_url":"https://api.github.com/repos/zendframework/zend-mime/forks","keys_url":"https://api.github.com/repos/zendframework/zend-mime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-mime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-mime/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-mime/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-mime/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-mime/events","assignees_url":"https://api.github.com/repos/zendframework/zend-mime/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-mime/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-mime/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-mime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-mime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-mime/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-mime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-mime/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-mime/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-mime/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-mime/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-mime/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-mime/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-mime/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-mime/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-mime/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-mime/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-mime/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-mime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-mime/merges","archive_url":"https://api.github.com/repos/zendframework/zend-mime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-mime/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-mime/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-mime/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-mime/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-mime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-mime/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-mime/releases{/id}","created_at":"2015-05-08T13:28:06Z","updated_at":"2015-05-21T17:11:19Z","pushed_at":"2015-05-28T20:53:26Z","git_url":"git://github.com/zendframework/zend-mime.git","ssh_url":"git@github.com:zendframework/zend-mime.git","clone_url":"https://github.com/zendframework/zend-mime.git","svn_url":"https://github.com/zendframework/zend-mime","homepage":"https://github.com/zendframework/zf2","size":1783,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-mime/pulls/1"},"html":{"href":"https://github.com/zendframework/zend-mime/pull/1"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-mime/issues/1"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-mime/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-mime/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-mime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-mime/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-mime/statuses/ca9693f58948c044f34657c5c81e51b7398b5ab8"}}}}