1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fixed PHP 7.3 warnings

- FIX: Silenced compact() in e107Test::testInitCore()
- FIX: Null check in e_db_pdo::makeTableDef()
- FIX: Null check in e_db_mysql::makeTableDef()
- FIX: userlogin::login() had this warning on line 148:
       "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
This commit is contained in:
Nick Liu 2020-01-18 18:52:20 +01:00
parent 4454b01588
commit be8f2bbeb6
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637
4 changed files with 7 additions and 5 deletions

View File

@ -2718,7 +2718,8 @@ class e_db_pdo implements e_db
$dbAdm = new db_table_admin();
$baseStruct = $dbAdm->get_current_table($tableName);
$fieldDefs = $dbAdm->parse_field_defs($baseStruct[0][2]); // Required definitions
$baseStruct = isset($baseStruct[0][2]) ? $baseStruct[0][2] : null;
$fieldDefs = $dbAdm->parse_field_defs($baseStruct); // Required definitions
if (!$fieldDefs) return false;
$outDefs = array();

View File

@ -145,7 +145,7 @@ class userlogin
$authorized = true;
break;
case LOGIN_TRY_OTHER:
continue;
continue 2;
break;
}
}

View File

@ -3157,7 +3157,8 @@ class e_db_mysql implements e_db
$dbAdm = new db_table_admin();
$baseStruct = $dbAdm->get_current_table($tableName);
$fieldDefs = $dbAdm->parse_field_defs($baseStruct[0][2]); // Required definitions
$baseStruct = isset($baseStruct[0][2]) ? $baseStruct[0][2] : null;
$fieldDefs = $dbAdm->parse_field_defs($baseStruct); // Required definitions
if (!$fieldDefs) return false;
$outDefs = array();

View File

@ -41,8 +41,8 @@ class e107Test extends \Codeception\Test\Unit
//$res = null;
include_once(APP_PATH.'/e107_config.php'); // contains $E107_CONFIG = array('site_path' => '000000test');
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY','UPLOADS_DIRECTORY','SYSTEM_DIRECTORY', 'MEDIA_DIRECTORY','CACHE_DIRECTORY','LOGS_DIRECTORY', 'CORE_DIRECTORY', 'WEB_DIRECTORY');
$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLport');
$e107_paths = @compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY','UPLOADS_DIRECTORY','SYSTEM_DIRECTORY', 'MEDIA_DIRECTORY','CACHE_DIRECTORY','LOGS_DIRECTORY', 'CORE_DIRECTORY', 'WEB_DIRECTORY');
$sql_info = @compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLport');
$res = $this->e107->initCore($e107_paths, e_ROOT, $sql_info, varset($E107_CONFIG, array()));
$this->assertEquals('000000test', $res->site_path);