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

Invalid JSON string in webdav repository when path is '/'

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.8, 2.2.5
    • 2.2.6
    • Repositories
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • Hide
      1. Set up a WebDAV repository which as '/' as path
      2. Set up another WebDAV repository which as a different path than just '/', '/webdav' for instance.
      3. Make sure you can browse both repositories and download files
      Show
      Set up a WebDAV repository which as '/' as path Set up another WebDAV repository which as a different path than just '/', '/webdav' for instance. Make sure you can browse both repositories and download files

    Description

      We've had this issue reported to us by a client and since I don't have a webdav repository set up I haven't been able to confirm or test the issue. However I think I've isolated the problem and my proposed patch seemed to fix it for them so here it is!

      When viewing the webdav repository in the filepicker they get the error:

      ERROR: Invalid JSON string 
      Warning: strpos(): Empty delimiter in /var/www/htdocs/repository/webdav/lib.php on line 146 
      {"dynload":true,"nosearch":true,"nologin":true,"path":[{"name":"WebDAV","path":0}],"list":[{"title":"test","thumbnail"...

      From what I can tell, if the path is just a single slash '/' path will end up being an empty string as the line before is:

      $path = rtrim($path,'/');

      This doesn't seem to affect 2.3 following the changes made in http://tracker.moodle.org/browse/MDL-32497.

      Sorry I can't provide any more information!

      Attachments

        Issue Links

          Activity

            People

              fred Frédéric Massart
              simoncoggins Simon Coggins
              Ankit Agarwal Ankit Agarwal
              Sam Hemelryk Sam Hemelryk
              Michael de Raadt Michael de Raadt
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Nov/12