Index: openacs-4/packages/acs-templating/www/doc/noquote.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/noquote.adp,v diff -u -r1.3.2.2 -r1.3.2.3 --- openacs-4/packages/acs-templating/www/doc/noquote.adp 25 Aug 2015 18:02:10 -0000 1.3.2.2 +++ openacs-4/packages/acs-templating/www/doc/noquote.adp 1 Dec 2015 11:18:00 -0000 1.3.2.3 @@ -5,9 +5,9 @@ Requirements + rightLink="" rightLabel="">

@@ -66,14 +66,14 @@ in fact comes from the database and you don't want it to, for instance, close the <i> behind your back, you should quote it, and then enclose it between <i> and </i>.

The ACS has a procedure that performs HTML quoting, -ad_quotehtml. It accepts the string that needs to be quoted, and +ns_quotehtml. It accepts the string that needs to be quoted, and returns the quoted string. In ACS 3.x, properly written code was -expected to call ad_quotehtml every time it published a string to a +expected to call ns_quotehtml every time it published a string to a web page. For example:

 doc_body_append "<ul>\n" set db [ns_db gethandle] set selection
 [ns_db select $db {SELECT name FROM bboard_forums}] while {[ns_db
 getrow $db $selection]} { set_variables_after_query doc_body_append
-"<li>Forum: <tt>[ad_quotehtml $name]</tt>\n" }
+"<li>Forum: <tt>[ns_quotehtml $name]</tt>\n" }
 doc_body_append "</ul>\n"
 

Obviously, this was very error-prone, and more often than not, the programmers would forget to quote the variables that come from @@ -121,7 +121,7 @@ still supports all the ADP features, including embedding Tcl code in the template. Thus instead of referring to the multirow variable with the \@forums.name\@ variable substitutions, we use -<%= [ad_quotehtml \@forums.name\@] %>. This +<%= [ns_quotehtml \@forums.name\@] %>. This works correctly, but obviously breaks the abstraction barrier between ADP and Tcl syntaxes. The practical result of breaking the abstraction is that every occurrence of Tcl code in an ADP template @@ -131,7 +131,7 @@ where not handling it would quote immediate and visible breakage, such as in the case of displaying the bodies of bboard articles. This is not exaggeration; it has been proven by auditing the ACS -4.0, both manually and through grepping for ad_quotehtml. +4.0, both manually and through grepping for ns_quotehtml. Strangely, this otherwise sad fact allows us to deploy a very radical but much more robust solution to the problem.

@@ -184,8 +184,8 @@
+ leftLink="" leftLabel="" leftTitle="" + rightLink="" rightLabel="" rightTitle="" + homeLink="" homeLabel="" + upLink="" upLabel=""> \ No newline at end of file