- I use a remote server for images
- Logo and favicon location must be URL
- Site(s) support both HTTP and HTTPS
As a consequence I must be able to input an URL of the form...
//my.remote.host/path (what is perfectly valid)
... and get it accepted, which is not the case.
Since I'm not going to wait half a decade hoping for the patch to be rerolled every 6 month before a very hypotetical merge, I just upload it here for public storage purpose.
Don't expect other input from me on issue, I already patched my instance.
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | 2687045-30.patch | 2.65 KB | MerryHamster |
| #24 | scheme_less_favicon_and-2687045-24.patch | 2.58 KB | yogeshmpawar |
| #12 | interdiff-2687045-10-12.txt | 661 bytes | aerozeppelin |
| #10 | 2687045-10.patch | 3.02 KB | aerozeppelin |
| #10 | interdiff-2687045-6-10.txt | 1.31 KB | aerozeppelin |
Comments
Comment #2
makbul_khan8 commentedComment #3
makbul_khan8 commentedHi Dupalers,
Please let me know if this could be a valid issue, if yes I have my code ready and will post a patch ASAP.
Thanks in advance!!
Comment #4
fabianx commentedThe bug report is valid.
I would agree that it would be good to support schema-less urls.
I think we should check that if the url starts with '//' that adding 'http:' makes it valid, e.g. is_file() does return TRUE then.
So the patch needs some work, but can be committed fairly quick then I think.
Oh and please check on http://simplytest.me if this is an issue for Drupal 8 as well.
Unfortunately per our backport policy it would need to be fixed there first - if that was the case.
And thank you for your continued contributions!
Comment #5
makbul_khan8 commentedComment #6
aerozeppelin commentedPatch for D8.
Comment #8
fabianx commentedRTBC for D8
Comment #9
alexpottImho this should come after the absolute local path check. Also it should just use is_file() like other checks in the function instead of get_headers()
Comment #10
aerozeppelin commentedUpdates as per #9.
Comment #11
fabianx commentedI think it is RTBC - except for two nits.
nit - IIRC, substr() can just take 2 arguments as well.
e.g.
is_file(substr($path, 1));
should be equivalent.
IIRC correctly base_url is deprecated, but unsure right now.
Comment #12
aerozeppelin commentedUpdates as per #11.
Comment #13
fabianx commentedBack to RTBC, thanks!
Comment #15
dawehnerI cannot really express that, but I think we could use Url::fromUri to validate a good bunch of the stuff on the method.
Comment #16
alexpott#15 seems like this needs work
Comment #17
fabianx commented#15: Can you please provide a little more guidance for the contributors on this issue on what you would like to see? Thank you!
Comment #18
aerozeppelin commentedRerolled the patch as per comments in #15.
Comment #19
makbul_khan8 commentedComment #20
makbul_khan8 commentedComment #22
drzraf commentedComment #24
yogeshmpawarUpdated patch against 8.4.x branch.
Comment #25
yogeshmpawarAny Update on this issue ?
Comment #28
markhalliwellComment #30
MerryHamster commentedreroll patch from #24 to 8.7.x
Comment #31
MerryHamster commentedComment #32
borisson_Back to rtbc.
Comment #33
jofitzComment #34
alexpottThis is capable of throwing \InvalidArgumentException - these exceptions shouldn't make it through to the user and so need to be caught. That said reading the fromUri code I'm not that sure what we are getting here. I know @dawehner asked for something but there no additional validation and we're having to call parse_url twice. For me this is simpler as:
Also independent is spelt wrong.
Needs a descriptive comment above it like the rest and perhaps we could add some more invalid scheme-independent URLs for testing.
Comment #45
smustgrave commentedThis came up as a daily BSI target.
Seems this got left on #34 feedback which appears valid.
IS should also follow issue template
Thanks.