From 512c9bfb446ad9f850800225cee9884f4b5e06dd Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Wed, 15 Dec 2010 23:17:08 +0000 Subject: [PATCH] functions.inc.php: - replaced deprecated split() call with preg_split() https://sourceforge.net/tracker/?func=detail&aid=3060495&group_id=191583&atid=937964 - added hint about probably missing php5-* packages in error messages if database functions don't exist git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@892 a1433add-5e2c-0410-b055-b7f2511e0802 --- functions.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index c3026266..879ebd48 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1184,7 +1184,7 @@ function pacrypt ($pw, $pw_db="") $salt = substr(create_salt(), 0, 2); # courier-authlib supports only two-character salts if(preg_match('/^{.*}/', $pw_db)) { // we have a flavor in the db -> use it instead of default flavor - $result = split('{|}', $pw_db, 3); + $result = preg_split('/[{}]/', $pw_db, 3); # split at { and/or } $flavor = $result[1]; $salt = substr($result[2], 0, 2); } @@ -1459,7 +1459,7 @@ function db_connect ($ignore_errors = 0) } else { - $error_text .= "

DEBUG INFORMATION:
MySQL 3.x / 4.0 functions not available!
database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; + $error_text .= "

DEBUG INFORMATION:
MySQL 3.x / 4.0 functions not available! (php5-mysql installed?)
database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; } } elseif ($CONF['database_type'] == "mysqli") @@ -1475,7 +1475,7 @@ function db_connect ($ignore_errors = 0) } else { - $error_text .= "

DEBUG INFORMATION:
MySQL 4.1 functions not available!
database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT"; + $error_text .= "

DEBUG INFORMATION:
MySQL 4.1 functions not available! (php5-mysqli installed?)
database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT"; } } elseif ($CONF['database_type'] == "pgsql") @@ -1491,7 +1491,7 @@ function db_connect ($ignore_errors = 0) } else { - $error_text .= "

DEBUG INFORMATION:
PostgreSQL functions not available!
database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; + $error_text .= "

DEBUG INFORMATION:
PostgreSQL functions not available! (php5-pgsql installed?)
database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; } } else