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

Undefined constant "GLOB_BRACE" on Alpine based installations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.2.10, 4.1.16, 4.3.8, 4.4.6, 4.5.2, 5.0
    • Media
    • None
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE

      The VideoJS Player generates a fatal error when a webm video file is to be played in the Safari browser.
      The cause is the use of the constant "GLOB_BRACE", which does not exist on non-GNU systems, such as Alpine.
      More infos: https://www.php.net/manual/en/filesystem.constants.php#constant.glob-available-flags

      The faulty line is in the file "media/player/videojs/ogvloader.php" line: 50

      $files = glob("{$basepath}*.{js,wasm}", GLOB_BRACE);

      The following simple fix would solve this:

      $files = array_merge(glob($basepath . ".js"), glob($basepath . ".wasm"));

      Steps to reproduce
      Preparations

      • A Moodle installation under Alpine is required
      • The page requests must be made either under Apple/Safari or using an appropriate “user agent” specification.
      • A webm video file is required.

      Note on the Alpine installation.
      The installation can be done under Docker using an Alpine image as base.

      Steps
      Create a working material "page" in a course and embed a webm video.
      Call up the page either with a Safari or the corresponding "user agent".
      In this case, the VideoJS Player will load the file "media/player/videojs/ogvloader.php". Loading is aborted with a 500 error. The error in the log looks something like this:

      PHP Fatal error:  Uncaught Error: Undefined constant "GLOB_BRACE" in /var/www/localhost/htdocs/media/player/videojs/ogvloader.php:50\nStack trace:\n#0 {main}\n  thrown in /var/www/localhost/htdocs/media/player/videojs/ogvloader.php on line 50

            Unassigned Unassigned
            grabs Andreas Grabs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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