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

Edit Current Language fields not encoding quotes.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Environment:
      Linux

      Description

      This example is from editing the error.php language file.

      <input type=text name=string-fieldrequired value=<b>$a</b> is a required field size=45>

      Should be...

      <input type=text name=string-fieldrequired value=<b>$a</b> is a required field size=43>

      Fixed by adding...

      $value = str_replace('',,$value);

      ...on line 223 of admin/lang.php below other replacements.

      P.S. Additionally, this is ugly, wasteful and doesn't work as intended...

      $value = str_replace(\n\n\n\n\n\n,\n,$value); // Collapse runs of blank lines

      $value = str_replace(\n\n\n\n\n,\n,$value);

      $value = str_replace(\n\n\n\n,\n,$value);

      $value = str_replace(\n\n\n,\n,$value);

      $value = str_replace(\n\n\n,\n,$value);

      Replaced with...

      $value = preg_replace(/\n

      {3,}

      /,\n\n,$value); // Collapse runs of blank lines

      $value = trim($value, \n); // Delete leading/trailing lines

      ...and it works great.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: