diff options
author | mjfriaza <mjfriaza@disroot.org> | 2022-05-17 13:44:06 +0200 |
---|---|---|
committer | mjfriaza <mjfriaza@disroot.org> | 2022-05-17 13:44:06 +0200 |
commit | a75c61d71efebf43713026200aa0f513bd7eef09 (patch) | |
tree | 909048adeaa329813e2530d43626ed3bd711bc25 /Zotlabs/Module/Setup.php | |
parent | 481ecee9e87342ca7a1217395085e95d1a3b61ea (diff) | |
parent | 0d0f73fb67bbfcc53058cefded85ac36f951c7a7 (diff) | |
download | volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.gz volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.bz2 volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Module/Setup.php')
-rw-r--r-- | Zotlabs/Module/Setup.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index ca8c19600..f068cbef8 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -69,17 +69,22 @@ class Setup extends \Zotlabs\Web\Controller { $dbpass = ((isset($_POST['dbpass'])) ? trim($_POST['dbpass']) : ''); $dbdata = ((isset($_POST['dbdata'])) ? trim($_POST['dbdata']) : ''); $dbtype = ((isset($_POST['dbtype'])) ? intval(trim($_POST['dbtype'])) : 0); + $phpath = ((isset($_POST['phpath'])) ? trim($_POST['phpath']) : ''); $adminmail = ((isset($_POST['adminmail'])) ? trim($_POST['adminmail']) : ''); $siteurl = ((isset($_POST['siteurl'])) ? trim($_POST['siteurl']) : ''); + if (empty($db_charset)) { + $db_charset = ((intval($dbtype) === 0) ? 'utf8mb4' : 'UTF8'); + } + // $siteurl should not have a trailing slash $siteurl = rtrim($siteurl,'/'); require_once('include/dba/dba_driver.php'); - $db = \DBA::dba_factory($dbhost, $dbport, $dbuser, $dbpass, $dbdata, $dbtype, true); + $db = \DBA::dba_factory($dbhost, $dbport, $dbuser, $dbpass, $dbdata, $dbtype, $db_charset, true); if(! \DBA::$dba->connected) { echo 'Database Connect failed: ' . \DBA::$dba->error; @@ -94,11 +99,16 @@ class Setup extends \Zotlabs\Web\Controller { $dbpass = ((isset($_POST['dbpass'])) ? trim($_POST['dbpass']) : ''); $dbdata = ((isset($_POST['dbdata'])) ? trim($_POST['dbdata']) : ''); $dbtype = ((isset($_POST['dbtype'])) ? intval(trim($_POST['dbtype'])) : 0); + $phpath = ((isset($_POST['phpath'])) ? trim($_POST['phpath']) : ''); $timezone = ((isset($_POST['timezone'])) ? trim($_POST['timezone']) : ''); $adminmail = ((isset($_POST['adminmail'])) ? trim($_POST['adminmail']) : ''); $siteurl = ((isset($_POST['siteurl'])) ? trim($_POST['siteurl']) : ''); + if (empty($db_charset)) { + $db_charset = ((intval($dbtype) === 0) ? 'utf8mb4' : 'UTF8'); + } + if($siteurl != z_root()) { $test = z_fetch_url($siteurl."/setup/testrewrite"); if((! $test['success']) || ($test['body'] != 'ok')) { @@ -112,7 +122,7 @@ class Setup extends \Zotlabs\Web\Controller { if(! isset(\DBA::$dba->connected)) { // connect to db - $db = \DBA::dba_factory($dbhost, $dbport, $dbuser, $dbpass, $dbdata, $dbtype, true); + $db = \DBA::dba_factory($dbhost, $dbport, $dbuser, $dbpass, $dbdata, $dbtype, $db_charset, true); } if(! isset(\DBA::$dba->connected)) { |