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

code pasted in description doesn't contain newlines for some reason ...

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.

Hi Trevor,

My CLA has been accepted and Hilary has added my account to the contributor group. Please proceed with processing this patch. Thanks!

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.

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(-)