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

Mediaplugin filter returns blank $text when bad UTF-8 is found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.7.3, 1.8.3, 1.9
    • 1.7.2
    • Filters, Language, Resource
    • None
    • PHP5-only issue.
    • MOODLE_17_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      I've been hours trying to find out why, under certain circumstances, a link like "/file.php/263/onefile.htm" would return a blank page while "/file.php/263/otherfile.htm" does not. Tracing took me through file.php->filelib.php (send_file function) -> filter_text function and finally to mediaplugin_filter function, where I found that preg_replace() was the one returning a blank $text.

      The problem arose when upgraded the server to PHP5, so I suspect preg_replace() is returning an empty $text when the original $text is not well-formed UTF-8. This is very probable, since the files in moodledata not necessarily are in UTF-8 (this particular installation was a 1.4, then 1.5, and now 1.7.2).

            nicolasconnault Nicolas Connault (Inactive)
            petcheverry Pablo Etcheverry
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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