We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 58ba82e7 authored by P. J. McDermott's avatar P. J. McDermott

Clean up code in gnukebox/temp-utils.php.

parent fbbbc71d
......@@ -28,8 +28,8 @@ function username_to_uniqueid($username) {
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
try {
$uniqueid = $adodb->GetOne('SELECT uniqueid from Users where lower(username) = lower('.$adodb->qstr($username).')');
} catch (exception $e) {
$uniqueid = $adodb->GetOne('SELECT uniqueid from Users where lower(username) = lower(' . $adodb->qstr($username) . ')');
} catch (Exception $e) {
return 0;
}
......@@ -41,12 +41,10 @@ function uniqueid_to_username($uniqueid) {
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
try {
$username = $adodb->GetOne('SELECT username from Users where uniqueid = '.($uniqueid));
} catch (exception $e) {
$username = $adodb->GetOne('SELECT username from Users where uniqueid = ' . ($uniqueid));
} catch (Exception $e) {
return "BROKEN($uniqueid)";
}
return $username;
}
?>
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