Moodle
  1. Moodle
  2. MDL-1638

Edit Current Language fields not encoding quotes.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Martin Dougiamas (martin at moodle.com) Tuesday, 13 July 2004, 09:56 PM:

          Thanks very much!

          Fixed in CVS: 1.3 stable and dev.

          From Deen Foxx (deen.f at vgad.com) Friday, 16 July 2004, 05:50 PM:

          My pleasure.

          Show
          Martin Dougiamas added a comment - From Martin Dougiamas (martin at moodle.com) Tuesday, 13 July 2004, 09:56 PM: Thanks very much! Fixed in CVS: 1.3 stable and dev. From Deen Foxx (deen.f at vgad.com) Friday, 16 July 2004, 05:50 PM: My pleasure.
          Hide
          Michael Blake added a comment -

          assign to a valid user

          Show
          Michael Blake added a comment - assign to a valid user

            People

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

              Dates

              • Created:
                Updated:
                Resolved: