{"action":"opened","number":336,"pull_request":{"url":"https://api.github.com/repos/contao/core-bundle/pulls/336","id":43281867,"html_url":"https://github.com/contao/core-bundle/pull/336","diff_url":"https://github.com/contao/core-bundle/pull/336.diff","patch_url":"https://github.com/contao/core-bundle/pull/336.patch","issue_url":"https://api.github.com/repos/contao/core-bundle/issues/336","number":336,"state":"open","locked":false,"title":"Use unit tested utf-8 library patchwork/utf-8","user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","gravatar_id":"","url":"https://api.github.com/users/Toflar","html_url":"https://github.com/Toflar","followers_url":"https://api.github.com/users/Toflar/followers","following_url":"https://api.github.com/users/Toflar/following{/other_user}","gists_url":"https://api.github.com/users/Toflar/gists{/gist_id}","starred_url":"https://api.github.com/users/Toflar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toflar/subscriptions","organizations_url":"https://api.github.com/users/Toflar/orgs","repos_url":"https://api.github.com/users/Toflar/repos","events_url":"https://api.github.com/users/Toflar/events{/privacy}","received_events_url":"https://api.github.com/users/Toflar/received_events","type":"User","site_admin":false},"body":"I've replaced all our `utf8_*` functions by the equivalents provided by `patchwork/utf-8`. Also, I removed all our `mb_*` compatibility implementations as the library does that as well.\r\n\r\nFor reasons of BC, I have moved all `utf8_*` functions to `functions.php` and marked them as `deprecated`.\r\nHowever, there is one function which I don't quite know what to to with:\r\n\r\n`utf8_decode_entities` is doing this now:\r\n\r\n```php\r\n\t$str = preg_replace_callback('~&#x([0-9a-f]+);~i', function($matches) {\r\n\t\treturn \\Patchwork\\Utf8::chr(hexdec($matches[1]));\r\n\t}, $str);\r\n\t$str = preg_replace_callback('~&#([0-9]+);~', function($matches) {\r\n\t\treturn \\Patchwork\\Utf8::chr($matches[1]);\r\n\t}, $str);\r\n\r\n\treturn $str;\r\n```\r\n\r\nI think this should be replaced by\r\n```php\r\nhtml_entity_decode($str, ENT_COMPAT|ENT_HTML401, 'utf-8');\r\n```\r\n\r\nHowever, I see that it is currently not replacing things like `&nbsp;`. `utf8_decode_entities` is only used in the `Input` class which obviously is a sensitive part of our application so I don't know if we can just change it? @ausi Do you have an opinion on that?\r\n\r\nMoreover, should this PR already include the changes necessary to replace the lines of code using the `utf8_*` functions or will we remove the usages when working on Contao 5?","created_at":"2015-08-25T12:54:34Z","updated_at":"2015-08-25T12:54:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/contao/core-bundle/pulls/336/commits","review_comments_url":"https://api.github.com/repos/contao/core-bundle/pulls/336/comments","review_comment_url":"https://api.github.com/repos/contao/core-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contao/core-bundle/issues/336/comments","statuses_url":"https://api.github.com/repos/contao/core-bundle/statuses/c994c6b3bdcc1ce9485a5e9459e96dfc6a34f627","head":{"label":"Toflar:feature/use-patchwork-utf8","ref":"feature/use-patchwork-utf8","sha":"c994c6b3bdcc1ce9485a5e9459e96dfc6a34f627","user":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","gravatar_id":"","url":"https://api.github.com/users/Toflar","html_url":"https://github.com/Toflar","followers_url":"https://api.github.com/users/Toflar/followers","following_url":"https://api.github.com/users/Toflar/following{/other_user}","gists_url":"https://api.github.com/users/Toflar/gists{/gist_id}","starred_url":"https://api.github.com/users/Toflar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toflar/subscriptions","organizations_url":"https://api.github.com/users/Toflar/orgs","repos_url":"https://api.github.com/users/Toflar/repos","events_url":"https://api.github.com/users/Toflar/events{/privacy}","received_events_url":"https://api.github.com/users/Toflar/received_events","type":"User","site_admin":false},"repo":{"id":26642166,"name":"core-bundle","full_name":"Toflar/core-bundle","owner":{"login":"Toflar","id":481937,"avatar_url":"https://avatars.githubusercontent.com/u/481937?v=3","gravatar_id":"","url":"https://api.github.com/users/Toflar","html_url":"https://github.com/Toflar","followers_url":"https://api.github.com/users/Toflar/followers","following_url":"https://api.github.com/users/Toflar/following{/other_user}","gists_url":"https://api.github.com/users/Toflar/gists{/gist_id}","starred_url":"https://api.github.com/users/Toflar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Toflar/subscriptions","organizations_url":"https://api.github.com/users/Toflar/orgs","repos_url":"https://api.github.com/users/Toflar/repos","events_url":"https://api.github.com/users/Toflar/events{/privacy}","received_events_url":"https://api.github.com/users/Toflar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Toflar/core-bundle","description":"Contao 4 core bundle","fork":true,"url":"https://api.github.com/repos/Toflar/core-bundle","forks_url":"https://api.github.com/repos/Toflar/core-bundle/forks","keys_url":"https://api.github.com/repos/Toflar/core-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Toflar/core-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Toflar/core-bundle/teams","hooks_url":"https://api.github.com/repos/Toflar/core-bundle/hooks","issue_events_url":"https://api.github.com/repos/Toflar/core-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/Toflar/core-bundle/events","assignees_url":"https://api.github.com/repos/Toflar/core-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/Toflar/core-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/Toflar/core-bundle/tags","blobs_url":"https://api.github.com/repos/Toflar/core-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Toflar/core-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Toflar/core-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Toflar/core-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Toflar/core-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/Toflar/core-bundle/languages","stargazers_url":"https://api.github.com/repos/Toflar/core-bundle/stargazers","contributors_url":"https://api.github.com/repos/Toflar/core-bundle/contributors","subscribers_url":"https://api.github.com/repos/Toflar/core-bundle/subscribers","subscription_url":"https://api.github.com/repos/Toflar/core-bundle/subscription","commits_url":"https://api.github.com/repos/Toflar/core-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Toflar/core-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Toflar/core-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Toflar/core-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Toflar/core-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/Toflar/core-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Toflar/core-bundle/merges","archive_url":"https://api.github.com/repos/Toflar/core-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Toflar/core-bundle/downloads","issues_url":"https://api.github.com/repos/Toflar/core-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/Toflar/core-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/Toflar/core-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/Toflar/core-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Toflar/core-bundle/labels{/name}","releases_url":"https://api.github.com/repos/Toflar/core-bundle/releases{/id}","created_at":"2014-11-14T14:32:10Z","updated_at":"2015-04-18T14:10:14Z","pushed_at":"2015-08-25T12:34:50Z","git_url":"git://github.com/Toflar/core-bundle.git","ssh_url":"git@github.com:Toflar/core-bundle.git","clone_url":"https://github.com/Toflar/core-bundle.git","svn_url":"https://github.com/Toflar/core-bundle","homepage":"","size":23789,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"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":"develop"}},"base":{"label":"contao:develop","ref":"develop","sha":"2e99dfd00b376675f41202ee2551556f8fb6013b","user":{"login":"contao","id":1206136,"avatar_url":"https://avatars.githubusercontent.com/u/1206136?v=3","gravatar_id":"","url":"https://api.github.com/users/contao","html_url":"https://github.com/contao","followers_url":"https://api.github.com/users/contao/followers","following_url":"https://api.github.com/users/contao/following{/other_user}","gists_url":"https://api.github.com/users/contao/gists{/gist_id}","starred_url":"https://api.github.com/users/contao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contao/subscriptions","organizations_url":"https://api.github.com/users/contao/orgs","repos_url":"https://api.github.com/users/contao/repos","events_url":"https://api.github.com/users/contao/events{/privacy}","received_events_url":"https://api.github.com/users/contao/received_events","type":"Organization","site_admin":false},"repo":{"id":20519851,"name":"core-bundle","full_name":"contao/core-bundle","owner":{"login":"contao","id":1206136,"avatar_url":"https://avatars.githubusercontent.com/u/1206136?v=3","gravatar_id":"","url":"https://api.github.com/users/contao","html_url":"https://github.com/contao","followers_url":"https://api.github.com/users/contao/followers","following_url":"https://api.github.com/users/contao/following{/other_user}","gists_url":"https://api.github.com/users/contao/gists{/gist_id}","starred_url":"https://api.github.com/users/contao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contao/subscriptions","organizations_url":"https://api.github.com/users/contao/orgs","repos_url":"https://api.github.com/users/contao/repos","events_url":"https://api.github.com/users/contao/events{/privacy}","received_events_url":"https://api.github.com/users/contao/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contao/core-bundle","description":"Contao 4 core bundle","fork":false,"url":"https://api.github.com/repos/contao/core-bundle","forks_url":"https://api.github.com/repos/contao/core-bundle/forks","keys_url":"https://api.github.com/repos/contao/core-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contao/core-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contao/core-bundle/teams","hooks_url":"https://api.github.com/repos/contao/core-bundle/hooks","issue_events_url":"https://api.github.com/repos/contao/core-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/contao/core-bundle/events","assignees_url":"https://api.github.com/repos/contao/core-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/contao/core-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/contao/core-bundle/tags","blobs_url":"https://api.github.com/repos/contao/core-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contao/core-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contao/core-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/contao/core-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contao/core-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/contao/core-bundle/languages","stargazers_url":"https://api.github.com/repos/contao/core-bundle/stargazers","contributors_url":"https://api.github.com/repos/contao/core-bundle/contributors","subscribers_url":"https://api.github.com/repos/contao/core-bundle/subscribers","subscription_url":"https://api.github.com/repos/contao/core-bundle/subscription","commits_url":"https://api.github.com/repos/contao/core-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/contao/core-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/contao/core-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/contao/core-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/contao/core-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/contao/core-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contao/core-bundle/merges","archive_url":"https://api.github.com/repos/contao/core-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contao/core-bundle/downloads","issues_url":"https://api.github.com/repos/contao/core-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/contao/core-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/contao/core-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/contao/core-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contao/core-bundle/labels{/name}","releases_url":"https://api.github.com/repos/contao/core-bundle/releases{/id}","created_at":"2014-06-05T09:45:55Z","updated_at":"2015-08-20T12:30:22Z","pushed_at":"2015-08-25T12:45:40Z","git_url":"git://github.com/contao/core-bundle.git","ssh_url":"git@github.com:contao/core-bundle.git","clone_url":"https://github.com/contao/core-bundle.git","svn_url":"https://github.com/contao/core-bundle","homepage":"","size":29057,"stargazers_count":25,"watchers_count":25,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":33,"forks":11,"open_issues":33,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/336"},"html":{"href":"https://github.com/contao/core-bundle/pull/336"},"issue":{"href":"https://api.github.com/repos/contao/core-bundle/issues/336"},"comments":{"href":"https://api.github.com/repos/contao/core-bundle/issues/336/comments"},"review_comments":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/336/comments"},"review_comment":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contao/core-bundle/pulls/336/commits"},"statuses":{"href":"https://api.github.com/repos/contao/core-bundle/statuses/c994c6b3bdcc1ce9485a5e9459e96dfc6a34f627"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":341,"deletions":1108,"changed_files":4}}