Follow-up to bug #15326: htmlArea RTE: W3C Markup Validation issues (Thanks to Jigal...
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 13 Sep 2010 01:03:25 +0000 (01:03 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 13 Sep 2010 01:03:25 +0000 (01:03 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-4@8779 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php

index 784717b..dfc0453 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-12  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Follow-up to bug #15326: htmlArea RTE: W3C Markup Validation issues (Thanks to Jigal van Hemert)
+
 2010-09-12  Steffen Kamper  <steffen@typo3.org>
 
        * Fixed bug #15390: sys_action taskcenter create/edit be-user actions do not work (Thanks to Georg Ringer)
index bf7aedf..7713e1c 100644 (file)
@@ -1,3 +1,7 @@
+2010-09-12  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Follow-up to bug #15326: htmlArea RTE: W3C Markup Validation issues (Thanks to Jigal van Hemert)
+
 2010-09-04  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #15326: htmlArea RTE: W3C Markup Validation issues
index f6c27ea..ad2543a 100644 (file)
@@ -380,7 +380,8 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        }
                                // Register RTE windows
                        $this->TCEform->RTEwindows[] = $PA['itemFormElName'];
-                       $textAreaId = htmlspecialchars(preg_replace('/\[|\]/', '_', $PA['itemFormElName']));
+                       $textAreaId = preg_replace('/[^a-zA-Z0-9_:.-]/', '_', $PA['itemFormElName']);
+                       $textAreaId = htmlspecialchars(preg_replace('/^[^a-zA-Z]/', 'x', $textAreaId));
 
                                // Check if wizard_rte called this for fullscreen edtition; if so, change the size of the RTE to fullscreen using JS
                        if (basename(PATH_thisScript) == 'wizard_rte.php') {
index 7fba476..db54588 100644 (file)
@@ -248,7 +248,8 @@ class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
 
                        // Register RTE windows:
                $this->TCEform->RTEwindows[] = $PA['itemFormElName'];
-               $textAreaId = htmlspecialchars(preg_replace('/\[|\]/', '_', $PA['itemFormElName'])) . '_' . strval($this->TCEform->RTEcounter);
+               $textAreaId = preg_replace('/[^a-zA-Z0-9_:.-]/', '_', $PA['itemFormElName']);
+               $textAreaId = htmlspecialchars(preg_replace('/^[^a-zA-Z]/', 'x', $textAreaId)) . '_' . strval($this->TCEform->RTEcounter);
 
                        // Register RTE in JS:
                $this->TCEform->additionalJS_post[] = $this->registerRTEinJS($this->TCEform->RTEcounter, '', '', '',$textAreaId);