$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'
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))) {