Moodle
  1. Moodle
  2. MDL-12384

Wrong words (eg. "++") are matched as CamelCase in spite of "Disable CamelCase Linking"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      All platform

      Description

      I've been in the face of two strange phenomenons under using ewiki on Moodle1.8. Under checking "Disable CamelCase Linking" on ewiki (Moodle1.8, 1.7, ...), Camel case words (eg. UsingMoodle, WikiModule...) does not match as Camel case. On the other hand, unexpected words (eg. a+, a][, ...) will match as Camel case.

      The cause of these problems is on following code, in mod/wiki/ewiki/ewiki.php

      if ($moodle_disable_camel_case)

      { define("EWIKI_CHARS_L", ""); define("EWIKI_CHARS_U", ""); }

      else

      { define("EWIKI_CHARS_L", "a-z_??$\337-\377"); define("EWIKI_CHARS_U", "A-Z0-9\300-\336"); }

      Please change this block as follows,

      if ($moodle_disable_camel_case)

      { define("EWIKI_CHARS_L", "\t"); define("EWIKI_CHARS_U", "\r"); }

      else

      { define("EWIKI_CHARS_L", "a-z_??$\337-\377"); define("EWIKI_CHARS_U", "A-Z0-9\300-\336"); }

      EWIKI_CHARS_L is Tab code, EWIKI_CHARS_U is Carriage return code.
      Tab & CR are not so important. But it's dangerous that EWIKI_CHARS_L and EWIKI_CHARS_U are blank.

      Please see also http://moodle.org/mod/forum/discuss.php?d=85554 .

        Gliffy Diagrams

          Activity

          Hide
          Tatsuya Shirai added a comment -

          Following block is not need. This block affects Wiki contents. Very dangerous.
          Please comment out.

          mod/wiki/ewiki/ewiki.php?function ewiki_format()?Line 1952,

              • text style triggers
                foreach ($wm_style as $find=>$replace)
                Unknown macro: { $find_len = strlen($find); $loop = 20; while(($loop--) && (($l = strpos($line, $find)) !== false) && ($r = strpos($line, $find, $l + $find_len))) { $line = substr($line, 0, $l) . $replace[0] . substr($line, $l + strlen($find), $r - $l - $find_len) . $replace[1] . substr($line, $r + $find_len); } }

          Example) '==' disapears.

          Show
          Tatsuya Shirai added a comment - Following block is not need. This block affects Wiki contents. Very dangerous. Please comment out. mod/wiki/ewiki/ewiki.php?function ewiki_format()?Line 1952, text style triggers foreach ($wm_style as $find=>$replace) Unknown macro: { $find_len = strlen($find); $loop = 20; while(($loop--) && (($l = strpos($line, $find)) !== false) && ($r = strpos($line, $find, $l + $find_len))) { $line = substr($line, 0, $l) . $replace[0] . substr($line, $l + strlen($find), $r - $l - $find_len) . $replace[1] . substr($line, $r + $find_len); } } Example) '==' disapears.
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this issue.

          We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

          If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

          Michael d;

          4d6f6f646c6521

          Show
          Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; 4d6f6f646c6521
          Hide
          Michael de Raadt added a comment -

          I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

          If you still believe this is an issue in supported versions, please report a new issue.

          Show
          Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you still believe this is an issue in supported versions, please report a new issue.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: