{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/53668116","id":53668116,"diff_hunk":"@@ -45,8 +46,8 @@ function isValidDomain( name ) {\n \treturn /^([a-z0-9-_]{1,63}\\.)*[a-z0-9-]{1,63}\\.[a-z]{2,63}$/i.test( name );\n }\n \n-function isValidName( name, type ) {\n-\tif ( isNameEmptyAndItsAllowed( name, type ) ) {\n+function isValidName( name, type, domainName ) {\n+\tif ( isRootDomainAndItsAllowed( name, type, domainName ) ) {","path":"client/lib/domains/dns/index.js","position":35,"original_position":35,"commit_id":"891ed58159b1ecda870307745b560c117cd3d252","original_commit_id":"891ed58159b1ecda870307745b560c117cd3d252","user":{"login":"klimeryk","id":3392497,"avatar_url":"https://avatars.githubusercontent.com/u/3392497?v=3","gravatar_id":"","url":"https://api.github.com/users/klimeryk","html_url":"https://github.com/klimeryk","followers_url":"https://api.github.com/users/klimeryk/followers","following_url":"https://api.github.com/users/klimeryk/following{/other_user}","gists_url":"https://api.github.com/users/klimeryk/gists{/gist_id}","starred_url":"https://api.github.com/users/klimeryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klimeryk/subscriptions","organizations_url":"https://api.github.com/users/klimeryk/orgs","repos_url":"https://api.github.com/users/klimeryk/repos","events_url":"https://api.github.com/users/klimeryk/events{/privacy}","received_events_url":"https://api.github.com/users/klimeryk/received_events","type":"User","site_admin":false},"body":"It's important to check if the input is a root domain _and_ it can be a root domain for the give type. That's why I wanted it to be one function (plus, it's used in two places in that file). But you are right - your version makes it clearer what's what. I'll update the PR :+1: ","created_at":"2016-02-22T18:26:01Z","updated_at":"2016-02-22T18:26:01Z","html_url":"https://github.com/Automattic/wp-calypso/pull/3366#discussion_r53668116","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/53668116"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/3366#discussion_r53668116"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366","id":59644882,"html_url":"https://github.com/Automattic/wp-calypso/pull/3366","diff_url":"https://github.com/Automattic/wp-calypso/pull/3366.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/3366.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3366","number":3366,"state":"open","locked":false,"title":"Domains: allow different variations of root domain for supported records","user":{"login":"klimeryk","id":3392497,"avatar_url":"https://avatars.githubusercontent.com/u/3392497?v=3","gravatar_id":"","url":"https://api.github.com/users/klimeryk","html_url":"https://github.com/klimeryk","followers_url":"https://api.github.com/users/klimeryk/followers","following_url":"https://api.github.com/users/klimeryk/following{/other_user}","gists_url":"https://api.github.com/users/klimeryk/gists{/gist_id}","starred_url":"https://api.github.com/users/klimeryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klimeryk/subscriptions","organizations_url":"https://api.github.com/users/klimeryk/orgs","repos_url":"https://api.github.com/users/klimeryk/repos","events_url":"https://api.github.com/users/klimeryk/events{/privacy}","received_events_url":"https://api.github.com/users/klimeryk/received_events","type":"User","site_admin":false},"body":"Before, we only supported an empty name (subdomain) as means of inputting the root domain. Since some users might by mistake or out of habit input other variations, this change will treat the following the same as empty subdomain and add a root domain (for records that it's allowed):\r\n* `@`\r\n* `@.example.com`\r\n* `@.example.com.`\r\n* `example.com`\r\n* `example.com.`\r\n\r\nThis fixes #3318\r\n\r\n/cc\r\n@umurkontaci @aidvu for code review\r\n@BandonRandon for additional testing","created_at":"2016-02-17T13:41:12Z","updated_at":"2016-02-22T18:26:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6deb1e53599a623d6379c3074708dc6782daa0cf","assignee":{"login":"klimeryk","id":3392497,"avatar_url":"https://avatars.githubusercontent.com/u/3392497?v=3","gravatar_id":"","url":"https://api.github.com/users/klimeryk","html_url":"https://github.com/klimeryk","followers_url":"https://api.github.com/users/klimeryk/followers","following_url":"https://api.github.com/users/klimeryk/following{/other_user}","gists_url":"https://api.github.com/users/klimeryk/gists{/gist_id}","starred_url":"https://api.github.com/users/klimeryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klimeryk/subscriptions","organizations_url":"https://api.github.com/users/klimeryk/orgs","repos_url":"https://api.github.com/users/klimeryk/repos","events_url":"https://api.github.com/users/klimeryk/events{/privacy}","received_events_url":"https://api.github.com/users/klimeryk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3366/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/891ed58159b1ecda870307745b560c117cd3d252","head":{"label":"Automattic:fix/allow-alternative-root-domain-input","ref":"fix/allow-alternative-root-domain-input","sha":"891ed58159b1ecda870307745b560c117cd3d252","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-02-22T15:16:39Z","pushed_at":"2016-02-22T18:20:32Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":55259,"stargazers_count":6845,"watchers_count":6845,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":789,"mirror_url":null,"open_issues_count":1252,"forks":789,"open_issues":1252,"watchers":6845,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"c03116418730024fb2db23c23fd4a6412caebe3d","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-02-22T15:16:39Z","pushed_at":"2016-02-22T18:20:32Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":55259,"stargazers_count":6845,"watchers_count":6845,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":789,"mirror_url":null,"open_issues_count":1252,"forks":789,"open_issues":1252,"watchers":6845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/3366"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/3366"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/3366/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3366/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/891ed58159b1ecda870307745b560c117cd3d252"}}}}