{"action":"created","comment":{"url":"https://api.github.com/repos/phalcon/incubator/pulls/comments/32204364","id":32204364,"diff_hunk":"@@ -43,12 +44,20 @@ public static function generate($string, $replace = array(), $delimiter = '-')\n         $oldLocale = setlocale(LC_ALL, '0');\n         setlocale(LC_ALL, 'en_US.UTF-8');\n \n-        $clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string);\n+        // replace non letter or non digits by -\n+        $string = preg_replace(\"#[^\\\\pL\\d]+#u\", '-', $string);\n+\n+        // Trim trailing -\n+        $string = trim($string,'-');","path":"Library/Phalcon/Utils/Slug.php","position":17,"original_position":17,"commit_id":"26b2d71f2b32a01a7d0c08d50f772d31f1bc1dd8","original_commit_id":"26b2d71f2b32a01a7d0c08d50f772d31f1bc1dd8","user":{"login":"sergeyklay","id":1256298,"avatar_url":"https://avatars.githubusercontent.com/u/1256298?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyklay","html_url":"https://github.com/sergeyklay","followers_url":"https://api.github.com/users/sergeyklay/followers","following_url":"https://api.github.com/users/sergeyklay/following{/other_user}","gists_url":"https://api.github.com/users/sergeyklay/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyklay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyklay/subscriptions","organizations_url":"https://api.github.com/users/sergeyklay/orgs","repos_url":"https://api.github.com/users/sergeyklay/repos","events_url":"https://api.github.com/users/sergeyklay/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyklay/received_events","type":"User","site_admin":false},"body":"PSR-2\r\n`No space found after comma in function call`","created_at":"2015-06-11T09:39:20Z","updated_at":"2015-06-11T09:39:20Z","html_url":"https://github.com/phalcon/incubator/pull/376#discussion_r32204364","pull_request_url":"https://api.github.com/repos/phalcon/incubator/pulls/376","_links":{"self":{"href":"https://api.github.com/repos/phalcon/incubator/pulls/comments/32204364"},"html":{"href":"https://github.com/phalcon/incubator/pull/376#discussion_r32204364"},"pull_request":{"href":"https://api.github.com/repos/phalcon/incubator/pulls/376"}}},"pull_request":{"url":"https://api.github.com/repos/phalcon/incubator/pulls/376","id":37440952,"html_url":"https://github.com/phalcon/incubator/pull/376","diff_url":"https://github.com/phalcon/incubator/pull/376.diff","patch_url":"https://github.com/phalcon/incubator/pull/376.patch","issue_url":"https://api.github.com/repos/phalcon/incubator/issues/376","number":376,"state":"open","locked":false,"title":"Feat/utils/slug/non alphanumeric character fix and replace improvement","user":{"login":"ilgityildirim","id":4365245,"avatar_url":"https://avatars.githubusercontent.com/u/4365245?v=3","gravatar_id":"","url":"https://api.github.com/users/ilgityildirim","html_url":"https://github.com/ilgityildirim","followers_url":"https://api.github.com/users/ilgityildirim/followers","following_url":"https://api.github.com/users/ilgityildirim/following{/other_user}","gists_url":"https://api.github.com/users/ilgityildirim/gists{/gist_id}","starred_url":"https://api.github.com/users/ilgityildirim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilgityildirim/subscriptions","organizations_url":"https://api.github.com/users/ilgityildirim/orgs","repos_url":"https://api.github.com/users/ilgityildirim/repos","events_url":"https://api.github.com/users/ilgityildirim/events{/privacy}","received_events_url":"https://api.github.com/users/ilgityildirim/received_events","type":"User","site_admin":false},"body":"There was a problem with non-alphanumeric characters as it was turning them into their ASCII counterparts.\r\n**Example String** ````Phalcon's incubator is great````\r\n**Output** ````phalcon39s-incubator-is-great````\r\n\r\nObviously this is not the expected nor wanted output.\r\n**New Output** ````phalcon-s-incubator-is-great````\r\n\r\n````$replace```` was also just replacing any given character with a space ```` ```` This might not be the case in some situations such as (with or without using ````$replace````);\r\n**Example String** ````What does it mean yapılır in Turkish````\r\n**Output** ````what-does-it-mean-yaplr-in-turkish````\r\n\r\nWe can simply pass ```$replace = [ 'ı' => 'i' ]``` with the new update to overcome this problem\r\n**New Output** ````what-does-it-mean-yapilir-in-turkish````","created_at":"2015-06-11T08:44:58Z","updated_at":"2015-06-11T09:39:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b183f6da1fb1cc964fdbe42252a6a042ffc7f2e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phalcon/incubator/pulls/376/commits","review_comments_url":"https://api.github.com/repos/phalcon/incubator/pulls/376/comments","review_comment_url":"https://api.github.com/repos/phalcon/incubator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phalcon/incubator/issues/376/comments","statuses_url":"https://api.github.com/repos/phalcon/incubator/statuses/26b2d71f2b32a01a7d0c08d50f772d31f1bc1dd8","head":{"label":"ilgityildirim:feat/utils/slug/non-alphanumeric-character-fix-and-replace-improvement","ref":"feat/utils/slug/non-alphanumeric-character-fix-and-replace-improvement","sha":"26b2d71f2b32a01a7d0c08d50f772d31f1bc1dd8","user":{"login":"ilgityildirim","id":4365245,"avatar_url":"https://avatars.githubusercontent.com/u/4365245?v=3","gravatar_id":"","url":"https://api.github.com/users/ilgityildirim","html_url":"https://github.com/ilgityildirim","followers_url":"https://api.github.com/users/ilgityildirim/followers","following_url":"https://api.github.com/users/ilgityildirim/following{/other_user}","gists_url":"https://api.github.com/users/ilgityildirim/gists{/gist_id}","starred_url":"https://api.github.com/users/ilgityildirim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilgityildirim/subscriptions","organizations_url":"https://api.github.com/users/ilgityildirim/orgs","repos_url":"https://api.github.com/users/ilgityildirim/repos","events_url":"https://api.github.com/users/ilgityildirim/events{/privacy}","received_events_url":"https://api.github.com/users/ilgityildirim/received_events","type":"User","site_admin":false},"repo":{"id":37243429,"name":"incubator","full_name":"ilgityildirim/incubator","owner":{"login":"ilgityildirim","id":4365245,"avatar_url":"https://avatars.githubusercontent.com/u/4365245?v=3","gravatar_id":"","url":"https://api.github.com/users/ilgityildirim","html_url":"https://github.com/ilgityildirim","followers_url":"https://api.github.com/users/ilgityildirim/followers","following_url":"https://api.github.com/users/ilgityildirim/following{/other_user}","gists_url":"https://api.github.com/users/ilgityildirim/gists{/gist_id}","starred_url":"https://api.github.com/users/ilgityildirim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilgityildirim/subscriptions","organizations_url":"https://api.github.com/users/ilgityildirim/orgs","repos_url":"https://api.github.com/users/ilgityildirim/repos","events_url":"https://api.github.com/users/ilgityildirim/events{/privacy}","received_events_url":"https://api.github.com/users/ilgityildirim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilgityildirim/incubator","description":"Incubator adapters/functionality for the Phalcon PHP Framework","fork":true,"url":"https://api.github.com/repos/ilgityildirim/incubator","forks_url":"https://api.github.com/repos/ilgityildirim/incubator/forks","keys_url":"https://api.github.com/repos/ilgityildirim/incubator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilgityildirim/incubator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilgityildirim/incubator/teams","hooks_url":"https://api.github.com/repos/ilgityildirim/incubator/hooks","issue_events_url":"https://api.github.com/repos/ilgityildirim/incubator/issues/events{/number}","events_url":"https://api.github.com/repos/ilgityildirim/incubator/events","assignees_url":"https://api.github.com/repos/ilgityildirim/incubator/assignees{/user}","branches_url":"https://api.github.com/repos/ilgityildirim/incubator/branches{/branch}","tags_url":"https://api.github.com/repos/ilgityildirim/incubator/tags","blobs_url":"https://api.github.com/repos/ilgityildirim/incubator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilgityildirim/incubator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilgityildirim/incubator/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilgityildirim/incubator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilgityildirim/incubator/statuses/{sha}","languages_url":"https://api.github.com/repos/ilgityildirim/incubator/languages","stargazers_url":"https://api.github.com/repos/ilgityildirim/incubator/stargazers","contributors_url":"https://api.github.com/repos/ilgityildirim/incubator/contributors","subscribers_url":"https://api.github.com/repos/ilgityildirim/incubator/subscribers","subscription_url":"https://api.github.com/repos/ilgityildirim/incubator/subscription","commits_url":"https://api.github.com/repos/ilgityildirim/incubator/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilgityildirim/incubator/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilgityildirim/incubator/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilgityildirim/incubator/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilgityildirim/incubator/contents/{+path}","compare_url":"https://api.github.com/repos/ilgityildirim/incubator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilgityildirim/incubator/merges","archive_url":"https://api.github.com/repos/ilgityildirim/incubator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilgityildirim/incubator/downloads","issues_url":"https://api.github.com/repos/ilgityildirim/incubator/issues{/number}","pulls_url":"https://api.github.com/repos/ilgityildirim/incubator/pulls{/number}","milestones_url":"https://api.github.com/repos/ilgityildirim/incubator/milestones{/number}","notifications_url":"https://api.github.com/repos/ilgityildirim/incubator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilgityildirim/incubator/labels{/name}","releases_url":"https://api.github.com/repos/ilgityildirim/incubator/releases{/id}","created_at":"2015-06-11T06:29:07Z","updated_at":"2015-06-11T06:29:08Z","pushed_at":"2015-06-11T08:02:20Z","git_url":"git://github.com/ilgityildirim/incubator.git","ssh_url":"git@github.com:ilgityildirim/incubator.git","clone_url":"https://github.com/ilgityildirim/incubator.git","svn_url":"https://github.com/ilgityildirim/incubator","homepage":null,"size":6166,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"phalcon:2.0.x","ref":"2.0.x","sha":"600aa77cd4cca17ba1545cd5e7753b0cb33aabab","user":{"login":"phalcon","id":1221505,"avatar_url":"https://avatars.githubusercontent.com/u/1221505?v=3","gravatar_id":"","url":"https://api.github.com/users/phalcon","html_url":"https://github.com/phalcon","followers_url":"https://api.github.com/users/phalcon/followers","following_url":"https://api.github.com/users/phalcon/following{/other_user}","gists_url":"https://api.github.com/users/phalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/phalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phalcon/subscriptions","organizations_url":"https://api.github.com/users/phalcon/orgs","repos_url":"https://api.github.com/users/phalcon/repos","events_url":"https://api.github.com/users/phalcon/events{/privacy}","received_events_url":"https://api.github.com/users/phalcon/received_events","type":"User","site_admin":false},"repo":{"id":6857360,"name":"incubator","full_name":"phalcon/incubator","owner":{"login":"phalcon","id":1221505,"avatar_url":"https://avatars.githubusercontent.com/u/1221505?v=3","gravatar_id":"","url":"https://api.github.com/users/phalcon","html_url":"https://github.com/phalcon","followers_url":"https://api.github.com/users/phalcon/followers","following_url":"https://api.github.com/users/phalcon/following{/other_user}","gists_url":"https://api.github.com/users/phalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/phalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phalcon/subscriptions","organizations_url":"https://api.github.com/users/phalcon/orgs","repos_url":"https://api.github.com/users/phalcon/repos","events_url":"https://api.github.com/users/phalcon/events{/privacy}","received_events_url":"https://api.github.com/users/phalcon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phalcon/incubator","description":"Incubator adapters/functionality for the Phalcon PHP Framework","fork":false,"url":"https://api.github.com/repos/phalcon/incubator","forks_url":"https://api.github.com/repos/phalcon/incubator/forks","keys_url":"https://api.github.com/repos/phalcon/incubator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phalcon/incubator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phalcon/incubator/teams","hooks_url":"https://api.github.com/repos/phalcon/incubator/hooks","issue_events_url":"https://api.github.com/repos/phalcon/incubator/issues/events{/number}","events_url":"https://api.github.com/repos/phalcon/incubator/events","assignees_url":"https://api.github.com/repos/phalcon/incubator/assignees{/user}","branches_url":"https://api.github.com/repos/phalcon/incubator/branches{/branch}","tags_url":"https://api.github.com/repos/phalcon/incubator/tags","blobs_url":"https://api.github.com/repos/phalcon/incubator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phalcon/incubator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phalcon/incubator/git/refs{/sha}","trees_url":"https://api.github.com/repos/phalcon/incubator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phalcon/incubator/statuses/{sha}","languages_url":"https://api.github.com/repos/phalcon/incubator/languages","stargazers_url":"https://api.github.com/repos/phalcon/incubator/stargazers","contributors_url":"https://api.github.com/repos/phalcon/incubator/contributors","subscribers_url":"https://api.github.com/repos/phalcon/incubator/subscribers","subscription_url":"https://api.github.com/repos/phalcon/incubator/subscription","commits_url":"https://api.github.com/repos/phalcon/incubator/commits{/sha}","git_commits_url":"https://api.github.com/repos/phalcon/incubator/git/commits{/sha}","comments_url":"https://api.github.com/repos/phalcon/incubator/comments{/number}","issue_comment_url":"https://api.github.com/repos/phalcon/incubator/issues/comments{/number}","contents_url":"https://api.github.com/repos/phalcon/incubator/contents/{+path}","compare_url":"https://api.github.com/repos/phalcon/incubator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phalcon/incubator/merges","archive_url":"https://api.github.com/repos/phalcon/incubator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phalcon/incubator/downloads","issues_url":"https://api.github.com/repos/phalcon/incubator/issues{/number}","pulls_url":"https://api.github.com/repos/phalcon/incubator/pulls{/number}","milestones_url":"https://api.github.com/repos/phalcon/incubator/milestones{/number}","notifications_url":"https://api.github.com/repos/phalcon/incubator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phalcon/incubator/labels{/name}","releases_url":"https://api.github.com/repos/phalcon/incubator/releases{/id}","created_at":"2012-11-25T23:45:51Z","updated_at":"2015-06-10T21:00:06Z","pushed_at":"2015-06-11T08:44:58Z","git_url":"git://github.com/phalcon/incubator.git","ssh_url":"git@github.com:phalcon/incubator.git","clone_url":"https://github.com/phalcon/incubator.git","svn_url":"https://github.com/phalcon/incubator","homepage":null,"size":6166,"stargazers_count":354,"watchers_count":354,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":219,"mirror_url":null,"open_issues_count":8,"forks":219,"open_issues":8,"watchers":354,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phalcon/incubator/pulls/376"},"html":{"href":"https://github.com/phalcon/incubator/pull/376"},"issue":{"href":"https://api.github.com/repos/phalcon/incubator/issues/376"},"comments":{"href":"https://api.github.com/repos/phalcon/incubator/issues/376/comments"},"review_comments":{"href":"https://api.github.com/repos/phalcon/incubator/pulls/376/comments"},"review_comment":{"href":"https://api.github.com/repos/phalcon/incubator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phalcon/incubator/pulls/376/commits"},"statuses":{"href":"https://api.github.com/repos/phalcon/incubator/statuses/26b2d71f2b32a01a7d0c08d50f772d31f1bc1dd8"}}}}