Moodle
  1. Moodle
  2. MDL-30303

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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
    • Rank:
      32649

      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.

        Issue Links

          Activity

          Hide
          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
          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
          Petr Škoda 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
          Petr Škoda 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
          Petr Škoda added a comment -

          To integrators: please cherry pick to 2.1 stable

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

          thanks for the report and original patch proposal!

          Show
          Petr Škoda added a comment - thanks for the report and original patch proposal!
          Hide
          Sam Hemelryk added a comment -

          Thanks Petr this has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks Petr this has been integrated now.
          Hide
          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
          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
          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
          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: