Commit 01d8fbee authored by Luke081515's avatar Luke081515
Browse files

Use better handling

* Better handling for "missing" at getUserEditcount
* Follow-up form !15
parent feafdf27
......@@ -596,7 +596,7 @@ class Core extends Password {
*/
public function getUserEditcount ($username) {
$result = $this->httpRequest('action=query&format=json&list=users&usprop=editcount&ususers=' . urlencode($username), $this->job, 'GET');
if (strpos($result, "missing") !== false)
if (isset($result['query']['users'][0]['missing']))
return false;
$result = json_decode($result, true);
return $result['query']['users'][0]['editcount'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment