A malformed file image URL breaks transcript rendering
This commit is contained in:
Vendored
+6
-1
@@ -311,7 +311,12 @@ function worktreeImageURL(path, taskId) {
|
||||
}
|
||||
let file = path;
|
||||
if (/^file:\/\//i.test(file)) {
|
||||
file = decodeURI(file.slice("file://".length));
|
||||
try {
|
||||
file = decodeURI(file.slice("file://".length));
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (/^[a-z][a-z0-9+.-]*:/i.test(file)) {
|
||||
return null;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+5
-1
@@ -351,7 +351,11 @@ function worktreeImageURL(path: string, taskId: string | undefined): string | nu
|
||||
}
|
||||
let file = path;
|
||||
if (/^file:\/\//i.test(file)) {
|
||||
file = decodeURI(file.slice("file://".length));
|
||||
try {
|
||||
file = decodeURI(file.slice("file://".length));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
} else if (/^[a-z][a-z0-9+.-]*:/i.test(file)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user