[FOLLOWUP][BUGFIX] Do not crop inside known html tags 96/43996/2
authorBenjamin Mack <benni@typo3.org>
Sun, 11 Oct 2015 21:16:45 +0000 (23:16 +0200)
committerBenni Mack <benni@typo3.org>
Sun, 11 Oct 2015 21:18:28 +0000 (23:18 +0200)
Fixed indent spaces to tabs.

This change adds missing tags to the regex used to match html tags.
Furthermore, scripting tags are added, so that they will not be counted
nor split apart.

This list of html tags was extracted from the current W3C html5
standard recommendation at [1] and merged with tags from the current
code that are not (or no longer) in the W3C standard recommendation
(e.g: TYPO3's internal <link> tag).

---
[1]: http://www.w3.org/TR/html5/semantics.html#semantics

Change-Id: Ie1aedecbfd46c82b49f34936a96004af29c63d54
Resolves: #69263
Releases: 6.2
Reviewed-on: http://review.typo3.org/43996
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index 4b54be0..d6bf857 100644 (file)
@@ -700,17 +700,17 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                        $charset
                                ),
                                $charset . ' html elements with iframe embedded 24|...|1' => array(
-                    '24|...|1',
-                    'Text with iframe <iframe src="//what.ever/"></iframe> and text after it',
-                    'Text with iframe <iframe src="//what.ever/"></iframe> and...',
-                    $charset
-                ),
-                $charset . ' html elements with script tag embedded 24|...|1' => array(
-                    '24|...|1',
-                    'Text with script <script>alert(\'foo\');</script> and text after it',
-                    'Text with script <script>alert(\'foo\');</script> and...',
-                    $charset
-                ),
+                                       '24|...|1',
+                                       'Text with iframe <iframe src="//what.ever/"></iframe> and text after it',
+                                       'Text with iframe <iframe src="//what.ever/"></iframe> and...',
+                                       $charset
+                               ),
+                               $charset . ' html elements with script tag embedded 24|...|1' => array(
+                                       '24|...|1',
+                                       'Text with script <script>alert(\'foo\');</script> and text after it',
+                                       'Text with script <script>alert(\'foo\');</script> and...',
+                                       $charset
+                               ),
                        ));
                }
                return $data;