[ 'method' => 'GET', 'header' => 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' ] ]) ); if (!isset($content) || strlen($content) === 0) { http_response_code(500); die('Error: Unable to fetch data'); } $selfUrl = $_SERVER['SCRIPT_NAME']; $content = str_replace('https://', $selfUrl . '?url=https://', $content); if (!is_dir('./.fonts-cache')) { mkdir('./.fonts-cache'); } file_put_contents($filepath, $content); } else { http_response_code(400); die('Error: Invalid "url" parameter ' . $url); } } exit(0); ?>