Updates to more strict type checking after some static analysis

This commit is contained in:
Alex Cabal 2019-01-17 21:26:48 -06:00
parent 152f86d616
commit c879dcab34
10 changed files with 50 additions and 34 deletions

View file

@ -49,7 +49,7 @@ class Library{
$ebooks = apcu_fetch('ebooks', $success);
if(!$success){
foreach(explode("\n", trim(shell_exec('find ' . SITE_ROOT . '/www/ebooks/ -name "content.opf"'))) as $filename){
foreach(explode("\n", trim(shell_exec('find ' . SITE_ROOT . '/www/ebooks/ -name "content.opf"') ?? '')) as $filename){
$ebookWwwFilesystemPath = preg_replace('|/src/.+|ius', '', $filename);
$ebook = apcu_fetch('ebook-' . $ebookWwwFilesystemPath, $success);
@ -76,7 +76,7 @@ class Library{
if(!$success){
$ebooks = [];
foreach(explode("\n", trim(shell_exec('find ' . escapeshellarg($wwwFilesystemPath) . ' -name "content.opf"'))) as $filename){
foreach(explode("\n", trim(shell_exec('find ' . escapeshellarg($wwwFilesystemPath) . ' -name "content.opf"') ?? '')) as $filename){
try{
$ebookWwwFilesystemPath = preg_replace('|/src/.+|ius', '', $filename);
$ebook = apcu_fetch('ebook-' . $ebookWwwFilesystemPath, $success);