{"action":"created","issue":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/447","labels_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/447/labels{/name}","comments_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/447/comments","events_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/447/events","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/pull/447","id":54738997,"number":447,"title":"Changing the regex check in the FIXME and TODO sniffs.","user":{"login":"iammichiel","id":1027369,"avatar_url":"https://avatars.githubusercontent.com/u/1027369?v=3","gravatar_id":"","url":"https://api.github.com/users/iammichiel","html_url":"https://github.com/iammichiel","followers_url":"https://api.github.com/users/iammichiel/followers","following_url":"https://api.github.com/users/iammichiel/following{/other_user}","gists_url":"https://api.github.com/users/iammichiel/gists{/gist_id}","starred_url":"https://api.github.com/users/iammichiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iammichiel/subscriptions","organizations_url":"https://api.github.com/users/iammichiel/orgs","repos_url":"https://api.github.com/users/iammichiel/repos","events_url":"https://api.github.com/users/iammichiel/events{/privacy}","received_events_url":"https://api.github.com/users/iammichiel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/labels/Awaiting+Feedback","name":"Awaiting Feedback","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-19T08:51:26Z","updated_at":"2015-01-20T08:38:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/pulls/447","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/pull/447","diff_url":"https://github.com/squizlabs/PHP_CodeSniffer/pull/447.diff","patch_url":"https://github.com/squizlabs/PHP_CodeSniffer/pull/447.patch"},"body":"The problem is the use of the preg_match expression. As defined in the official PHP documentation : \r\n\r\n> preg_match() returns 1 if the pattern matches given subject, 0 if it does not, or FALSE if an error occurred.\r\n\r\nHowever the condition used in the sniffs is : \r\n\r\n```\r\n if (preg_match('/(?:\\A|[^\\p{L}]+)fixme([^\\p{L}]+(.*)|\\Z)/ui', $content, $matches) !== 0) {\r\n```\r\n\r\nWhich will in case of FALSE, enter the block code. Which it should not. This generates a lot of useless PHP notices : \r\n\r\n```\r\nNotice: Undefined offset: 1 in /apps/test/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Commenting/TodoSniff.php on line 73\r\nPHP Notice:  Undefined offset: 1 in /apps/test/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Commenting/TodoSniff.php on line 73\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/comments/70620725","html_url":"https://github.com/squizlabs/PHP_CodeSniffer/pull/447#issuecomment-70620725","issue_url":"https://api.github.com/repos/squizlabs/PHP_CodeSniffer/issues/447","id":70620725,"user":{"login":"aik099","id":1277526,"avatar_url":"https://avatars.githubusercontent.com/u/1277526?v=3","gravatar_id":"","url":"https://api.github.com/users/aik099","html_url":"https://github.com/aik099","followers_url":"https://api.github.com/users/aik099/followers","following_url":"https://api.github.com/users/aik099/following{/other_user}","gists_url":"https://api.github.com/users/aik099/gists{/gist_id}","starred_url":"https://api.github.com/users/aik099/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aik099/subscriptions","organizations_url":"https://api.github.com/users/aik099/orgs","repos_url":"https://api.github.com/users/aik099/repos","events_url":"https://api.github.com/users/aik099/events{/privacy}","received_events_url":"https://api.github.com/users/aik099/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T08:38:48Z","updated_at":"2015-01-20T08:38:48Z","body":"Maybe you can try putting some Russian text in UTF-8 MySQL column and then reading this text using connection to MySQL server, where latin1 is set as encoding."}}