feat(search.html): update to disable and show loading state w/load more button; improve fuzzy search + debounce
This commit is contained in:
parent
63db0cf32a
commit
8a6e84cb35
35 changed files with 119 additions and 395 deletions
|
@ -3,11 +3,12 @@
|
|||
namespace App\Classes;
|
||||
|
||||
require __DIR__ . "/BaseHandler.php";
|
||||
require __DIR__ . '/../../server/utils/init.php';
|
||||
|
||||
abstract class ApiHandler extends BaseHandler
|
||||
{
|
||||
protected function ensureCliAccess(): void
|
||||
{
|
||||
if (php_sapi_name() !== 'cli' && $_SERVER['REQUEST_METHOD'] !== 'POST') $this->sendErrorResponse("Not Found", 404);
|
||||
if (php_sapi_name() !== 'cli' && $_SERVER['REQUEST_METHOD'] !== 'POST') redirectTo404();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,7 @@
|
|||
$isValidId = is_string($id) && preg_match('/^[a-f0-9\-]{36}$/', $id);
|
||||
$isValidClass = is_string($class) && preg_match('/^w\d{2,4}$/', $class);
|
||||
|
||||
if (!$isValidId || !$isValidClass) {
|
||||
header("Location: /404", true, 302);
|
||||
exit;
|
||||
}
|
||||
if (!$isValidId || !$isValidClass) redirectTo404();
|
||||
|
||||
$cdnUrl = "https://cdn.coryd.dev/$id.$extension?class=$class";
|
||||
$ch = curl_init($cdnUrl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue