mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 02:21:55 -04:00
Tweak usage of HttpInput::Get* to use default parameter instead of null coalesce
This commit is contained in:
parent
6caa68fe7e
commit
347c04b7b5
3 changed files with 4 additions and 4 deletions
|
@ -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)){
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue