1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-31 10:04:20 +03:00

add more unit tests; re-enable random_int warning in functions.inc.php for old php versions etc etc

This commit is contained in:
David Goodwin
2018-12-29 20:54:25 +00:00
parent e8acb609c2
commit 590c80f0bc
12 changed files with 237 additions and 7 deletions

View File

@ -845,13 +845,11 @@ function encode_header($string, $default_charset = "utf-8") {
return $string;
}
/*
if (!function_exists('random_int')) { // PHP version < 7.0
function random_int() { // someone might not be using php_crypt or ask for password generation, in which case random_int() won't be called
die(__FILE__ . " Postfixadmin security: Please install https://github.com/paragonie/random_compat OR enable the 'Phar' extension.");
}
require_once(dirname(__FILE__) . '/lib/block_random_int.php');
}
*/
/**
* Generate a random password of $length characters.
@ -1946,8 +1944,9 @@ function db_update_q($table, $where, $values, $timestamp = array('modified')) {
}
}
/* @todo this needs refactoring/moving out from here */
if (Config::bool('password_expiration')) {
if ($table == 'mailbox') {
if ($table == 'mailbox' && preg_match('/@/', $where)) {
$where_type = explode('=', $where);
$email = ($where_type[1]);
$domain_dirty = explode('@',$email)[1];