1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +02:00

Desktop: Fixes #5034: Certain resource paths could be corrupted when saved from the Rich Text editor

This commit is contained in:
Laurent Cozic
2021-06-08 20:37:44 +02:00
parent a058e09183
commit 56fdf97693
2 changed files with 16 additions and 4 deletions

View File

@ -208,9 +208,9 @@ export default class Note extends BaseItem {
for (const basePath of pathsToTry) {
const reStrings = [
// Handles file://path/to/abcdefg.jpg?t=12345678
`${pregQuote(`${basePath}/`)}[a-zA-Z0-9.]+\\?t=[0-9]+`,
`${pregQuote(`${basePath}/`)}[a-zA-Z0-9]{32}\\.[a-zA-Z0-9]+\\?t=[0-9]+`,
// Handles file://path/to/abcdefg.jpg
`${pregQuote(`${basePath}/`)}[a-zA-Z0-9.]+`,
`${pregQuote(`${basePath}/`)}[a-zA-Z0-9]{32}\\.[a-zA-Z0-9]+`,
];
for (const reString of reStrings) {
const re = new RegExp(reString, 'gi');