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

Badge name filtering is excessive

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1, 3.3.3, 3.4, 3.5
    • Fix Version/s: 3.3.4, 3.4.1
    • Component/s: Badges
    • Labels:
    • Testing Instructions:
      Hide

      Set up

      1. Access to a course as teacher
      2. Go to cog, select "More..." and click "Add a new badge"
      3. Create a badge with some especial characters in the "Name" (for instance "Eagle's feathers"). It will be necessary also to fill in at least the mandatory fields (Description, Image and Issuer name)
      4. Click "Create badge" button to save it
      5. Select "Manual issue by role" in the "Add badge criteria" list to specify the criteria to earn it
      6. Check "Teacher" and click the "Save" button, to let teachers award badges
      7. Click over the "Enable access" and confirm the message that will appear using the "Continue" button
      8. Go to "Recipients" and click over "Award badge" button
      9. Search one student in the right column, select it and click the "Award badge" button to move to the left column
      10. Create another badge with same criteria, enable access and award to the same student. In this case it's not necessary to have special characters in the name
        • This could be done repeating the steps from 1 to 9 (but changing the badge name)

       

      Testing instructions

      1. Access as the student who has earned these badges
      2. Click over the user's photo in the upper right and select the "Preferences" option, to access user preferences
      3. Access to "Manage badges"
      4. Try download the badge with special characters, clicking the download icon located bellow it
        • CHECK the filename doesn't contain any special character (they has been removed so, if the badge name is "Eagle's feathers", the filename will be "Eagles_feathers.png")
      5. Try download all the badges using the "Download all" button
        • CHECK all the filenames in the zip files doesn't contain any special character
      6. Click over the badge image earned with special characters ("Eagle's feathers") to access to the badge details page
      7. Try download the badge using the "Download" button bellow the badge image
        • CHECK the filename doesn't contain any special character (they has been removed so, if the badge name is "Eagle's feathers", the filename will be "Eagles_feathers.png")

       

      Show
      Set up Access to a course as teacher Go to cog, select " More... " and click " Add a new badge " Create a badge with some especial characters in the " Name " (for instance "Eagle's feathers"). It will be necessary also to fill in at least the mandatory fields (Description, Image and Issuer name) Click " Create badge " button to save it Select " Manual issue by role " in the " Add badge criteria " list to specify the criteria to earn it Check " Teacher " and click the " Save " button, to let teachers award badges Click over the " Enable access " and confirm the message that will appear using the " Continue " button Go to " Recipients " and click over " Award badge " button Search one student in the right column, select it and click the " Award badge " button to move to the left column Create another badge with same criteria, enable access and award to the same student. In this case it's not necessary to have special characters in the name This could be done repeating the steps from 1 to 9 (but changing the badge name)   Testing instructions Access as the student who has earned these badges Click over the user's photo in the upper right and select the " Preferences " option, to access user preferences Access to " Manage badges " Try download the badge with special characters, clicking the download icon located bellow it CHECK the filename doesn't contain any special character (they has been removed so, if the badge name is "Eagle's feathers", the filename will be "Eagles_feathers.png") Try download all the badges using the " Download all " button CHECK all the filenames in the zip files doesn't contain any special character Click over the badge image earned with special characters ("Eagle's feathers") to access to the badge details page Try download the badge using the " Download " button bellow the badge image CHECK the filename doesn't contain any special character (they has been removed so, if the badge name is "Eagle's feathers", the filename will be "Eagles_feathers.png")  
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-46768-master

      Description

      A badge's name is filtered according to PARAM_FILE, which (among other things) filters out apostrophes. While this makes sense for a filename, I consider this excessive for a badge's name. A teacher in our school wanted to give a badge the course's name (which contains an apostrophe).

      This filtering also seems excessive in light of the badge specification I find at https://wiki.mozilla.org/Badges/Badge_Specification#Required_Fields and which says that name is "simply a UTF-8 String".

      It's also annoying that this filtering is done silently, removing apostrophes but not warning the user that the name was mangled.

      Perhaps the filtering could be done upon issuing the file, but leaving the name intact?

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/Jan/18