flash.moe/pages/blog.php

24 lines
685 B
PHP
Raw Normal View History

2020-07-30 00:55:37 +00:00
<?php
2022-02-04 20:30:52 +00:00
namespace Makai;
2020-07-30 00:55:37 +00:00
if(preg_match('#^/blog/([0-9]+)$#', $reqPath, $matches) || $reqPath === '/blog.php' || $reqPath === '/blog-post.php') {
if($reqMethod !== 'GET')
return FM_ERR | 405;
2020-08-20 00:11:27 +00:00
header('Location: //flash.moe/2020/blog.php?blog=1&p=' . ($matches[1] ?? filter_input(INPUT_GET, 'p', FILTER_SANITIZE_NUMBER_INT) ?? ''));
2020-07-30 00:55:37 +00:00
return FM_HIT | 302;
}
2020-10-03 16:22:27 +00:00
if($reqPath === '/blog-assets.json') {
if($reqMethod !== 'GET')
return FM_ERR | 405;
header('Content-Type: application/json; charset=utf-8');
echo json_encode([
'header_backgrounds' => FM_BGS,
'footer_quotes' => FM_FEET,
]);
return FM_HIT;
}