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

Issue with webdavlib.php where content-type header is case sensitive

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_39_STABLE, MOODLE_400_STABLE

      Description

      There is an issue in line 830 of lib/webdavlib.php 

      if (preg_match('#(application|text)/xml;\s?charset=[\'\"]?utf-8[\'\"]?#i', $response['header']['Content-Type'])) {

       

      This is case sensitive. Headers should be case insensitive https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 

       

      I fixed the issue by putting the following if statement ahead of the problem one 

      if (isset($response['header']['content-type']))

      {        $response['header']['Content-Type'] = $response['header']['content-type']; }

       

      This was blocking me connecting moodle to an owncloud server

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kerins Fergus Kerins
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated: