A blank username should never be allowed.

This commit is contained in:
Zach Copley 2010-03-10 03:39:05 +00:00
parent 8ee8b89dd8
commit 55e8473a7a
2 changed files with 6 additions and 1 deletions

View File

@ -241,7 +241,7 @@ class ApiAuthAction extends ApiAction
$realm = common_config('site', 'name') . ' API';
}
if (!isset($this->auth_user_nickname) && $required) {
if (empty($this->auth_user_nickname) && $required) {
header('WWW-Authenticate: Basic realm="' . $realm . '"');
// show error if the user clicks 'cancel'

View File

@ -133,6 +133,11 @@ function common_munge_password($password, $id)
function common_check_user($nickname, $password)
{
// empty nickname always unacceptable
if (empty($nickname)) {
return false;
}
$authenticatedUser = false;
if (Event::handle('StartCheckPassword', array($nickname, $password, &$authenticatedUser))) {