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

Warning: preg_replace_callback(): Unknown modifier 'a' in /opt/app/filter/displayh5p/classes/text_filter.php on line 154

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5.4, 5.0
    • H5P
    • MOODLE_405_STABLE, MOODLE_500_STABLE
    • MDL-85618-405
    • MDL-85618-500
    • Hide
      1. Login as admin
      2. Navigate to Plugins > Filters > Display H5P in site administration
      3. Set Allowed sources to the following:

        https://h5p.org/h5p/embed/[id]
        https://h5p.org/h5p/~user/[id]#example=6725
        https://h5p.org/arithmetic-quiz#example=6725
        

      4. Create a course
      5. Edit the General section
      6. Set Description to the following (use source code view):

        <div>First https://h5p.org/h5p/embed/580638</div>
        <div>Second https://h5p.org/h5p/~user/12345#example=6725</div>
        <div>Third https://h5p.org/arithmetic-quiz#example=6725</div>
        

      7. After saving, confirm the first link is filtered to an embedded H5P activity, and the remaining URLs display as text/link only
      8. Confirm there are no warnings or errors on the page
      Show
      Login as admin Navigate to Plugins > Filters > Display H5P in site administration Set Allowed sources to the following: https://h5p.org/h5p/embed/[id] https://h5p.org/h5p/~user/[id]#example=6725 https://h5p.org/arithmetic-quiz#example=6725 Create a course Edit the General section Set Description to the following (use source code view): <div>First https://h5p.org/h5p/embed/580638</div> <div>Second https://h5p.org/h5p/~user/12345#example=6725</div> <div>Third https://h5p.org/arithmetic-quiz#example=6725</div> After saving, confirm the first link is filtered to an embedded H5P activity, and the remaining URLs display as text/link only Confirm there are no warnings or errors on the page
    • Hide

      Code verified against automated checks.

      Checked MDL-85618 using repository: https://github.com/paulholden/moodle.git

      More information about this report

      Built on: Tue Jun 3 12:48:22 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85618 using repository: https://github.com/paulholden/moodle.git MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-85618-405 | CI Job ] MOODLE_500_STABLE (0 errors / 0 warnings) [branch: MDL-85618-500 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-85618 | CI Job ] More information about this report Built on: Tue Jun 3 12:48:22 UTC 2025

      Steps to reproduce:

      1. Add to setting "filter_displayh5p | allowedsources" value - https://h5p.org/arithmetic-quiz#example=6725.
      1. Create page activity in course.
      2. Add text https://h5p.org/arithmetic-quiz#example=6725 in page content.
      3. Save.
      4. Enable filter "Display H5P" in activity.
      5. Enable display debug messages.
      6. Now we see errors: Warning: preg_replace_callback(): Unknown modifier 'a' in /opt/app/filter/displayh5p/classes/text_filter.php on line 154

      Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /opt/app/lib/filterlib.php on line 890

      Warning: preg_replace_callback(): Unknown modifier 'a' in /opt/app/lib/filterlib.php on line 919

            pholden Paul Holden
            fidan Synbulatov Fidan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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