-
Notifications
You must be signed in to change notification settings - Fork 47
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
Updated Group constructor to allow URLs #43
Conversation
What will be returned by basename with trailing slash (which is default)? |
Trailing slashes are ignored. I would strongly recommend native PHP functions over regex, especially when the URL is as simple as this. Of course the choice is yours, I just need something that works and fixes this problem :) |
Is it a good idea to let pass "file in group" URL to instantiate a group that contains the file? |
@homm, any comments on this? |
@paul-blundell with regexps we can check exactly format of UUID and throw on wrong links. Moreover, php > print pathinfo("https://ucarecdn.com/c4fed349-2317-4eb3-9e4c-a390081a1e5b~1/meh", PATHINFO_BASENAME);
meh
php > print pathinfo("https://ucarecdn.com/c4fed349-2317-4eb3-9e4c-a390081a1e5b~1/nth/0/", PATHINFO_BASENAME);
0 I would like to see something like this rather than |
@homm, makes sense. Like I said I assumed the UUID was the last part, my fault for not checking the documentation fully :) |
I think it should be like this: Where |
thanks! |
Updated Group constructor to allow URLs
As mentioned in issue #38 the group constructor could not handle URLs. This was creating a problem for multiple file uploads which returns a URL.
I have assumed with this fix that the Group ID will be the last part of the URL. Please correct me if I am wrong.