Added `useCDATA` to a list of t3lib_div::array2xml() options to produce CDATA instead...
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Sat, 27 Jan 2007 18:04:14 +0000 (18:04 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Sat, 27 Jan 2007 18:04:14 +0000 (18:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1948 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 9e5fbbf..9caaeaa 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-01-24  Dmitry Dulepov  <dmitry@typo3.org>
+
+       * Added `useCDATA` to a list of t3lib_div::array2xml() options to produce CDATA instead of entities
+
 2007-01-26  Oliver Hader  <oh@inpublica.de>
 
        * Fixed bug 4814: Umlauts error in AJAX Pagetree
index e5543fc..ae66b73 100755 (executable)
@@ -2087,7 +2087,14 @@ class t3lib_div {
                                                        // Otherwise, just htmlspecialchar the stuff:
                                                $content = htmlspecialchars($v);
                                                $dType = gettype($v);
-                                               if ($dType!='string' && !$options['disableTypeAttrib']) { $attr.=' type="'.$dType.'"'; }
+                                               if ($dType == 'string') {
+                                                       if ($options['useCDATA'] && $content != $v) {
+                                                               $content = '<![CDATA[' . $v . ']]>';
+                                                       }
+                                               }
+                                               elseif (!$options['disableTypeAttrib']) {
+                                                               $attr.=' type="'.$dType.'"';
+                                               }
                                        }
                                }