Define some constants to make HTTP input code less wordy

This commit is contained in:
Alex Cabal 2024-05-12 12:29:30 -05:00
parent ee7c8343dd
commit 110c091a7b
36 changed files with 87 additions and 86 deletions

View file

@ -10,8 +10,8 @@ $showThankYouPage = $GLOBALS['User'] === null && $downloadCount < 5;
$downloadUrl = null;
try{
$urlPath = HttpInput::Str(HttpVariableSource::Get, 'url-path') ?? null;
$format = EbookFormat::tryFrom(HttpInput::Str(HttpVariableSource::Get, 'format') ?? '') ?? EbookFormat::Epub;
$urlPath = HttpInput::Str(GET, 'url-path') ?? null;
$format = EbookFormat::tryFrom(HttpInput::Str(GET, 'format') ?? '') ?? EbookFormat::Epub;
$wwwFilesystemPath = EBOOKS_DIST_PATH . $urlPath;
// Do we have the ebook cached?