WordPress.org

Ready to get started?Download WordPress

Forums

Google Doc Embedder
[resolved] Not displaying doc with Internet Explorer and Greek filenames (5 posts)

  1. beredim
    Member
    Posted 2 years ago #

    This bug appears when trying to embed a document that has a greek filename and viewing in Internet Explorer (9 and possibly older versions as well).

    An example of this bug can be viewed here:
    http://www.ispierias.gr/?p=4254

    The above example post has has two pdf's embedded.
    When viewed in Chrome or Firefox it displays correctly.

    When viewed in Internet Explorer the Greek filename doesn't get decoded correctly and therefore doesn't display. The download link however below the embedded document is correct and works.

    Any chance of looking at this??? (The target audience is not tech savvy and uses mainly IE)

    http://wordpress.org/extend/plugins/google-document-embedder/

  2. beredim
    Member
    Posted 2 years ago #

    Ok so I think I have managed to patch this and posting the code below.

    I would appreciate it if the author of the plugin could check to see if this creates any problems.

    I edited the file gviewer.php located at the root folder of the plugin (/wp-content/plugins/google-document-embedder/gviewer.php).

    At line 161 i added the following code:
    $uefile = rawurlencode($uefile);

    So this is the final code around line 161:

    } else {
    			$uefile = $file;
    		}
    $uefile = rawurlencode($uefile);
    		// check for proxy
    		if ($gdeoptions['disable_proxy'] == "no") {

    So now the plugin works for Internet Explorer with Greek filenames.

    This is what guided me to the patch: https://docs.google.com/viewer/

    url : The URL of the document to view. This should be URL-encoded.
    [...]
    For example, if you wanted to view the PDF at the URL http://research.google.com/archive/bigtable-osdi06.pdf , you would use the URL: http://docs.google.com/viewer?url=http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf

    The src url that was being produced for the iframe wasn't url encoded. It appears Chrome and Firefox were smart enough to bypass this and decode it correctly, but not IE.

  3. k3davis
    Member
    Plugin Author

    Posted 2 years ago #

    beredim,

    I'm sorry for my delay in responding. I am usually notified of threads here via RSS but wordpress.org seems unreliable at delivering these at times. :(

    I looked over your report (thanks for your research) and it appears I may be properly encoding the filename (note the line 147) but not the entire URL. I haven't tested it yet but your suggested fix may break files that contain spaces in their names -- however it's certain that a similar fix can be offered (if in fact this one isn't perfect already). Thanks for catching this error and I will be sure to repair it in the next version after further testing.

    Kevin

  4. k3davis
    Member
    Plugin Author

    Posted 2 years ago #

    I have a fix posted for you to try out if you wish. I'll do some more testing and hopefully release an update tomorrow or Wednesday.

    http://dev.davismetro.com/files/google-document-embedder.zip

    I did have to do some additional reorganization to deal with spaced filenames, and all the other bug fixes intended for 2.5 have been rolled back for this bug fix release.

    If you get a chance to try it, please let me know how it fares.

    Thanks

  5. k3davis
    Member
    Plugin Author

    Posted 2 years ago #

    I did find additional fixes so please disregard the above build and download the official 2.4.4 release to fix this issue. Thanks again for your bug report.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic