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

html2text.php - notice when given a blank/empty string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.8.9, 1.9.5
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      I was working with some contrib code which was sending an empty value to html2text.php. As a result, the following notice was produced:

      Notice: Uninitialized string offset: 0 in /home/arborrow/Moodle/code/19stable/lib/html2text.php on line 39

      I am attaching a diff file that gets around the notice; however, I'm not sure if setting $chr to an empty string is the best thing. But I think verifying that there is something there to work with in $badStr

      {0}

      is a good idea.

      Peace - Anthony

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              francois Francois Marier
              Reporter:
              aborrow Anthony Borrow
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/09