Moodle
  1. Moodle
  2. MDL-28936

Private message popup does not limit number of characters to 200

    Details

      Description

      When sending a private message to a user greater than 200 characters, the code does not limit the number of characters appended by three dots (...). This is due to an incorrect syntax in the code.

      The code in lib/moodlelib.php implies that a substr() is used if the strlen() is greater than 200, but incorrect syntax forces this IF statement to always be false and therefore set the variable to display the full message.

        Gliffy Diagrams

          Activity

          Hide
          Jason Ilicic added a comment - - edited
          Show
          Jason Ilicic added a comment - - edited Corrected syntax and pushed to GitHub: https://github.com/jasonilicic/moodle/commit/0165d0197adc2ea4717ff4bd36c41a99f1802fc7
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this and providing a solution.

          Show
          Michael de Raadt added a comment - Thanks for reporting this and providing a solution.
          Hide
          Petr Skoda added a comment -

          hmm, looks like we need to use textlib there

          Show
          Petr Skoda added a comment - hmm, looks like we need to use textlib there
          Hide
          Petr Skoda added a comment -

          ohlala, there are so many invalid strlen()s and substr()s all over the place, I have to file a separate issue for that...

          Show
          Petr Skoda added a comment - ohlala, there are so many invalid strlen()s and substr()s all over the place, I have to file a separate issue for that...
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Rossiani Wijaya added a comment -

          Tested and it works great.

          Show
          Rossiani Wijaya added a comment - Tested and it works great.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Many thanks for the hard work, this has been sent upstream and is available in all the git and cvs repositories.

          Show
          Eloy Lafuente (stronk7) added a comment - Many thanks for the hard work, this has been sent upstream and is available in all the git and cvs repositories.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: