This commit is contained in:
2026-01-02 02:01:05 +01:00
parent 9bc78c157c
commit a25e3f7811

View File

@@ -90,7 +90,17 @@ final class Search
$stmt = $this->pdo->prepare($sql);
try {
$stmt->execute($bind);
return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
if (defined('APP_ENV') && APP_ENV === 'staging') {
$logOk = [
'status' => 'ok',
'sql' => $sql,
'bind' => $bind,
'count' => count($rows),
];
@file_put_contents(__DIR__ . '/../../debug/search_debug.log', print_r($logOk, true));
}
return $rows;
} catch (\PDOException $e) {
// Log into /debug/search_debug.log and continue with empty results
$logErr = [