- Issue created by @laura.j.johnson@gmail.com
- Status changed to Needs review
8 months ago 1:44pm 28 March 2024 - πΊπΈUnited States codechefmarc
I was just trying out this patch and noticed that if there isn't a value passed to the
urldecode
function on line 220, it will give an error message about a required parameter. I suggest adding the following:
$value['uri'] = $uri ? urldecode($uri) : '';
or$value['uri'] = $uri ? urldecode($uri) : NULL;
- I haven't dug too deep into if the$value['uri]
needs to be an empty string or a NULL. - π¨π¦Canada TheDuke13
Here's a patch with the fix mentioned, encountered this issue with a site where we got a deprecation warning that passing NULL as parameter #1 to urldecode() triggers a deprecated warning, so checking to ensure it's not empty would be important.
- πΊπΈUnited States jeffam
I ran into similar problems when users would paste URLs with spaces in them to PDFs in the file system.
With the core link widget, when pasted, a link like
http://www.example.com/sites/default/files/file name.pdf
would be stored ashttp://www.example.com/sites/default/files/file%20name.pdf
. When viewed, such a link would work fine.With the linkit widget, that same link would be stored as
base:/sites/default/files/file%20name.pdf
. When viewing, the links would be double-encoded, e.g.http://www.example.com/sites/default/files/file%2520name.pdf
.From that I assume that the base: and internal: link schemes must expect non-urlencoded paths.
Here's a patch that applies to 6.1.x and targets only the base: and internal: links.