{"action":"created","comment":{"url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/comments/26386704","id":26386704,"diff_hunk":"@@ -358,6 +358,38 @@ function islandora_ip_embargo_add_range_form($form, &$form_state, $list_identifi\n }\n \n /**\n+ * Validate handler for adding an IP Range.\n+ *\n+ * @param array $form\n+ *   The Drupal form definition.\n+ * @param array $form_state\n+ *   The Drupal form state.\n+ */\n+function islandora_ip_embargo_add_range_form_validate(array $form, array &$form_state) {\n+  $comparable_low = ip2long($form_state['values']['low_end']);\n+  $comparable_high = ip2long($form_state['values']['high_end']);\n+\n+  $error = FALSE;\n+  if (empty($comparable_low)) {\n+    $error = TRUE;\n+    form_set_error('low_end', t('Low end IP is not valid.'));\n+  }\n+\n+  if (empty($comparable_high)) {\n+    $error = TRUE;\n+    form_set_error('high_end', t('High end IP is not valid.'));\n+  }\n+\n+  if ($error) {\n+    form_set_error('', t('IP addresses must be in dot-decimal notation with no leading zeros.'));","path":"includes/forms.inc","position":27,"original_position":27,"commit_id":"90ae9c823b25e979958dc5c924f518d61b1737a8","original_commit_id":"90ae9c823b25e979958dc5c924f518d61b1737a8","user":{"login":"nhart","id":766086,"avatar_url":"https://avatars.githubusercontent.com/u/766086?v=3","gravatar_id":"","url":"https://api.github.com/users/nhart","html_url":"https://github.com/nhart","followers_url":"https://api.github.com/users/nhart/followers","following_url":"https://api.github.com/users/nhart/following{/other_user}","gists_url":"https://api.github.com/users/nhart/gists{/gist_id}","starred_url":"https://api.github.com/users/nhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhart/subscriptions","organizations_url":"https://api.github.com/users/nhart/orgs","repos_url":"https://api.github.com/users/nhart/repos","events_url":"https://api.github.com/users/nhart/events{/privacy}","received_events_url":"https://api.github.com/users/nhart/received_events","type":"User","site_admin":false},"body":"can you give me an example of what should work? I've tried a couple of different formats, ip2long hasn't appreciated any of them yet.\r\n\r\n0xC0.0x00.0x02.0xEB, 0300.0000.0002.0353, 0xC00002EB, 3221226219, and 030000001353 do not work in ip2long","created_at":"2015-03-13T13:53:51Z","updated_at":"2015-03-13T13:53:51Z","html_url":"https://github.com/Islandora/islandora_ip_embargo/pull/22#discussion_r26386704","pull_request_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/comments/26386704"},"html":{"href":"https://github.com/Islandora/islandora_ip_embargo/pull/22#discussion_r26386704"},"pull_request":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22","id":31122899,"html_url":"https://github.com/Islandora/islandora_ip_embargo/pull/22","diff_url":"https://github.com/Islandora/islandora_ip_embargo/pull/22.diff","patch_url":"https://github.com/Islandora/islandora_ip_embargo/pull/22.patch","issue_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/issues/22","number":22,"state":"open","locked":false,"title":"validate ip ranges added, bug fix, only checking first 10 ranges in list","user":{"login":"nhart","id":766086,"avatar_url":"https://avatars.githubusercontent.com/u/766086?v=3","gravatar_id":"","url":"https://api.github.com/users/nhart","html_url":"https://github.com/nhart","followers_url":"https://api.github.com/users/nhart/followers","following_url":"https://api.github.com/users/nhart/following{/other_user}","gists_url":"https://api.github.com/users/nhart/gists{/gist_id}","starred_url":"https://api.github.com/users/nhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhart/subscriptions","organizations_url":"https://api.github.com/users/nhart/orgs","repos_url":"https://api.github.com/users/nhart/repos","events_url":"https://api.github.com/users/nhart/events{/privacy}","received_events_url":"https://api.github.com/users/nhart/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-13T12:50:05Z","updated_at":"2015-03-13T13:53:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae95802a52996d65c72a01c58b7da27c12b30c3e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22/commits","review_comments_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22/comments","review_comment_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/issues/22/comments","statuses_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/statuses/90ae9c823b25e979958dc5c924f518d61b1737a8","head":{"label":"nhart:7.x-issues","ref":"7.x-issues","sha":"90ae9c823b25e979958dc5c924f518d61b1737a8","user":{"login":"nhart","id":766086,"avatar_url":"https://avatars.githubusercontent.com/u/766086?v=3","gravatar_id":"","url":"https://api.github.com/users/nhart","html_url":"https://github.com/nhart","followers_url":"https://api.github.com/users/nhart/followers","following_url":"https://api.github.com/users/nhart/following{/other_user}","gists_url":"https://api.github.com/users/nhart/gists{/gist_id}","starred_url":"https://api.github.com/users/nhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhart/subscriptions","organizations_url":"https://api.github.com/users/nhart/orgs","repos_url":"https://api.github.com/users/nhart/repos","events_url":"https://api.github.com/users/nhart/events{/privacy}","received_events_url":"https://api.github.com/users/nhart/received_events","type":"User","site_admin":false},"repo":{"id":18998622,"name":"islandora_ip_embargo","full_name":"nhart/islandora_ip_embargo","owner":{"login":"nhart","id":766086,"avatar_url":"https://avatars.githubusercontent.com/u/766086?v=3","gravatar_id":"","url":"https://api.github.com/users/nhart","html_url":"https://github.com/nhart","followers_url":"https://api.github.com/users/nhart/followers","following_url":"https://api.github.com/users/nhart/following{/other_user}","gists_url":"https://api.github.com/users/nhart/gists{/gist_id}","starred_url":"https://api.github.com/users/nhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhart/subscriptions","organizations_url":"https://api.github.com/users/nhart/orgs","repos_url":"https://api.github.com/users/nhart/repos","events_url":"https://api.github.com/users/nhart/events{/privacy}","received_events_url":"https://api.github.com/users/nhart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nhart/islandora_ip_embargo","description":"A Drupal based approach to embargoing content based on IP ranges.","fork":true,"url":"https://api.github.com/repos/nhart/islandora_ip_embargo","forks_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/forks","keys_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/teams","hooks_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/hooks","issue_events_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/issues/events{/number}","events_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/events","assignees_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/assignees{/user}","branches_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/branches{/branch}","tags_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/tags","blobs_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/statuses/{sha}","languages_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/languages","stargazers_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/stargazers","contributors_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/contributors","subscribers_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/subscribers","subscription_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/subscription","commits_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/contents/{+path}","compare_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/merges","archive_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/downloads","issues_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/issues{/number}","pulls_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/pulls{/number}","milestones_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/milestones{/number}","notifications_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/labels{/name}","releases_url":"https://api.github.com/repos/nhart/islandora_ip_embargo/releases{/id}","created_at":"2014-04-21T16:27:31Z","updated_at":"2014-05-15T00:31:55Z","pushed_at":"2015-03-13T12:47:28Z","git_url":"git://github.com/nhart/islandora_ip_embargo.git","ssh_url":"git@github.com:nhart/islandora_ip_embargo.git","clone_url":"https://github.com/nhart/islandora_ip_embargo.git","svn_url":"https://github.com/nhart/islandora_ip_embargo","homepage":null,"size":166,"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":"7.x"}},"base":{"label":"Islandora:7.x","ref":"7.x","sha":"811cc79e405d283c34c0f59a8ef8b077bfc307c5","user":{"login":"Islandora","id":494054,"avatar_url":"https://avatars.githubusercontent.com/u/494054?v=3","gravatar_id":"","url":"https://api.github.com/users/Islandora","html_url":"https://github.com/Islandora","followers_url":"https://api.github.com/users/Islandora/followers","following_url":"https://api.github.com/users/Islandora/following{/other_user}","gists_url":"https://api.github.com/users/Islandora/gists{/gist_id}","starred_url":"https://api.github.com/users/Islandora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Islandora/subscriptions","organizations_url":"https://api.github.com/users/Islandora/orgs","repos_url":"https://api.github.com/users/Islandora/repos","events_url":"https://api.github.com/users/Islandora/events{/privacy}","received_events_url":"https://api.github.com/users/Islandora/received_events","type":"Organization","site_admin":false},"repo":{"id":10553589,"name":"islandora_ip_embargo","full_name":"Islandora/islandora_ip_embargo","owner":{"login":"Islandora","id":494054,"avatar_url":"https://avatars.githubusercontent.com/u/494054?v=3","gravatar_id":"","url":"https://api.github.com/users/Islandora","html_url":"https://github.com/Islandora","followers_url":"https://api.github.com/users/Islandora/followers","following_url":"https://api.github.com/users/Islandora/following{/other_user}","gists_url":"https://api.github.com/users/Islandora/gists{/gist_id}","starred_url":"https://api.github.com/users/Islandora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Islandora/subscriptions","organizations_url":"https://api.github.com/users/Islandora/orgs","repos_url":"https://api.github.com/users/Islandora/repos","events_url":"https://api.github.com/users/Islandora/events{/privacy}","received_events_url":"https://api.github.com/users/Islandora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Islandora/islandora_ip_embargo","description":"A Drupal based approach to embargoing content based on IP ranges.","fork":false,"url":"https://api.github.com/repos/Islandora/islandora_ip_embargo","forks_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/forks","keys_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/teams","hooks_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/hooks","issue_events_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/issues/events{/number}","events_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/events","assignees_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/assignees{/user}","branches_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/branches{/branch}","tags_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/tags","blobs_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/statuses/{sha}","languages_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/languages","stargazers_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/stargazers","contributors_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/contributors","subscribers_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/subscribers","subscription_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/subscription","commits_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/contents/{+path}","compare_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/merges","archive_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/downloads","issues_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/issues{/number}","pulls_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls{/number}","milestones_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/milestones{/number}","notifications_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/labels{/name}","releases_url":"https://api.github.com/repos/Islandora/islandora_ip_embargo/releases{/id}","created_at":"2013-06-07T16:02:35Z","updated_at":"2014-12-16T15:10:34Z","pushed_at":"2014-12-16T15:10:34Z","git_url":"git://github.com/Islandora/islandora_ip_embargo.git","ssh_url":"git@github.com:Islandora/islandora_ip_embargo.git","clone_url":"https://github.com/Islandora/islandora_ip_embargo.git","svn_url":"https://github.com/Islandora/islandora_ip_embargo","homepage":null,"size":304,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":2,"default_branch":"7.x"}},"_links":{"self":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22"},"html":{"href":"https://github.com/Islandora/islandora_ip_embargo/pull/22"},"issue":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/issues/22"},"comments":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/Islandora/islandora_ip_embargo/statuses/90ae9c823b25e979958dc5c924f518d61b1737a8"}}}}