Tweak usage of HttpInput::Get* to use default parameter instead of null coalesce

This commit is contained in:
Alex Cabal 2019-11-15 12:53:37 -06:00
parent 6caa68fe7e
commit 347c04b7b5
3 changed files with 4 additions and 4 deletions

View file

@ -2,7 +2,7 @@
require_once('Core.php');
try{
$urlPath = trim(str_replace('.', '', HttpInput::GetString('url-path') ?? ''), '/'); // Contains the portion of the URL (without query string) that comes after https://standardebooks.org/ebooks/
$urlPath = trim(str_replace('.', '', HttpInput::GetString('url-path', true, '')), '/'); // Contains the portion of the URL (without query string) that comes after https://standardebooks.org/ebooks/
$wwwFilesystemPath = EBOOKS_DIST_PATH . $urlPath; // Path to the deployed WWW files for this ebook
if($urlPath == '' || mb_stripos($wwwFilesystemPath, EBOOKS_DIST_PATH) !== 0 || !is_dir($wwwFilesystemPath)){

View file

@ -7,7 +7,7 @@ use function Safe\apcu_fetch;
use function Safe\shuffle;
try{
$urlPath = trim(str_replace('.', '', HttpInput::GetString('url-path') ?? ''), '/'); // Contains the portion of the URL (without query string) that comes after https://standardebooks.org/ebooks/
$urlPath = trim(str_replace('.', '', HttpInput::GetString('url-path', true, '')), '/'); // Contains the portion of the URL (without query string) that comes after https://standardebooks.org/ebooks/
$wwwFilesystemPath = EBOOKS_DIST_PATH . $urlPath; // Path to the deployed WWW files for this ebook
if($urlPath == '' || mb_stripos($wwwFilesystemPath, EBOOKS_DIST_PATH) !== 0){

View file

@ -4,11 +4,11 @@ require_once('Core.php');
use function Safe\preg_replace;
try{
$page = HttpInput::GetInt('page') ?? 1;
$page = HttpInput::GetInt('page', 1);
$query = HttpInput::GetString('query', false);
$tag = HttpInput::GetString('tag', false);
$collection = HttpInput::GetString('collection', false);
$sort = HttpInput::GetString('sort', false) ?? SORT_NEWEST;
$sort = HttpInput::GetString('sort', false, SORT_NEWEST);
$pages = 0;
$totalEbooks = 0;