Better checking for duplicate app names

This commit is contained in:
Zach Copley 2010-02-08 21:52:05 -08:00
parent bc4e843f39
commit 70d5f39ed6
2 changed files with 2 additions and 2 deletions

View File

@ -277,7 +277,7 @@ class EditApplicationAction extends OwnerDesignAction
function nameExists($name) function nameExists($name)
{ {
$newapp = Oauth_application::staticGet('name', $name); $newapp = Oauth_application::staticGet('name', $name);
if (!$newapp) { if (empty($newapp)) {
return false; return false;
} else { } else {
return $newapp->id != $this->app->id; return $newapp->id != $this->app->id;

View File

@ -290,7 +290,7 @@ class NewApplicationAction extends OwnerDesignAction
function nameExists($name) function nameExists($name)
{ {
$app = Oauth_application::staticGet('name', $name); $app = Oauth_application::staticGet('name', $name);
return ($app !== false); return !empty($app);
} }
} }