-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colon ':' in urls causing problems #9
Comments
Hi! Could you log in this as a php bug? If they acknowledge it we can think of building a workaround. |
I think part of the problem is that I think the fact that it starts with a |
Will this bug be solved anytime soon? Projects like Owncloud are still being affected by this: |
@e-alfred feel free to provide a unit test and bugfix |
The earlier comments still stand. Bug report to the php project would be a great first start. |
Here is a bug report about it: https://bugs.php.net/bug.php?id=55511 They say it is not a bug on their side. From owncloud/core#25479. |
sounds like a colon needs to be encoded when part of the url-path |
but then it was said that the spec was superseded and it doesn't need to be encoded any more:
|
@evert wait for a PHP-side fix or put a workaround in Sabre ? |
I'm cool with a workaround in sabre/uri. |
I tried @Xenopathic's regexp |
Argh, looks like this would break other cases where the URL is absolute: "http://..." would also encode the colon. And since we haven't parsed the URL yet we can't know which part is the path... Chicken-egg. Another is then to do another regexp that only replaces the colon only if it appears after any first slash in the string. What do you think ? |
not sure we support this, but colons can also appear as a |
PR here #12 |
This is a new implementation of PHP's parse_url. It's likely not perfect, but it catches specific cases that the built-in function does not support. Fixes Issue #9 Fixes Issue #11 @felixfbecker / @sii / @PVince81 Does this sufficiently solve your problem?
This is a new implementation of PHP's parse_url. It's likely not perfect, but it catches specific cases that the built-in function does not support. Fixes Issue #9 Fixes Issue #11 @felixfbecker / @sii / @PVince81 Does this sufficiently solve your problem?
Relating to this issue:
owncloud/core#23740
Tested on php 7.0.4 on Ubuntu 16.04.
The parse function in lib/functions.php has trouble with colon characters in the wrong place in the uri.
The parse function in turn uses php's parse_url function which is what is failing under certain (odd) circumstances.
If there is a colon character as the second to last character in a uri phps parse_url function fails to parse the uri. When phps parse_url function fails and returns false, sabres parse function also fails.
It's also worth noting that phps parse_url works if you move the colon anywhere else in the string.
Here's how this can be reproduced:
<?php
print "Works:\n";
var_dump(parse_url('/webdav/test3'));
print "\nFails:\n";
var_dump(parse_url('/webdav/test:3'));
?>
I'm not sure how or where this is most appropriate to fix.
Thanks
The text was updated successfully, but these errors were encountered: