Skip to content

Commit

Permalink
Respect RPC_PORT when SSL_ONLY or RPC_SSL are set
Browse files Browse the repository at this point in the history
Fix #1312
  • Loading branch information
endelwar committed Feb 3, 2025
1 parent effa10c commit d27ae74
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions mailscanner/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4151,21 +4151,19 @@ function is_rpc_client_allowed()
function xmlrpc_wrapper($host, $msg)
{
$method = 'http';
// Work out port

if (defined('SSL_ONLY') && SSL_ONLY) {
$port = 443;
$method = 'https';
$port = defined('RPC_PORT') ? RPC_PORT : 443;
} elseif (defined('RPC_SSL') && RPC_SSL) {
$method = 'https';
$port = defined('RPC_PORT') ? RPC_PORT : 443;
} elseif (defined('RPC_PORT')) {
$port = RPC_PORT;
if (defined('RPC_SSL') && RPC_SSL) {
$method = 'https';
if (!defined('RPC_PORT')) {
$port = 443;
}
}
} else {
$port = 80;
}

$client = new xmlrpc_client(constant('RPC_RELATIVE_PATH') . '/rpcserver.php', $host, $port);
if (DEBUG) {
$client->setDebug(1);
Expand Down

0 comments on commit d27ae74

Please sign in to comment.