PHP::neverStop(false);
self::_getFluidbookAndTheme($id, $hash, $fluidbook, $theme);
+ if (null === $theme || null === $fluidbook) {
+ abort(404);
+ }
$res = $this->_loadingCompile($theme, $fluidbook->title, $url);
return response($res);
}
public function handle()
{
/** @var FluidbookPublication $fluidbook */
- foreach (FluidbookPublication::withoutGlobalScopes()->where('created_ok', '1')->whereNull('hash')->orWhere('hash', '')->orWhereNull('cid')->orWhere('cid', '')->get() as $fluidbook) {
+ foreach (FluidbookPublication::withoutGlobalScopes()->where('created_ok', '1')->where(function ($query) {
+ $query->whereNull('hash')->orWhere('hash', '')->orWhereNull('cid')->orWhere('cid', '');
+ })->get() as $fluidbook) {
Log::warning('Fluidbook #' . $fluidbook->id . ' had empty hash or cid (hash: hash , cid: :cid)', ['hash' => $fluidbook->hash, 'cid' => $fluidbook->cid]);
$fluidbook->save();
}