Uploaded image for project: 'Community Dashboard Framework'
  1. Community Dashboard Framework
  2. CDF-21

Dashboards.js encode_prepare does not encode but 'decode' and decode does not cover all cases.

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Unknown
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      In Dashboards.js, this code is called from setParameter:

      function encode_prepare( s )
      {
      if (s != null) {
      s = s.replace(/+/g," ");
      if ($.browser == "msie" || $.browser == "opera")

      { return Utf8.decode(s); }

      }
      return s;
      }

      The intention of the function seems to be to decode URI escaped values. However, it takes only the replacement from '+' to ' ' into account.
      All javascript implementations feature a built-in decodeURIComponent which does a complete decode of URI encoded values:

      http://www.w3schools.com/jsref/jsref_decodeURIComponent.asp

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pmalves Pedro Alves
                Reporter:
                roland.bouman Roland
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: