ZF-7056: Allow document slug extension to differ from filename
Description
Below is a patch to allow a file uploaded to Google Docs via the Gdata library to have a slug that is different from its filename.
--- library/Zend/Gdata/Docs.php (revision 16177) +++ library/Zend/Gdata/Docs.php (working copy) @@ -221,8 +221,7 @@
// Set the mime type of the data.
if ($mimeType === null) {
- $slugHeader = $fs->getSlug(); - $filenameParts = explode('.', $slugHeader); + $filenameParts = explode('.', $fileLocation); $fileExtension = end($filenameParts); $mimeType = self::lookupMimeType($fileExtension); }
Comments
Posted by Matthew Romaine (mromaine) on 2009-06-20T01:42:16.000+0000
code pasted in description doesn't contain newlines for some reason ...
Posted by Trevor Johns (tjohns) on 2009-06-22T12:28:28.000+0000
Hi Matthew, Thanks for the patch. Unfortunately, before we can accept your contributions, you need to sign and submit the Zend Framework CLA. This can be found here:
http://framework.zend.com/wiki/display/…
Once this is done and you're added to the zf-framework-dev group in JIRA, let me know and I'll process this patch.
Posted by Matthew Romaine (mromaine) on 2009-06-23T23:28:38.000+0000
Hi Trevor,
My CLA has been accepted and Hilary has added my account to the contributor group. Please proceed with processing this patch. Thanks!
Posted by Trevor Johns (tjohns) on 2009-06-24T16:48:42.000+0000
Updated summary to indicate that this applies specifically to file extensions.
The current behavior is that, if no MIME type is available, the MIME type is extracted from the slug rather than the original filename.
Posted by Trevor Johns (tjohns) on 2009-06-24T17:01:56.000+0000
Fixed in trunk by r16279.
Marking as fixed for next minor release.
commit 38a4b329a9d2490eea135e6c2a49c226cb30be2a Author: tjohns Date: Wed Jun 24 23:54:40 2009 +0000 ZF-7056: Allow using a slug in Zend_Gdata_Docs file uploads that has a different file extension than the actual file. Patch by: mromaine (Matthew Romaine) git-svn-id: http://framework.zend.com/svn/framework/… 44c647ce-9c0f-0410-b52a-842ac1e357ba library/Zend/Gdata/Docs.php | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)