It seems that #517814: File API Stream Wrapper Conversion broke file_save_upload(). Right now it only works for file in the root temporary or files directories (private or public). It does not work unless you include a trailing slash in the directory name.
This patch takes the approach that a trailing slash is both allowed and not necessary. I think a better approach might be to not work at all with a trailing slash, but the performance impact is non-existent and it'd be hard to accurately report such an error.
For those wondering, user picture upload still works because it uploads to the root temporary directory and then moves it to files/pictures later.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | save-upload-552066-5.patch | 3.81 KB | pwolanin |
| #1 | file_save_upload_trailing_slash.patch | 665 bytes | quicksketch |
| file_save_upload_trailing_slash.patch | 993 bytes | quicksketch |
Comments
Comment #1
quicksketchHa, of course that last patch is going to break uploads directly the root of file directories. This one adds a trailing slash only if it doesn't already end in a trailing slash.
Comment #2
aaron commentedgood find. is this worthy of a new test, perhaps?
Comment #3
pwolanin commentedsimpler code using substr:
Comment #4
pwolanin commentedneeds a test case also.
Comment #5
pwolanin commentedComment #6
quicksketchMuch better, looks great to me.
Comment #7
aaron commentedI love that there's finally a way to win by running these tests!!! Now it's not just the good feeling you get from seeing all the green bars...
Comment #8
webchickCommitted to HEAD. Thanks a lot!