Issues

ZF-7056: Allow document slug extension to differ from filename

Issue Type: Patch Created: 2009-06-20T01:41:01.000+0000 Last Updated: 2009-06-24T17:01:56.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Matthew Romaine (mromaine) Assignee: Trevor Johns (tjohns) Tags: - Zend_Gdata

Related issues: Attachments: - Gdata.diff

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.

<pre class="literal">
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: <a href="http://framework.zend.com/svn/framework/standard/trunk@16279">http://framework.zend.com/svn/framework/…</a> 44c647ce-9c0f-0410-b52a-842ac1e357ba

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts