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

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

XMLWordPrintable

    • MOODLE_39_STABLE, MOODLE_400_STABLE

      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

            Unassigned Unassigned
            kerins Fergus Kerins
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.