Skip to content

Commit 8f87289

Browse files
authored
fix: handle missing debugbar history files (#10787)
1 parent b0b38ee commit 8f87289

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎docs/changelogs/v4.7.7.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Release Date: Unreleased
3030
- **Database:** Fixed a bug where `SQLSRV\Forge::_alterTable()` interpolated table and column names without escaping in default constraint lookups.
3131
- **Database:** Fixed a bug where `SQLite3\Connection::_foreignKeyData()` did not escape table identifiers in `PRAGMA foreign_key_list`, causing syntax errors on table names containing hyphens or schemas.
3232
- **Database:** Fixed a bug where `SQLite3\Table::dropIndexes()` used single-quoted string literals instead of escaped identifiers in `DROP INDEX IF EXISTS`, causing syntax errors on index names containing quotes or special characters.
33+
- **Debug Toolbar:** Fixed a bug where `History::setFiles()` emitted a PHP warning when attempting to delete a debugbar history file that had already been removed.
3334
- **Helpers:** Fixed a bug where `excerpt()` threw a `TypeError` when `$phrase` was not found in `$text` or when `$phrase` was `null` and `$radius` was an odd integer. When `$phrase` is not found, `excerpt()` now falls back to extracting an excerpt from the beginning of `$text`.
3435
- **Helpers:** Fixed bugs in `ArrayHelper::dotKeyExists()` where `'0'` path segments caused early loop termination, non-array intermediate values threw a `TypeError`, and paths with segments after a wildcard failed when the wildcard matched multiple elements.
3536
- **Helpers:** Fixed escaping of attribute values in HTML media helpers to prevent malformed HTML and attribute injection.

‎system/Debug/Toolbar/Collectors/History.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public function setFiles(string $current, int $limit = 20)
8686

8787
// Oldest files will be deleted
8888
if ($limit >= 0 && $counter > $limit) {
89-
unlink($filename);
89+
if (is_file($filename)) {
90+
@unlink($filename);
91+
}
9092

9193
continue;
9294
}

0 commit comments

Comments
 (0)