Open andreiglingeanu opened 4 years ago
I think this is an url encode issue. I can also confirm this issue occurs on non-English file name images.
Except &
and =
, %
should also be handled.
For example, if you have /uploads/煙絲.JPG its actual URL within WordPress is /uploads/%E7%85%99%E7%B5%B2.JPG
@cheuksing Yeah, this was quite annoying and hard to spot at the beginning... I imagine this is something that's not easily fixable either.
Found that this also happens with images with a "+" in the filename too (for example "beautiful+flower.jpg".
I had this happen when I bulk converted images, and now all imaged come with the error "Sanity check failed for destination path: String expected"
Is there any way to resolve this ? Is there any backup of original photos
Hi!
I just discovered that when you try to load a file that has an
&
in its path, thewebp-on-demand.php
script fails with this:I've debugged this a bit and the cause seems to be that when you pass
xsource=x$request_filename
query string and it contains an ampersand -- it breaks thexsource
query param into multiple query params. The full nginx rewrite rule that I currently use:URI path to the file:
/site/wp-content/uploads/brizy/395/assets/images/iW=5000&iH=any/andrew-neel-jtsW-Z6bFw-unsplash.jpg
File system path to the same file:/var/www/html/site/wp-content/uploads/brizy/395/assets/images/iW=5000&iH=any/andrew-neel-jtsW-Z6bFw-unsplash.jpg
Possible solutions:
$request_filename
xsource
to be passed in as a CGI param, and thus not interfere with the whole URL thing.Do you think there are other ways of mitigating this problem? The
&
and=
signs are unfortunately very hard to remove, they're coming from a popular page builder...