Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30303

mimeinfo does not accept full URLs leading to wrong detection in mediaplugin filter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Filters
    • Labels:
    • Environment:
      LAMP
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1/ upload several flv test files to some server (one of them should ahve space = "%20" in the file name)
      2/ install wireshard for packet inspection
      3/ enable mediafilter
      4/ create a page resource with links to those files with extra bogus ? and # parts
      5/ create url resources linking to these sample flvs with random query parts
      6/ make sure all videos play correctly
      6/ use wireshark to verify the flow player sends expected http query (remember to reset browser caches)

      Show
      1/ upload several flv test files to some server (one of them should ahve space = "%20" in the file name) 2/ install wireshard for packet inspection 3/ enable mediafilter 4/ create a page resource with links to those files with extra bogus ? and # parts 5/ create url resources linking to these sample flvs with random query parts 6/ make sure all videos play correctly 6/ use wireshark to verify the flow player sends expected http query (remember to reset browser caches)
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w46_MDL-30303_m22_mimeinfo

      Description

      When using resources in combination with filter media plugin, under certain circumstances full URLs are not managed correctly, thus media are not played.

      For example, an URL such as:

      http://mystorage.tld/folder/myflvvideo.flv?test=one.flv

      is correctly detected and video is played.

      However, when using more complex full URLs, (as authenticated URLs from services like Amazon S3), such as:

      http://mystorage.tld/folder/myflvvideo.flv?AWSAccessKeyId=user111&Expires=1321449255&Signature=0DBvJ0ZG%2BJp3XP%2Ff6S%2FyY0JTUfw%3D

      The player does not manage the URL correctly and media is not played.

      According to tests the mimeinfo(MoreComplexURL) returns document/unknown, so processing stops.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Hi Petr,

              I've detected the 2 problems happening with the filter:

              1) mimeinfo() not supporting full urls with query strings
              2) flowplayer requiring urlencode of the query string)

              I've added above the solution implemented so Andrea can continue testing his S3 links. I just implemented them in the fastest way I was able to imagine, using moodle_url in a nasty way.

              The important thing is the idea, I leave in your hands any suggestion/addenda to implement that properly.

              Ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Hi Petr, I've detected the 2 problems happening with the filter: 1) mimeinfo() not supporting full urls with query strings 2) flowplayer requiring urlencode of the query string) I've added above the solution implemented so Andrea can continue testing his S3 links. I just implemented them in the fastest way I was able to imagine, using moodle_url in a nasty way. The important thing is the idea, I leave in your hands any suggestion/addenda to implement that properly. Ciao
              Hide
              skodak Petr Skoda added a comment -

              The problem is that our moodle_url should be used only for relatively standard URLs - it does not work with general external urls much. I am afraid we have to hardcode the ?# matching to get the query part manually from the file name.

              Show
              skodak Petr Skoda added a comment - The problem is that our moodle_url should be used only for relatively standard URLs - it does not work with general external urls much. I am afraid we have to hardcode the ?# matching to get the query part manually from the file name.
              Hide
              skodak Petr Skoda added a comment -

              To integrators: please cherry pick to 2.1 stable

              Show
              skodak Petr Skoda added a comment - To integrators: please cherry pick to 2.1 stable
              Hide
              skodak Petr Skoda added a comment -

              thanks for the report and original patch proposal!

              Show
              skodak Petr Skoda added a comment - thanks for the report and original patch proposal!
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Thanks Petr this has been integrated now.

              Show
              samhemelryk Sam Hemelryk added a comment - Thanks Petr this has been integrated now.
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Thanks Petr - passing this test now (was tested during integration).
              I did however find a minor bug with MP3 filtering whereby we don't allow for any arguments or an anchor after .mp3. I'll create a bug for that now.

              Cheers
              Sam

              Show
              samhemelryk Sam Hemelryk added a comment - Thanks Petr - passing this test now (was tested during integration). I did however find a minor bug with MP3 filtering whereby we don't allow for any arguments or an anchor after .mp3. I'll create a bug for that now. Cheers Sam
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              And this has landed upstream, just on time for the upcoming new releases week. Thanks for it!

              Ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - And this has landed upstream, just on time for the upcoming new releases week. Thanks for it! Ciao

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    28/Nov/11