EngineGP/system/engine/pluginbuy.php
Sergei Solovev 276ec7f3eb Updating the server name reference in code
This change replaces the use of $_SERVER['SERVER_NAME'] with $_SERVER['HTTP_HOST'] throughout the codebase. The modification ensures consistency and compliance with best practices, since $_SERVER['HTTP_HOST'] is often used to extract the host header from an HTTP request. This update may improve compatibility and security, especially in scenarios where the Host header plays a key role in proper server configuration and routing. Please review and test the changes carefully to ensure smooth functionality in different environments.
2023-12-23 04:50:14 +03:00

27 lines
754 B
PHP

<?php
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['HTTP_HOST'] . '/404'));
if (!isset($url['plugin']) || !isset($url['ip']) || !isset($url['port']))
sys::out('bad params');
$address = $url['ip'] . ':' . $url['port'];
if (sys::valid($address, 'other', $aValid['address']))
sys::out('bad address');
if (sys::valid($url['plugin'], 'md5'))
sys::out('bad plugin');
$sql->query('SELECT `id` FROM `servers` WHERE `address`="' . $address . '" LIMIT 1');
if (!$sql->num())
sys::out('bad server');
$server = $sql->get();
$sql->query('SELECT `id` FROM `plugins_buy` WHERE `key`="' . $url['plugin'] . '" AND `server`="' . $server['id'] . '" LIMIT 1');
if ($sql->num())
sys::out('true');
sys::out('false');
?>