Zend Framework

Allow document slug extension to differ from filename

Details

  • Type: Patch Patch
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.3
  • Fix Version/s: 1.9.0
  • Component/s: Zend_Gdata
  • Labels:
    None

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); }

Activity

Hide
Matthew Romaine added a comment -

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

Show
Matthew Romaine added a comment - code pasted in description doesn't contain newlines for some reason ...
Hide
Trevor Johns added a comment -

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/ZFPROP/Contributor+License+Agreement

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.

Show
Trevor Johns added a comment - 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/ZFPROP/Contributor+License+Agreement 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.
Hide
Matthew Romaine added a comment -

Hi Trevor,

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

Show
Matthew Romaine added a comment - Hi Trevor, My CLA has been accepted and Hilary has added my account to the contributor group. Please proceed with processing this patch. Thanks!
Hide
Trevor Johns added a comment -

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.

Show
Trevor Johns added a comment - 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.
Hide
Trevor Johns added a comment -

Fixed in trunk by r16279.

Marking as fixed for next minor release.

commit 38a4b329a9d2490eea135e6c2a49c226cb30be2a
Author: tjohns <tjohns@44c647ce-9c0f-0410-b52a-842ac1e357ba>
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/standard/trunk@16279 44c647ce-9c0f-0410-b52a-842ac1e357ba

 library/Zend/Gdata/Docs.php |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Show
Trevor Johns added a comment - Fixed in trunk by r16279. Marking as fixed for next minor release.
commit 38a4b329a9d2490eea135e6c2a49c226cb30be2a
Author: tjohns <tjohns@44c647ce-9c0f-0410-b52a-842ac1e357ba>
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/standard/trunk@16279 44c647ce-9c0f-0410-b52a-842ac1e357ba

 library/Zend/Gdata/Docs.php |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: