Index: openacs-4/packages/notifications/tcl/notification-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-email-procs.tcl,v diff -u -N -r1.38.2.2 -r1.38.2.3 --- openacs-4/packages/notifications/tcl/notification-email-procs.tcl 12 Sep 2016 11:02:28 -0000 1.38.2.2 +++ openacs-4/packages/notifications/tcl/notification-email-procs.tcl 25 Nov 2016 10:43:07 -0000 1.38.2.3 @@ -137,10 +137,26 @@ # DAVEB convert relative URLs to fully qualified URLs set host "[string trimright [ad_url] "/"]/" - set re {(href|src)=['\"][^(http|https|mailto:)]/?([^'\"]+?)['\"]} - set subspec "\\1='${host}\\2'" - set content [regsub -all $re $content $subspec] + #set re {(href|src)=['\"][^(http|https|mailto:)]/?([^'\"]+?)['\"]} + #set subspec "\\1='${host}\\2'" + #set content [regsub -all $re $content $subspec] + # Protect all full qualified URLs with special characters (one + # rule for single quotes, one for double quotes). + regsub -nocase -all \ + {(href|src)\s*=\s*'((http|https|ftp|mailto):[^'\"]+)'} $content \ + "\\1='\u0001\\2\u0002'" content + regsub -nocase -all \ + {(href|src)\s*=\s*[\"]((http|https|ftp|mailto):[^'\"]+)[\"]} $content \ + "\\1=\"\u0001\\2\u0002\"" content + + set content [regsub -all {(href|src)=['\"]([^\u0001:'\"]+?)['\"]} $html "\\1='${host}\\2'"] + # + # remove protection characters + # + regsub -nocase -all {((href|src)\s*=\s*['\"]?)\u0001([^\u0002]*)\u0002} $content {\1\3} content + + # Use this to build up extra mail headers set extra_headers [list]