Moodle
  1. Moodle
  2. MDL-6128

1.6, special chars and messaging system.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7.2, 1.8
    • Component/s: Messages
    • Labels:
      None
    • Environment:
      All
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Rank:
      28466

      Description

      We have just installed Moodle 1.6 and when we use any special char from Spanish, such á é or ñ, in the messaging system, the message is truncated exactly where the first special char appears.

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Eduardo Hernandez (eduardo at go2learn.cl) Monday, 17 July 2006, 02:46 AM:

          I was looking in the source code, and in file send.php and in line 39 says

          $message = optional_param('message', '', PARAM_CLEANHTML);

          I changed it to

          $message = optional_param('message', '', PARAM_RAW);

          and now it works....

          I don't if this is a final solution but it works

          Eduardo

          From Petr Skoda (skodak at centrum.cz) Monday, 17 July 2006, 03:35 AM:

          That is definitely a bad idea to change type to PARAM_RAW because my might create a serious security problem!

          It works fine for me on my test server, could you send me a testing login/password by email?

          BTW did you try standard theme?

          Hmm, I see you are using PHP 5.0.4 - that is strongly discouraged because there are known problems with it

          From Eduardo Hernandez (eduardo at go2learn.cl) Monday, 17 July 2006, 11:55 PM:

          Hi petr ,

          Thanks so much for checking this. Well, I would like to give you some more details. As son as i type the message, it appears correctly in the current Window. however, if, later, I go and check the message history messages are truncated. If I go and take a look at the DB directly, I see that the messages are truncated in the DB.

          Anyway, I will talk to our IT dept. to give you access to our server. I will contact you personally by e-mail with the user/pass.

          Show
          Martin Dougiamas added a comment - From Eduardo Hernandez (eduardo at go2learn.cl) Monday, 17 July 2006, 02:46 AM: I was looking in the source code, and in file send.php and in line 39 says $message = optional_param('message', '', PARAM_CLEANHTML); I changed it to $message = optional_param('message', '', PARAM_RAW); and now it works.... I don't if this is a final solution but it works Eduardo From Petr Skoda (skodak at centrum.cz) Monday, 17 July 2006, 03:35 AM: That is definitely a bad idea to change type to PARAM_RAW because my might create a serious security problem! It works fine for me on my test server, could you send me a testing login/password by email? BTW did you try standard theme? Hmm, I see you are using PHP 5.0.4 - that is strongly discouraged because there are known problems with it From Eduardo Hernandez (eduardo at go2learn.cl) Monday, 17 July 2006, 11:55 PM: Hi petr , Thanks so much for checking this. Well, I would like to give you some more details. As son as i type the message, it appears correctly in the current Window. however, if, later, I go and check the message history messages are truncated. If I go and take a look at the DB directly, I see that the messages are truncated in the DB. Anyway, I will talk to our IT dept. to give you access to our server. I will contact you personally by e-mail with the user/pass.
          Hide
          Jussi Hannunen added a comment -

          Petr or Martin, if you are willing to look at our problem at moodle.tpu.fi, would access as a Moodle user be enough, or would you need server access? (I too would have to ask IT dept for server access, and they probably would say no.)

          Show
          Jussi Hannunen added a comment - Petr or Martin, if you are willing to look at our problem at moodle.tpu.fi, would access as a Moodle user be enough, or would you need server access? (I too would have to ask IT dept for server access, and they probably would say no.)
          Hide
          Petr Škoda added a comment -

          Hi Jussi,
          if you send me two user accounts by email I will try to diagnose the problem, thanks.

          skodak

          Show
          Petr Škoda added a comment - Hi Jussi, if you send me two user accounts by email I will try to diagnose the problem, thanks. skodak
          Hide
          Séverin Terrier added a comment -

          I also have this problem on a Moodle 1.6.2+ (2006/09/21)

          I can fix this by modifying the apache server configuration (httpd.conf), on this line :
          AddDefaultCharset ISO-8859-1

          If i comment it, the problem disapear...

          But i think that Moodle should'nt rely on apache configuration !

          Show
          Séverin Terrier added a comment - I also have this problem on a Moodle 1.6.2+ (2006/09/21) I can fix this by modifying the apache server configuration (httpd.conf), on this line : AddDefaultCharset ISO-8859-1 If i comment it, the problem disapear... But i think that Moodle should'nt rely on apache configuration !
          Hide
          Jussi Hannunen added a comment -

          Petr, sorry about not replying. I was certain that I was "watching" this issue, so didn't check and see your reply until just now.

          Anyways, upgraded to 1.6.2+ (of Monday the 2nd of October). Same error, but Severin's fix works for us too. Or rather changing "AddDefaultCharset on" to "AddDefaultCharset utf-8" worked for us. Unlike Severin, I would be inclined to think that was the problem all along, our apache configuration was wrong.

          Jussi,
          watching now

          Show
          Jussi Hannunen added a comment - Petr, sorry about not replying. I was certain that I was "watching" this issue, so didn't check and see your reply until just now. Anyways, upgraded to 1.6.2+ (of Monday the 2nd of October). Same error, but Severin's fix works for us too. Or rather changing "AddDefaultCharset on" to "AddDefaultCharset utf-8" worked for us. Unlike Severin, I would be inclined to think that was the problem all along, our apache configuration was wrong. Jussi, watching now
          Hide
          Petr Škoda added a comment -

          Now I know where to look for the problem, I think I will be able to fix it. I will get back to bugfixing in 1.6.x shortly after 1.7 release that is planned to happen this month

          Show
          Petr Škoda added a comment - Now I know where to look for the problem, I think I will be able to fix it. I will get back to bugfixing in 1.6.x shortly after 1.7 release that is planned to happen this month
          Hide
          Petr Škoda added a comment -

          Should be fixed in latest 1.6.2+ and 1.7dev. Please reopen if the problem persists

          Show
          Petr Škoda added a comment - Should be fixed in latest 1.6.2+ and 1.7dev. Please reopen if the problem persists
          Hide
          Robert Allerstorfer added a comment -

          I am experiencing this problem in the latest currenlty available Moodle, 1.7.1+ (stable17/moodle-20070127), see the following 2 screenshot -the first from the sending browser (how the UTF-8 special char correctly looks), the second from the receiving user's browser (with the broken special char, not being displayed in UTF-8)

          Show
          Robert Allerstorfer added a comment - I am experiencing this problem in the latest currenlty available Moodle, 1.7.1+ (stable17/moodle-20070127), see the following 2 screenshot -the first from the sending browser (how the UTF-8 special char correctly looks), the second from the receiving user's browser (with the broken special char, not being displayed in UTF-8)
          Hide
          Robert Allerstorfer added a comment -

          as you might have recognized, the screenshot "screenshot-1.jpg " is somehow broken - this is the result of the Java applet I have been using to paste it - I will no longer use this weired tool. And, it should have been "the first" mentioned in my previous post. With this tracker app, I am not able to edit/delete that crap, so it's still there. Anyway, the problem should still be clear.

          Also, this tracker app does not let me change this ticket's status or reopen it.

          I have already found and fixed the bug - it's in message/refresh.php (which was still version 1.7 from 2006-01-05 coming with Moodle 1.7.1):

          Change
          header('Content-Type: text/html');
          to
          header('Content-Type: text/html; charset=' . $encoding);

          Show
          Robert Allerstorfer added a comment - as you might have recognized, the screenshot "screenshot-1.jpg " is somehow broken - this is the result of the Java applet I have been using to paste it - I will no longer use this weired tool. And, it should have been "the first" mentioned in my previous post. With this tracker app, I am not able to edit/delete that crap, so it's still there. Anyway, the problem should still be clear. Also, this tracker app does not let me change this ticket's status or reopen it. I have already found and fixed the bug - it's in message/refresh.php (which was still version 1.7 from 2006-01-05 coming with Moodle 1.7.1): Change header('Content-Type: text/html'); to header('Content-Type: text/html; charset=' . $encoding);
          Hide
          Petr Škoda added a comment -

          reclosing, fixed in 1.6.x, 1.7.x and HEAD cvs

          thanks for the report!

          Show
          Petr Škoda added a comment - reclosing, fixed in 1.6.x, 1.7.x and HEAD cvs thanks for the report!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: