{"action":"created","comment":{"url":"https://api.github.com/repos/mybb/mybb/pulls/comments/33764185","id":33764185,"diff_hunk":"@@ -1599,8 +1600,35 @@\n \t\t\t$password_length = 8;\r\n \t\t}\r\n \r\n-\t\t$password = random_str($password_length);\r\n-\t\t$logindetails = update_password($user['uid'], md5($password), $user['salt']);\r\n+\t\t// Set up user handler.\r\n+\t\trequire_once 'inc/datahandlers/user.php';\r\n+\t\t$userhandler = new UserDataHandler('update');\r\n+\r\n+\t\t$userhandler->set_data(array(\r\n+\t\t\t'uid'\t\t=> $user['uid'],\r\n+\t\t\t'username'\t=> $user['username'],\r\n+\t\t\t'email'\t\t=> $user['email'],\r\n+\t\t\t'password'\t=> random_str($password_length)\r\n+\t\t));\r\n+\r\n+\t\tif(!$userhandler->verify_password())\r\n+\t\t{\r\n+\t\t\t$errors = $userhandler->get_friendly_errors();\r\n+\t\t\tif(!empty($errors[0]))\r\n+\t\t\t{\r\n+\t\t\t\terror($errors[0]);\r\n+\t\t\t}\r\n+\r\n+\t\t\terror($lang->error_unknownerror);\r\n+\t\t}\r","path":"member.php","position":38,"original_position":34,"commit_id":"92a0069fb59a7d28cd546fab48b39e6556b830db","original_commit_id":"33075f5b7bc8b57ce1e00cd4f1c772fb6b8c3bc1","user":{"login":"Destroy666x","id":3606072,"avatar_url":"https://avatars.githubusercontent.com/u/3606072?v=3","gravatar_id":"","url":"https://api.github.com/users/Destroy666x","html_url":"https://github.com/Destroy666x","followers_url":"https://api.github.com/users/Destroy666x/followers","following_url":"https://api.github.com/users/Destroy666x/following{/other_user}","gists_url":"https://api.github.com/users/Destroy666x/gists{/gist_id}","starred_url":"https://api.github.com/users/Destroy666x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Destroy666x/subscriptions","organizations_url":"https://api.github.com/users/Destroy666x/orgs","repos_url":"https://api.github.com/users/Destroy666x/repos","events_url":"https://api.github.com/users/Destroy666x/events{/privacy}","received_events_url":"https://api.github.com/users/Destroy666x/received_events","type":"User","site_admin":false},"body":"Why would it generate a password which would match the username or Email all the time? That's the only edge case left: https://github.com/mybb/mybb/blob/feature/inc/datahandlers/user.php#L190 after the latest commit. I don't think that chances for even more than 1 loop are more than 0.000000000001%.","created_at":"2015-07-02T10:13:32Z","updated_at":"2015-07-02T10:13:32Z","html_url":"https://github.com/mybb/mybb/pull/1850#discussion_r33764185","pull_request_url":"https://api.github.com/repos/mybb/mybb/pulls/1850","_links":{"self":{"href":"https://api.github.com/repos/mybb/mybb/pulls/comments/33764185"},"html":{"href":"https://github.com/mybb/mybb/pull/1850#discussion_r33764185"},"pull_request":{"href":"https://api.github.com/repos/mybb/mybb/pulls/1850"}}},"pull_request":{"url":"https://api.github.com/repos/mybb/mybb/pulls/1850","id":29569745,"html_url":"https://github.com/mybb/mybb/pull/1850","diff_url":"https://github.com/mybb/mybb/pull/1850.diff","patch_url":"https://github.com/mybb/mybb/pull/1850.patch","issue_url":"https://api.github.com/repos/mybb/mybb/issues/1850","number":1850,"state":"open","locked":false,"title":"Fix #1760 Deprecate update_password","user":{"login":"Sama34","id":1786584,"avatar_url":"https://avatars.githubusercontent.com/u/1786584?v=3","gravatar_id":"","url":"https://api.github.com/users/Sama34","html_url":"https://github.com/Sama34","followers_url":"https://api.github.com/users/Sama34/followers","following_url":"https://api.github.com/users/Sama34/following{/other_user}","gists_url":"https://api.github.com/users/Sama34/gists{/gist_id}","starred_url":"https://api.github.com/users/Sama34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sama34/subscriptions","organizations_url":"https://api.github.com/users/Sama34/orgs","repos_url":"https://api.github.com/users/Sama34/repos","events_url":"https://api.github.com/users/Sama34/events{/privacy}","received_events_url":"https://api.github.com/users/Sama34/received_events","type":"User","site_admin":false},"body":"Fix #1760 Deprecate update_password","created_at":"2015-02-18T22:26:51Z","updated_at":"2015-07-02T10:13:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a81e5dde5ccecd68d2097036cf2461116f33eaa7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mybb/mybb/pulls/1850/commits","review_comments_url":"https://api.github.com/repos/mybb/mybb/pulls/1850/comments","review_comment_url":"https://api.github.com/repos/mybb/mybb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mybb/mybb/issues/1850/comments","statuses_url":"https://api.github.com/repos/mybb/mybb/statuses/92a0069fb59a7d28cd546fab48b39e6556b830db","head":{"label":"Sama34:Fix-1760","ref":"Fix-1760","sha":"92a0069fb59a7d28cd546fab48b39e6556b830db","user":{"login":"Sama34","id":1786584,"avatar_url":"https://avatars.githubusercontent.com/u/1786584?v=3","gravatar_id":"","url":"https://api.github.com/users/Sama34","html_url":"https://github.com/Sama34","followers_url":"https://api.github.com/users/Sama34/followers","following_url":"https://api.github.com/users/Sama34/following{/other_user}","gists_url":"https://api.github.com/users/Sama34/gists{/gist_id}","starred_url":"https://api.github.com/users/Sama34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sama34/subscriptions","organizations_url":"https://api.github.com/users/Sama34/orgs","repos_url":"https://api.github.com/users/Sama34/repos","events_url":"https://api.github.com/users/Sama34/events{/privacy}","received_events_url":"https://api.github.com/users/Sama34/received_events","type":"User","site_admin":false},"repo":{"id":28308785,"name":"mybb","full_name":"Sama34/mybb","owner":{"login":"Sama34","id":1786584,"avatar_url":"https://avatars.githubusercontent.com/u/1786584?v=3","gravatar_id":"","url":"https://api.github.com/users/Sama34","html_url":"https://github.com/Sama34","followers_url":"https://api.github.com/users/Sama34/followers","following_url":"https://api.github.com/users/Sama34/following{/other_user}","gists_url":"https://api.github.com/users/Sama34/gists{/gist_id}","starred_url":"https://api.github.com/users/Sama34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sama34/subscriptions","organizations_url":"https://api.github.com/users/Sama34/orgs","repos_url":"https://api.github.com/users/Sama34/repos","events_url":"https://api.github.com/users/Sama34/events{/privacy}","received_events_url":"https://api.github.com/users/Sama34/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sama34/mybb","description":"MyBB is a free and open source forum software.","fork":true,"url":"https://api.github.com/repos/Sama34/mybb","forks_url":"https://api.github.com/repos/Sama34/mybb/forks","keys_url":"https://api.github.com/repos/Sama34/mybb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sama34/mybb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sama34/mybb/teams","hooks_url":"https://api.github.com/repos/Sama34/mybb/hooks","issue_events_url":"https://api.github.com/repos/Sama34/mybb/issues/events{/number}","events_url":"https://api.github.com/repos/Sama34/mybb/events","assignees_url":"https://api.github.com/repos/Sama34/mybb/assignees{/user}","branches_url":"https://api.github.com/repos/Sama34/mybb/branches{/branch}","tags_url":"https://api.github.com/repos/Sama34/mybb/tags","blobs_url":"https://api.github.com/repos/Sama34/mybb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sama34/mybb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sama34/mybb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sama34/mybb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sama34/mybb/statuses/{sha}","languages_url":"https://api.github.com/repos/Sama34/mybb/languages","stargazers_url":"https://api.github.com/repos/Sama34/mybb/stargazers","contributors_url":"https://api.github.com/repos/Sama34/mybb/contributors","subscribers_url":"https://api.github.com/repos/Sama34/mybb/subscribers","subscription_url":"https://api.github.com/repos/Sama34/mybb/subscription","commits_url":"https://api.github.com/repos/Sama34/mybb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sama34/mybb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sama34/mybb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sama34/mybb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sama34/mybb/contents/{+path}","compare_url":"https://api.github.com/repos/Sama34/mybb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sama34/mybb/merges","archive_url":"https://api.github.com/repos/Sama34/mybb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sama34/mybb/downloads","issues_url":"https://api.github.com/repos/Sama34/mybb/issues{/number}","pulls_url":"https://api.github.com/repos/Sama34/mybb/pulls{/number}","milestones_url":"https://api.github.com/repos/Sama34/mybb/milestones{/number}","notifications_url":"https://api.github.com/repos/Sama34/mybb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sama34/mybb/labels{/name}","releases_url":"https://api.github.com/repos/Sama34/mybb/releases{/id}","created_at":"2014-12-21T18:32:44Z","updated_at":"2015-02-18T21:09:36Z","pushed_at":"2015-07-02T03:31:44Z","git_url":"git://github.com/Sama34/mybb.git","ssh_url":"git@github.com:Sama34/mybb.git","clone_url":"https://github.com/Sama34/mybb.git","svn_url":"https://github.com/Sama34/mybb","homepage":"http://www.mybb.com","size":26979,"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":"feature"}},"base":{"label":"mybb:feature","ref":"feature","sha":"d04ce1b8eb89769f511acf765b2949b8e3474bd3","user":{"login":"mybb","id":328641,"avatar_url":"https://avatars.githubusercontent.com/u/328641?v=3","gravatar_id":"","url":"https://api.github.com/users/mybb","html_url":"https://github.com/mybb","followers_url":"https://api.github.com/users/mybb/followers","following_url":"https://api.github.com/users/mybb/following{/other_user}","gists_url":"https://api.github.com/users/mybb/gists{/gist_id}","starred_url":"https://api.github.com/users/mybb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mybb/subscriptions","organizations_url":"https://api.github.com/users/mybb/orgs","repos_url":"https://api.github.com/users/mybb/repos","events_url":"https://api.github.com/users/mybb/events{/privacy}","received_events_url":"https://api.github.com/users/mybb/received_events","type":"Organization","site_admin":false},"repo":{"id":4649599,"name":"mybb","full_name":"mybb/mybb","owner":{"login":"mybb","id":328641,"avatar_url":"https://avatars.githubusercontent.com/u/328641?v=3","gravatar_id":"","url":"https://api.github.com/users/mybb","html_url":"https://github.com/mybb","followers_url":"https://api.github.com/users/mybb/followers","following_url":"https://api.github.com/users/mybb/following{/other_user}","gists_url":"https://api.github.com/users/mybb/gists{/gist_id}","starred_url":"https://api.github.com/users/mybb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mybb/subscriptions","organizations_url":"https://api.github.com/users/mybb/orgs","repos_url":"https://api.github.com/users/mybb/repos","events_url":"https://api.github.com/users/mybb/events{/privacy}","received_events_url":"https://api.github.com/users/mybb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mybb/mybb","description":"MyBB is a free and open source forum software.","fork":false,"url":"https://api.github.com/repos/mybb/mybb","forks_url":"https://api.github.com/repos/mybb/mybb/forks","keys_url":"https://api.github.com/repos/mybb/mybb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mybb/mybb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mybb/mybb/teams","hooks_url":"https://api.github.com/repos/mybb/mybb/hooks","issue_events_url":"https://api.github.com/repos/mybb/mybb/issues/events{/number}","events_url":"https://api.github.com/repos/mybb/mybb/events","assignees_url":"https://api.github.com/repos/mybb/mybb/assignees{/user}","branches_url":"https://api.github.com/repos/mybb/mybb/branches{/branch}","tags_url":"https://api.github.com/repos/mybb/mybb/tags","blobs_url":"https://api.github.com/repos/mybb/mybb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mybb/mybb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mybb/mybb/git/refs{/sha}","trees_url":"https://api.github.com/repos/mybb/mybb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mybb/mybb/statuses/{sha}","languages_url":"https://api.github.com/repos/mybb/mybb/languages","stargazers_url":"https://api.github.com/repos/mybb/mybb/stargazers","contributors_url":"https://api.github.com/repos/mybb/mybb/contributors","subscribers_url":"https://api.github.com/repos/mybb/mybb/subscribers","subscription_url":"https://api.github.com/repos/mybb/mybb/subscription","commits_url":"https://api.github.com/repos/mybb/mybb/commits{/sha}","git_commits_url":"https://api.github.com/repos/mybb/mybb/git/commits{/sha}","comments_url":"https://api.github.com/repos/mybb/mybb/comments{/number}","issue_comment_url":"https://api.github.com/repos/mybb/mybb/issues/comments{/number}","contents_url":"https://api.github.com/repos/mybb/mybb/contents/{+path}","compare_url":"https://api.github.com/repos/mybb/mybb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mybb/mybb/merges","archive_url":"https://api.github.com/repos/mybb/mybb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mybb/mybb/downloads","issues_url":"https://api.github.com/repos/mybb/mybb/issues{/number}","pulls_url":"https://api.github.com/repos/mybb/mybb/pulls{/number}","milestones_url":"https://api.github.com/repos/mybb/mybb/milestones{/number}","notifications_url":"https://api.github.com/repos/mybb/mybb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mybb/mybb/labels{/name}","releases_url":"https://api.github.com/repos/mybb/mybb/releases{/id}","created_at":"2012-06-13T10:34:46Z","updated_at":"2015-06-25T10:47:31Z","pushed_at":"2015-07-02T03:31:44Z","git_url":"git://github.com/mybb/mybb.git","ssh_url":"git@github.com:mybb/mybb.git","clone_url":"https://github.com/mybb/mybb.git","svn_url":"https://github.com/mybb/mybb","homepage":"http://www.mybb.com","size":39864,"stargazers_count":254,"watchers_count":254,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":203,"mirror_url":null,"open_issues_count":206,"forks":203,"open_issues":206,"watchers":254,"default_branch":"feature"}},"_links":{"self":{"href":"https://api.github.com/repos/mybb/mybb/pulls/1850"},"html":{"href":"https://github.com/mybb/mybb/pull/1850"},"issue":{"href":"https://api.github.com/repos/mybb/mybb/issues/1850"},"comments":{"href":"https://api.github.com/repos/mybb/mybb/issues/1850/comments"},"review_comments":{"href":"https://api.github.com/repos/mybb/mybb/pulls/1850/comments"},"review_comment":{"href":"https://api.github.com/repos/mybb/mybb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mybb/mybb/pulls/1850/commits"},"statuses":{"href":"https://api.github.com/repos/mybb/mybb/statuses/92a0069fb59a7d28cd546fab48b39e6556b830db"}}}}