mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Bugtracker #4450 - allow empty DB prefix (specially for Bieleke)
This commit is contained in:
11
install_.php
11
install_.php
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/install_.php,v $
|
| $Source: /cvs_backup/e107_0.8/install_.php,v $
|
||||||
| $Revision: 1.9 $
|
| $Revision: 1.10 $
|
||||||
| $Date: 2008-05-26 13:19:06 $
|
| $Date: 2008-07-08 21:09:13 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -305,7 +305,7 @@ class e_install
|
|||||||
$this->previous_steps['mysql']['db'] = trim($_POST['db']);
|
$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']['createdb'] = (isset($_POST['createdb']) && $_POST['createdb'] == true ? true : false);
|
||||||
$this->previous_steps['mysql']['prefix'] = trim($_POST['prefix']);
|
$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'] == "")
|
if(!$success || $this->previous_steps['mysql']['server'] == "" || $this->previous_steps['mysql']['user'] == "")
|
||||||
{
|
{
|
||||||
$this->stage = 3;
|
$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.
|
// Check a DB name or table prefix - anything starting with a numeric followed by 'e' causes problems.
|
||||||
// Return TRUE if acceptable, FALSE if unacceptable
|
// 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;
|
if (preg_match("#^\d+[e|E]#",$str)) return FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user