File with names like "/images/test%20space.pdf" open without problem in version 1.4.0 but fail to open in 1.4.1
I am using Joomla version 5.4.2 and php 8.2
On investigation, the problem seems to be caused by code added to app.js in the function run(config) at lines 733-777
try {
file = new URL(decodeURIComponent(file)).href;
} catch {
file = encodeURIComponent(file).replaceAll("%2F", "/");
}
When presented with a file variable containing the string "/images/test%20space.pdf" the URL constructor fails with the following error - URL constructor: /images/test space.pdf is not a valid URL.
The catch code converts the file name to "/images/test%2520space.pdf", resulting in the error
Missing PDF file.
PDF.js v5.4.149 (build: 9e2e9e209)
Message: Unexpected server response (404)
while retrieving PDF "https:// ... /images/test%2520space.pdf".
If the code block above is commented out, the file does open successfully.
File with names like "/images/test%20space.pdf" open without problem in version 1.4.0 but fail to open in 1.4.1
I am using Joomla version 5.4.2 and php 8.2
On investigation, the problem seems to be caused by code added to app.js in the function run(config) at lines 733-777
When presented with a file variable containing the string "/images/test%20space.pdf" the URL constructor fails with the following error - URL constructor: /images/test space.pdf is not a valid URL.
The catch code converts the file name to "/images/test%2520space.pdf", resulting in the error
Missing PDF file.
PDF.js v5.4.149 (build: 9e2e9e209)
Message: Unexpected server response (404)
while retrieving PDF "https:// ... /images/test%2520space.pdf".
If the code block above is commented out, the file does open successfully.