Fix alias regex
This commit is contained in:
parent
276e370989
commit
d6cdc846d8
@ -1467,7 +1467,7 @@ function user_get_alias_details($username) {
|
|||||||
try {
|
try {
|
||||||
$data['address'] = $username;
|
$data['address'] = $username;
|
||||||
$stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') AS `aliases` FROM `alias`
|
$stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') AS `aliases` FROM `alias`
|
||||||
WHERE `goto` LIKE :username_goto
|
WHERE `goto` REGEXP :username_goto
|
||||||
AND `address` NOT LIKE '@%'
|
AND `address` NOT LIKE '@%'
|
||||||
AND `address` != :username_address");
|
AND `address` != :username_address");
|
||||||
$stmt->execute(array(':username_goto' => '(^|,)'.$username.'($|,)', ':username_address' => $username));
|
$stmt->execute(array(':username_goto' => '(^|,)'.$username.'($|,)', ':username_address' => $username));
|
||||||
@ -1495,8 +1495,8 @@ function user_get_alias_details($username) {
|
|||||||
while ($row = array_shift($run)) {
|
while ($row = array_shift($run)) {
|
||||||
$data['aliases_send_as_all'] = $row['send_as'];
|
$data['aliases_send_as_all'] = $row['send_as'];
|
||||||
}
|
}
|
||||||
$stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') as `address` FROM `alias` WHERE `goto` LIKE :username AND `address` LIKE '@%';");
|
$stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '✘') as `address` FROM `alias` WHERE `goto` REGEXP :username AND `address` LIKE '@%';");
|
||||||
$stmt->execute(array(':username' => '%' . $username . '%'));
|
$stmt->execute(array(':username' => '(^|,)'.$username.'($|,)'));
|
||||||
$run = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$run = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
while ($row = array_shift($run)) {
|
while ($row = array_shift($run)) {
|
||||||
$data['is_catch_all'] = $row['address'];
|
$data['is_catch_all'] = $row['address'];
|
||||||
@ -4878,7 +4878,7 @@ function mailbox_get_sender_acl_handles($mailbox) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Fixed addresses
|
// Fixed addresses
|
||||||
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` LIKE :goto AND `address` NOT LIKE '@%'");
|
$stmt = $pdo->prepare("SELECT `address` FROM `alias` WHERE `goto` REGEXP :goto AND `address` NOT LIKE '@%'");
|
||||||
$stmt->execute(array(':goto' => '(^|,)'.$mailbox.'($|,)'));
|
$stmt->execute(array(':goto' => '(^|,)'.$mailbox.'($|,)'));
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
while ($row = array_shift($rows)) {
|
while ($row = array_shift($rows)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user