[svn-commits] wdoekes: trunk r344838 - in /trunk: ./ main/manager.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Nov 11 15:34:00 CST 2011


Author: wdoekes
Date: Fri Nov 11 15:33:54 2011
New Revision: 344838

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=344838
Log:
Fix bad quoting of multiline mxml opaque_data that caused invalid xml.

The opaque_data was added and enclosed in single quotes, assuming it
would be only a single line. The rest of the lines were appended after
the closing quote.

(closes issue ASTERISK-18852)
Reported by: peep_ on IRC

Review: https://reviewboard.asterisk.org/r/1577
........

Merged revisions 344835 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 344836 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/main/manager.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=344838&r1=344837&r2=344838
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Fri Nov 11 15:33:54 2011
@@ -5755,9 +5755,10 @@
 		}
 
 		if (in_data) {
-			/* Process data field in Opaque mode */
+			/* Process data field in Opaque mode. This is a
+			 * followup, so we re-add line feeds. */
+			ast_str_append(out, 0, xml ? "\n" : "<br>\n");
 			xml_copy_escape(out, val, 0);   /* data field */
-			ast_str_append(out, 0, xml ? "\n" : "<br>\n");
 			continue;
 		}
 
@@ -5793,7 +5794,9 @@
 		ao2_ref(vc, -1);
 		ast_str_append(out, 0, xml ? "='" : "</td><td>");
 		xml_copy_escape(out, val, 0);	/* data field */
-		ast_str_append(out, 0, xml ? "'" : "</td></tr>\n");
+		if (!in_data || !*in) {
+			ast_str_append(out, 0, xml ? "'" : "</td></tr>\n");
+		}
 	}
 
 	if (inobj) {




More information about the svn-commits mailing list