Strict if condition

This commit is contained in:
Tobias Reich 2016-02-13 23:33:39 +01:00
parent 60e4a06df8
commit 36f43c3e27
4 changed files with 9 additions and 9 deletions

View File

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

View File

@ -13,7 +13,7 @@ final class Config {
if ($connection===false) return 'Warning: Connection failed!'; if ($connection===false) return 'Warning: Connection failed!';
// Check if user can create the database before saving the configuration // 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 // Escape data
$host = mysqli_real_escape_string($connection, $host); $host = mysqli_real_escape_string($connection, $host);

View File

@ -50,16 +50,16 @@ final class Database {
// Check if the connection was successful // Check if the connection was successful
if ($connection===false) Response::error('' . $connection->connect_error); 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 // 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 // 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 // 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; $this->connection = $connection;

View File

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