Moodle
  1. Moodle
  2. MDL-33780

Incorrectly parsed uploaded text file with BOM

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.1.7, 2.2.4, 2.3.1
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Import the attached file. You should get 5 questions in Russian.
      2. Import any other GIFT files you can find. For example question/format/gift/simpletest/fixtures/questions.gift.txt, and make sure there are no errors.

      Show
      1. Import the attached file. You should get 5 questions in Russian. 2. Import any other GIFT files you can find. For example question/format/gift/simpletest/fixtures/questions.gift.txt, and make sure there are no errors.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      1. Create txt file with BOM in GIFT format (see pic.1)
      2. Import it to the question bank
      3. See preview (pic.2) and example without BOM (pic.3). It can be seen incorrectly parsed title ::Moodle::

      also http://docs.moodle.org/22/en/GIFT_format#Format_symbols

        Gliffy Diagrams

        1. gift-example-2 (2).txt
          0.6 kB
          Konstantin Gorshkov
        1. moodlebom.jpg
          81 kB

          Activity

          Hide
          Tim Hunt added a comment -

          I think https://github.com/timhunt/moodle/compare/master...MDL-33780 is the required fix.

          Konstantin, do you have an example GIFT file with a BOM that we can use to test this? If so, please could you attach it here. Thanks.

          Show
          Tim Hunt added a comment - I think https://github.com/timhunt/moodle/compare/master...MDL-33780 is the required fix. Konstantin, do you have an example GIFT file with a BOM that we can use to test this? If so, please could you attach it here. Thanks.
          Hide
          Konstantin Gorshkov added a comment -

          Thank you for your reply. This fix works fine.

          I attached the file with a BOM to the first post.

          Show
          Konstantin Gorshkov added a comment - Thank you for your reply. This fix works fine. I attached the file with a BOM to the first post.
          Hide
          Tim Hunt added a comment -

          Right, it seems to be working.

          Note that the patch for 2.1 is different, because of the changes to textlib.php.

          Show
          Tim Hunt added a comment - Right, it seems to be working. Note that the patch for 2.1 is different, because of the changes to textlib.php.
          Hide
          Tim Hunt added a comment -

          Re-based and 2.3 branch added.

          Show
          Tim Hunt added a comment - Re-based and 2.3 branch added.
          Hide
          Dan Poltawski added a comment -

          Integrated into master, 23, 22, 21.

          Thanks Tim!

          Show
          Dan Poltawski added a comment - Integrated into master, 23, 22, 21. Thanks Tim!
          Hide
          Rajesh Taneja added a comment -

          Works great, no error encountered.
          Thanks for fixing this, Tim.

          Show
          Rajesh Taneja added a comment - Works great, no error encountered. Thanks for fixing this, Tim.
          Hide
          Sam Hemelryk added a comment -

          Congratulations your code is upstream - gold star for you!

          This issue + 79 others made it in in time for the minor releases.
          Thank you everyone involved for your exuberant efforts.

          Show
          Sam Hemelryk added a comment - Congratulations your code is upstream - gold star for you! This issue + 79 others made it in in time for the minor releases. Thank you everyone involved for your exuberant efforts.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: