Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MYSQL Syntax Error - When listing whitelist/blacklist #1067

Closed
RT4U opened this issue May 10, 2018 · 2 comments · Fixed by #1069
Closed

MYSQL Syntax Error - When listing whitelist/blacklist #1067

RT4U opened this issue May 10, 2018 · 2 comments · Fixed by #1069

Comments

@RT4U
Copy link

RT4U commented May 10, 2018

Fresh installation of MailWatch 1.2.9

Blank whitelist/blanklist.

PHP Error thrown

"PHP message: PHP Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY from_address' in lists.php at line 416

Query in php

'SELECT id, from_address, to_address FROM whitelist WHERE ' . $_SESSION['global_list'] . ' ORDE$
    'w'

NOTE - It also affects every part of the code where $_SESSION['global_list'] is used.

Cause of the problem, $_SESSION['global_list'] is set to blank in checklogin.php line 165

$_SESSION['global_list'] = (isset($global_list) ? $global_list : '');

My fix/patch,

$_SESSION['global_list'] = (isset($global_list) ? $global_list : '1=1');

@Skywalker-11
Copy link
Member

The variable $global_list should never be empty as it will be set by https://github.com/mailwatch/MailWatch/blob/1.2/mailscanner/checklogin.php#L127-L154

Is this happening for all users?

@RT4U
Copy link
Author

RT4U commented May 10, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants