1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 05:02:02 +02:00

Bugtracker #4450 - allow empty DB prefix (specially for Bieleke)

This commit is contained in:
e107steved 2008-07-08 21:09:28 +00:00
parent 8e43ba51f6
commit 6db147e0d8

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/install_.php,v $
| $Revision: 1.9 $
| $Date: 2008-05-26 13:19:06 $
| $Revision: 1.10 $
| $Date: 2008-07-08 21:09:13 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@ -305,7 +305,7 @@ class e_install
$this->previous_steps['mysql']['db'] = trim($_POST['db']);
$this->previous_steps['mysql']['createdb'] = (isset($_POST['createdb']) && $_POST['createdb'] == true ? true : false);
$this->previous_steps['mysql']['prefix'] = trim($_POST['prefix']);
$success = $this->check_name($this->previous_steps['mysql']['db']) && $this->check_name($this->previous_steps['mysql']['prefix']);
$success = $this->check_name($this->previous_steps['mysql']['db'],FALSE) && $this->check_name($this->previous_steps['mysql']['prefix'],TRUE);
if(!$success || $this->previous_steps['mysql']['server'] == "" || $this->previous_steps['mysql']['user'] == "")
{
$this->stage = 3;
@ -666,9 +666,10 @@ This file has been generated by the installation script.
// Check a DB name or table prefix - anything starting with a numeric followed by 'e' causes problems.
// Return TRUE if acceptable, FALSE if unacceptable
function check_name($str)
// Empty string returns the value of $blank_ok (caller should set TRUE for prefix, FALSE for DB name)
function check_name($str,$blank_ok = FALSE)
{
if ($str == '') return FALSE;
if ($str == '') return $blank_ok;
if (preg_match("#^\d+[e|E]#",$str)) return FALSE;
return TRUE;
}