Strict if condition

pull/462/head
Tobias Reich 8 years ago
parent 60e4a06df8
commit 36f43c3e27

@ -55,7 +55,7 @@ final class Guest extends Access {
$album = new Album($_POST['albumID']);
if ($album->getPublic()) {
if ($album->getPublic()===true) {
// Album public
if ($album->checkPassword($_POST['password'])) Response::json($album->get());
@ -76,7 +76,7 @@ final class Guest extends Access {
$album = new Album($_POST['albumID']);
if ($album->getPublic()) {
if ($album->getPublic()===true) {
// Album public
if ($album->checkPassword($_POST['password'])) echo true;

@ -13,7 +13,7 @@ final class Config {
if ($connection===false) return 'Warning: Connection failed!';
// Check if user can create the database before saving the configuration
if (!Database::createDatabase($connection, $name)) return 'Warning: Creation failed!';
if (Database::createDatabase($connection, $name)===false) return 'Warning: Creation failed!';
// Escape data
$host = mysqli_real_escape_string($connection, $host);

@ -50,16 +50,16 @@ final class Database {
// Check if the connection was successful
if ($connection===false) Response::error('' . $connection->connect_error);
if (!self::setCharset($connection)) Response::error('Could not set database charset!');
if (self::setCharset($connection)===false) Response::error('Could not set database charset!');
// Create database
if (!self::createDatabase($connection, $name)) Response::error('Could not create database!');
if (self::createDatabase($connection, $name)===false) Response::error('Could not create database!');
// Create tables
if (!self::createTables($connection)) Response::error('Could not create tables!');
if (self::createTables($connection)===false) Response::error('Could not create tables!');
// Update database
if (!self::update($connection, $name)) Response::error('Could not update database and tables!');
if (self::update($connection, $name)===false) Response::error('Could not update database and tables!');
$this->connection = $connection;

@ -66,10 +66,10 @@ final class Settings {
if ($oldPassword===self::get()['password']||self::get()['password']===crypt($oldPassword, self::get()['password'])) {
// Save username
if (self::setUsername($username)!==true) Response::error('Updating username failed!');
if (self::setUsername($username)===false) Response::error('Updating username failed!');
// Save password
if (self::setPassword($password)!==true) Response::error('Updating password failed!');
if (self::setPassword($password)===false) Response::error('Updating password failed!');
return true;

Loading…
Cancel
Save