Created
April 10, 2021 16:22
-
-
Save spaze/f5dbf8fe178929431e7125b31c45e620 to your computer and use it in GitHub Desktop.
xsssk sources snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function index() | |
{ | |
echo ascii('xsssk'); | |
} | |
function rick() | |
{ | |
header('Location: https://media.giphy.com/media/Vuw9m5wXviFIQ/giphy.gif', true, 301); | |
} | |
function inlineJsIsBad() | |
{ | |
header('Content-Type: application/javascript'); | |
echo 'alert("💩 JavaScript is bad, m\'kay?");'; | |
} | |
function iCanHasHtml() | |
{ | |
return (!isset($_SERVER['HTTP_ACCEPT']) || strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false); | |
} | |
function iCanHasPikshur() | |
{ | |
return (strpos($_SERVER['HTTP_ACCEPT'], 'image/*') !== false); | |
} | |
function iCanHasJavaScript() | |
{ | |
return (strpos($_SERVER['HTTP_ACCEPT'], '*/*') !== false); | |
} | |
// --- | |
if (iCanHasHtml()) { | |
index(); | |
exit; | |
} | |
if (iCanHasPikshur()) { | |
rick(); | |
exit; | |
} | |
if (iCanHasJavaScript()) { | |
inlineJsIsBad(); | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment