Old Redirects With No References
Drop around decade old redirects with no references these days [web/master.git] / fetch / allusers.php <?php // vim: et ts=4 sw=4 function error($text, $status) { switch($status) { default: case 500: header("HTTP/1.0 500 Internal server error"); break; case 404: header("HTTP/1.0 404 Not Found"); break; case 401: header("HTTP/1.0 401 Unauthorized"); break; } echo json_encode(["error" => $text]); exit; } if (!isset($_GET['token']) || md5($_GET['token']) != "d3fb..." && error("token not correct.", 401); $pdo = new PDO("mysql:host=localhost;dbname=phpmasterdb", "nobody", ""); $stmt = $pdo->prepare("SELECT name, username FROM users WHERE enable AND cvaccess"); if (!$stmt->execute()) { error("This error should never happen", 500); } $result = $stmt->fetchAll(PDO::FETCH_ASSOC); if (!$results) { error("This should never happen either", 404); } echo json_encode($results);
A screenshot shows an old PHP web-master repository file containing redirect and API error-handling code. The highlighted authentication check compares an MD5 token and returns “token not correct,” while the surrounding code contains several supposedly impossible errors. The joke is about discovering decade-old redirects and legacy code with no references, a reaction to forgotten or abandoned web infrastructure.
code screenshot / скриншот кодаPHP source code / исходный код PHPweb browser page / страница веб-браузераrepository breadcrumb / хлебные крошки репозиторияsyntax-highlighted code / код с подсветкой синтаксисаhighlighted line / выделенная строкаerror message / сообщение об ошибкеtoken check / проверка токенаdatabase query / запрос к базе данныхmonospaced text / моноширинный текстwhite background / белый фон
- @infosecmemes / 433 2020-10-21
- Type
- image
- Size
- 800×497 · 53.8 KiB
- Mood
- саркастичный
- Language
- en
- Added