Use strict compare for booleans
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
996975262f
commit
64c1b26bac
@ -795,7 +795,7 @@ if ($go_sql) {
|
||||
'sql_query',
|
||||
PhpMyAdmin\Util::getMessage($msg, $sql_query, 'success')
|
||||
);
|
||||
} elseif ($result == false) {
|
||||
} elseif ($result === false) {
|
||||
$response->setRequestStatus(false);
|
||||
$response->addJSON('message', PhpMyAdmin\Message::error($msg));
|
||||
} else {
|
||||
|
||||
@ -185,7 +185,7 @@ class VariablesController extends AbstractController
|
||||
$varValue[1]
|
||||
);
|
||||
|
||||
if ($isHtmlFormatted == false) {
|
||||
if ($isHtmlFormatted === false) {
|
||||
$json['variable'] = htmlspecialchars($formattedValue);
|
||||
} else {
|
||||
$json['variable'] = $formattedValue;
|
||||
|
||||
@ -1422,7 +1422,7 @@ class StructureController extends AbstractController
|
||||
$max_digits,
|
||||
$decimals
|
||||
);
|
||||
if ($mergetable == false) {
|
||||
if ($mergetable === false) {
|
||||
list($index_size, $index_unit) = Util::formatByteDown(
|
||||
$this->_showtable['Index_length'],
|
||||
$max_digits,
|
||||
|
||||
@ -725,7 +725,7 @@ class NavigationTree
|
||||
if ($sepPos != false
|
||||
&& $sepPos != mb_strlen($child->name)
|
||||
&& $sepPos != 0
|
||||
&& ($prefixPos == false || $sepPos < $prefixPos)
|
||||
&& ($prefixPos === false || $sepPos < $prefixPos)
|
||||
) {
|
||||
$prefixPos = $sepPos;
|
||||
}
|
||||
|
||||
@ -1470,7 +1470,7 @@ class Relation
|
||||
$moreThanLimit = $this->dbi->getTable($foreign_db, $foreign_table)
|
||||
->checkIfMinRecordsExist($GLOBALS['cfg']['ForeignKeyMaxLimit']);
|
||||
|
||||
if ($override_total == true
|
||||
if ($override_total === true
|
||||
|| ! $moreThanLimit
|
||||
) {
|
||||
// foreign_display can be false if no display field defined:
|
||||
|
||||
@ -194,9 +194,9 @@ class Response
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setAjax($isAjax)
|
||||
public function setAjax(bool $isAjax): void
|
||||
{
|
||||
$this->_isAjax = (bool) $isAjax;
|
||||
$this->_isAjax = $isAjax;
|
||||
$this->_header->setAjax($this->_isAjax);
|
||||
$this->_footer->setAjax($this->_isAjax);
|
||||
}
|
||||
@ -222,9 +222,9 @@ class Response
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setRequestStatus($state)
|
||||
public function setRequestStatus(bool $state): void
|
||||
{
|
||||
$this->_isSuccess = ($state == true);
|
||||
$this->_isSuccess = ($state === true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -233,7 +233,7 @@ class Response
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAjax()
|
||||
public function isAjax(): bool
|
||||
{
|
||||
return $this->_isAjax;
|
||||
}
|
||||
|
||||
@ -2554,7 +2554,7 @@ class Privileges
|
||||
}
|
||||
|
||||
$response = Response::getInstance();
|
||||
if ($response->isAjax() == true
|
||||
if ($response->isAjax() === true
|
||||
&& empty($_REQUEST['ajax_page_request'])
|
||||
) {
|
||||
$message = Message::success(__('User has been added.'));
|
||||
|
||||
@ -188,7 +188,7 @@ class Tracker
|
||||
$tablename,
|
||||
$version,
|
||||
$tracking_set = '',
|
||||
$is_view = false
|
||||
bool $is_view = false
|
||||
) {
|
||||
global $sql_backquotes, $export_type;
|
||||
|
||||
@ -241,14 +241,14 @@ class Tracker
|
||||
$create_sql = "";
|
||||
|
||||
if ($GLOBALS['cfg']['Server']['tracking_add_drop_table'] == true
|
||||
&& $is_view == false
|
||||
&& $is_view === false
|
||||
) {
|
||||
$create_sql .= self::getLogComment()
|
||||
. 'DROP TABLE IF EXISTS ' . Util::backquote($tablename) . ";\n";
|
||||
}
|
||||
|
||||
if ($GLOBALS['cfg']['Server']['tracking_add_drop_view'] == true
|
||||
&& $is_view == true
|
||||
&& $is_view === true
|
||||
) {
|
||||
$create_sql .= self::getLogComment()
|
||||
. 'DROP VIEW IF EXISTS ' . Util::backquote($tablename) . ";\n";
|
||||
|
||||
@ -142,7 +142,7 @@ if (isset($_POST['do_save_data'])) {
|
||||
/**
|
||||
* Displays the form used to define the new field
|
||||
*/
|
||||
if ($abort == false) {
|
||||
if ($abort === false) {
|
||||
/**
|
||||
* Gets tables information
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user