hassanakbar4 / ttest

0 stars 0 forks source link

weird escaping problem for <workgroup> #17

Closed hassanakbar4 closed 3 years ago

hassanakbar4 commented 14 years ago

resolution_overtaken by events type_defect | by julian.reschke@gmx.de


The new code (#6) that processes for IRTF stream RFCs behaves weirdly when the workgroup element contains XML-special characters, such as "<" or ">".

Example:

  <workgroup>&lt;insert_name&gt;</workgroup>

The code does something like

  set workgroupname ""
  if {([string compare \
         [set workgroup [lindex [find_element workgroup \
                        $attrs(.CHILDREN)] 0]] ""])} {
      array set wv $elem($workgroup)
      # jre: this escapes angle brackets; why?
      set workgroupname [string trim $wv(.CTEXT)]
  }

For some strange reason that gets evaluated as

  &lt;insert_name&gt;

instead of

  <insert_name>

which of course leads to funny results when the code later does

  regsub -all -- %WORKGROUPNAME% $status "$workgroupname" status

because "&" is special in regexp processing.


Issue migrated from trac:17 at 2021-10-20 19:47:16 +0500