{"action":"opened","number":11,"pull_request":{"url":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/11","id":92004159,"html_url":"https://github.com/onassar/PHP-Pagination/pull/11","diff_url":"https://github.com/onassar/PHP-Pagination/pull/11.diff","patch_url":"https://github.com/onassar/PHP-Pagination/pull/11.patch","issue_url":"https://api.github.com/repos/onassar/PHP-Pagination/issues/11","number":11,"state":"open","locked":false,"title":"Cast Current, RPP, and Total to integers when set. Fixes #10","user":{"login":"AlbinoDrought","id":852873,"avatar_url":"https://avatars.githubusercontent.com/u/852873?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbinoDrought","html_url":"https://github.com/AlbinoDrought","followers_url":"https://api.github.com/users/AlbinoDrought/followers","following_url":"https://api.github.com/users/AlbinoDrought/following{/other_user}","gists_url":"https://api.github.com/users/AlbinoDrought/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbinoDrought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbinoDrought/subscriptions","organizations_url":"https://api.github.com/users/AlbinoDrought/orgs","repos_url":"https://api.github.com/users/AlbinoDrought/repos","events_url":"https://api.github.com/users/AlbinoDrought/events{/privacy}","received_events_url":"https://api.github.com/users/AlbinoDrought/received_events","type":"User","site_admin":false},"body":"Here is some example code that demonstrates the issue:\r\n\r\n```\r\n<?php\r\n\r\n// source inclusion\r\nrequire_once 'Pagination.class.php';\r\n\r\n// determine page (based on <_GET>), but do not cast to (int)\r\n$page = isset($_GET['page']) ? $_GET['page'] : 1;\r\n\r\n// instantiate; set current page; set number of records\r\n$pagination = (new Pagination());\r\n$pagination->setCurrent($page);\r\n$pagination->setTotal(200);\r\n\r\n// grab rendered/parsed pagination markup\r\n$markup = $pagination->parse();\r\n\r\n$base_url = parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH);\r\n\r\n$url_raw = $base_url;\r\n$url_broken = $base_url . \"?page=1\";\r\n\r\n?>\r\n\r\n<div>\r\n    <?=$markup?>\r\n</div>\r\n<a href=\"<?=$url_raw?>\">Raw (working) URL, without ?page</a><br />\r\n<a href=\"<?=$url_broken?>\">Broken URL, with ?page</a><br />\r\n```\r\n\r\nWithout this fix, when a string value (raw from $_GET) is passed to setCurrent (the above \"Broken URL\"):\r\n\r\n`« Previous\r\n-1\r\n0\r\n1\r\n2\r\n3\r\nNext »`\r\n\r\nWith this fix:\r\n\r\n`« Previous\r\n1\r\n2\r\n3\r\n4\r\n5\r\nNext »`","created_at":"2016-11-02T16:19:53Z","updated_at":"2016-11-02T16:19:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/11/commits","review_comments_url":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/11/comments","review_comment_url":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onassar/PHP-Pagination/issues/11/comments","statuses_url":"https://api.github.com/repos/onassar/PHP-Pagination/statuses/b6f1e3b1971de345c4dd6e97a10adf10b4f5b1d3","head":{"label":"AlbinoDrought:master","ref":"master","sha":"b6f1e3b1971de345c4dd6e97a10adf10b4f5b1d3","user":{"login":"AlbinoDrought","id":852873,"avatar_url":"https://avatars.githubusercontent.com/u/852873?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbinoDrought","html_url":"https://github.com/AlbinoDrought","followers_url":"https://api.github.com/users/AlbinoDrought/followers","following_url":"https://api.github.com/users/AlbinoDrought/following{/other_user}","gists_url":"https://api.github.com/users/AlbinoDrought/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbinoDrought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbinoDrought/subscriptions","organizations_url":"https://api.github.com/users/AlbinoDrought/orgs","repos_url":"https://api.github.com/users/AlbinoDrought/repos","events_url":"https://api.github.com/users/AlbinoDrought/events{/privacy}","received_events_url":"https://api.github.com/users/AlbinoDrought/received_events","type":"User","site_admin":false},"repo":{"id":72657169,"name":"PHP-Pagination","full_name":"AlbinoDrought/PHP-Pagination","owner":{"login":"AlbinoDrought","id":852873,"avatar_url":"https://avatars.githubusercontent.com/u/852873?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbinoDrought","html_url":"https://github.com/AlbinoDrought","followers_url":"https://api.github.com/users/AlbinoDrought/followers","following_url":"https://api.github.com/users/AlbinoDrought/following{/other_user}","gists_url":"https://api.github.com/users/AlbinoDrought/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbinoDrought/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbinoDrought/subscriptions","organizations_url":"https://api.github.com/users/AlbinoDrought/orgs","repos_url":"https://api.github.com/users/AlbinoDrought/repos","events_url":"https://api.github.com/users/AlbinoDrought/events{/privacy}","received_events_url":"https://api.github.com/users/AlbinoDrought/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlbinoDrought/PHP-Pagination","description":"Simple and lightweight PHP pagination class that works with Twitter Bootstrap perfectly. Manages pagination variables through instantiable class, and markup rendering through view-like include file.","fork":true,"url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination","forks_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/forks","keys_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/teams","hooks_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/hooks","issue_events_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/issues/events{/number}","events_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/events","assignees_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/assignees{/user}","branches_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/branches{/branch}","tags_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/tags","blobs_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/statuses/{sha}","languages_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/languages","stargazers_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/stargazers","contributors_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/contributors","subscribers_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/subscribers","subscription_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/subscription","commits_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/contents/{+path}","compare_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/merges","archive_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/downloads","issues_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/issues{/number}","pulls_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/pulls{/number}","milestones_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/milestones{/number}","notifications_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/labels{/name}","releases_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/releases{/id}","deployments_url":"https://api.github.com/repos/AlbinoDrought/PHP-Pagination/deployments","created_at":"2016-11-02T16:06:22Z","updated_at":"2016-11-02T16:06:23Z","pushed_at":"2016-11-02T16:16:18Z","git_url":"git://github.com/AlbinoDrought/PHP-Pagination.git","ssh_url":"git@github.com:AlbinoDrought/PHP-Pagination.git","clone_url":"https://github.com/AlbinoDrought/PHP-Pagination.git","svn_url":"https://github.com/AlbinoDrought/PHP-Pagination","homepage":"http://web.onassar.com/blog/2012/06/09/github-project-php-pagination/","size":39,"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":"master"}},"base":{"label":"onassar:master","ref":"master","sha":"77dac00d837e4d937ea64108c73bbb1649e5e821","user":{"login":"onassar","id":612938,"avatar_url":"https://avatars.githubusercontent.com/u/612938?v=3","gravatar_id":"","url":"https://api.github.com/users/onassar","html_url":"https://github.com/onassar","followers_url":"https://api.github.com/users/onassar/followers","following_url":"https://api.github.com/users/onassar/following{/other_user}","gists_url":"https://api.github.com/users/onassar/gists{/gist_id}","starred_url":"https://api.github.com/users/onassar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onassar/subscriptions","organizations_url":"https://api.github.com/users/onassar/orgs","repos_url":"https://api.github.com/users/onassar/repos","events_url":"https://api.github.com/users/onassar/events{/privacy}","received_events_url":"https://api.github.com/users/onassar/received_events","type":"User","site_admin":false},"repo":{"id":2039981,"name":"PHP-Pagination","full_name":"onassar/PHP-Pagination","owner":{"login":"onassar","id":612938,"avatar_url":"https://avatars.githubusercontent.com/u/612938?v=3","gravatar_id":"","url":"https://api.github.com/users/onassar","html_url":"https://github.com/onassar","followers_url":"https://api.github.com/users/onassar/followers","following_url":"https://api.github.com/users/onassar/following{/other_user}","gists_url":"https://api.github.com/users/onassar/gists{/gist_id}","starred_url":"https://api.github.com/users/onassar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onassar/subscriptions","organizations_url":"https://api.github.com/users/onassar/orgs","repos_url":"https://api.github.com/users/onassar/repos","events_url":"https://api.github.com/users/onassar/events{/privacy}","received_events_url":"https://api.github.com/users/onassar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onassar/PHP-Pagination","description":"Simple and lightweight PHP pagination class that works with Twitter Bootstrap perfectly. Manages pagination variables through instantiable class, and markup rendering through view-like include file.","fork":false,"url":"https://api.github.com/repos/onassar/PHP-Pagination","forks_url":"https://api.github.com/repos/onassar/PHP-Pagination/forks","keys_url":"https://api.github.com/repos/onassar/PHP-Pagination/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onassar/PHP-Pagination/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onassar/PHP-Pagination/teams","hooks_url":"https://api.github.com/repos/onassar/PHP-Pagination/hooks","issue_events_url":"https://api.github.com/repos/onassar/PHP-Pagination/issues/events{/number}","events_url":"https://api.github.com/repos/onassar/PHP-Pagination/events","assignees_url":"https://api.github.com/repos/onassar/PHP-Pagination/assignees{/user}","branches_url":"https://api.github.com/repos/onassar/PHP-Pagination/branches{/branch}","tags_url":"https://api.github.com/repos/onassar/PHP-Pagination/tags","blobs_url":"https://api.github.com/repos/onassar/PHP-Pagination/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onassar/PHP-Pagination/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onassar/PHP-Pagination/git/refs{/sha}","trees_url":"https://api.github.com/repos/onassar/PHP-Pagination/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onassar/PHP-Pagination/statuses/{sha}","languages_url":"https://api.github.com/repos/onassar/PHP-Pagination/languages","stargazers_url":"https://api.github.com/repos/onassar/PHP-Pagination/stargazers","contributors_url":"https://api.github.com/repos/onassar/PHP-Pagination/contributors","subscribers_url":"https://api.github.com/repos/onassar/PHP-Pagination/subscribers","subscription_url":"https://api.github.com/repos/onassar/PHP-Pagination/subscription","commits_url":"https://api.github.com/repos/onassar/PHP-Pagination/commits{/sha}","git_commits_url":"https://api.github.com/repos/onassar/PHP-Pagination/git/commits{/sha}","comments_url":"https://api.github.com/repos/onassar/PHP-Pagination/comments{/number}","issue_comment_url":"https://api.github.com/repos/onassar/PHP-Pagination/issues/comments{/number}","contents_url":"https://api.github.com/repos/onassar/PHP-Pagination/contents/{+path}","compare_url":"https://api.github.com/repos/onassar/PHP-Pagination/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onassar/PHP-Pagination/merges","archive_url":"https://api.github.com/repos/onassar/PHP-Pagination/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onassar/PHP-Pagination/downloads","issues_url":"https://api.github.com/repos/onassar/PHP-Pagination/issues{/number}","pulls_url":"https://api.github.com/repos/onassar/PHP-Pagination/pulls{/number}","milestones_url":"https://api.github.com/repos/onassar/PHP-Pagination/milestones{/number}","notifications_url":"https://api.github.com/repos/onassar/PHP-Pagination/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onassar/PHP-Pagination/labels{/name}","releases_url":"https://api.github.com/repos/onassar/PHP-Pagination/releases{/id}","deployments_url":"https://api.github.com/repos/onassar/PHP-Pagination/deployments","created_at":"2011-07-13T04:05:15Z","updated_at":"2016-10-21T23:00:49Z","pushed_at":"2016-04-28T11:56:04Z","git_url":"git://github.com/onassar/PHP-Pagination.git","ssh_url":"git@github.com:onassar/PHP-Pagination.git","clone_url":"https://github.com/onassar/PHP-Pagination.git","svn_url":"https://github.com/onassar/PHP-Pagination","homepage":"http://web.onassar.com/blog/2012/06/09/github-project-php-pagination/","size":39,"stargazers_count":89,"watchers_count":89,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":65,"mirror_url":null,"open_issues_count":6,"forks":65,"open_issues":6,"watchers":89,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/11"},"html":{"href":"https://github.com/onassar/PHP-Pagination/pull/11"},"issue":{"href":"https://api.github.com/repos/onassar/PHP-Pagination/issues/11"},"comments":{"href":"https://api.github.com/repos/onassar/PHP-Pagination/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onassar/PHP-Pagination/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/onassar/PHP-Pagination/statuses/b6f1e3b1971de345c4dd6e97a10adf10b4f5b1d3"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":3,"changed_files":1}}
{"actor":{"display_login":"AlbinoDrought"}}