diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-29 00:01:26 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-29 00:01:26 -0800 |
commit | 42018444222b8d5324bca337f8808ba0db00fbd2 (patch) | |
tree | dd2fbe28b79fe7b9b3686af9720981c2dd588f63 /modules/filter/filter.test | |
parent | ef58b066db0ad3b57cb401ae09fc4021fc097513 (diff) | |
download | brdo-42018444222b8d5324bca337f8808ba0db00fbd2.tar.gz brdo-42018444222b8d5324bca337f8808ba0db00fbd2.tar.bz2 |
Issue #998590 by das-peter: Fixed Prevent double CDATA section escaping in filter_dom_serialize_escape_cdata_element() to avoid warnings.
Diffstat (limited to 'modules/filter/filter.test')
-rw-r--r-- | modules/filter/filter.test | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/modules/filter/filter.test b/modules/filter/filter.test index 67d08333d..2bafd476c 100644 --- a/modules/filter/filter.test +++ b/modules/filter/filter.test @@ -1637,6 +1637,79 @@ alert("test") /* Styling */ body {color:red} /*--><!]]>*/ </style></p>', t('HTML corrector -- CDATA added to a style element.')); + + $filtered_data = _filter_htmlcorrector('<p><style> +/*<![CDATA[*/ +/* Styling */ +body {color:red} +/*]]>*/ +</style></p>'); + $this->assertEqual($filtered_data, '<p><style> +<!--/*--><![CDATA[/* ><!--*/ + +/*<![CDATA[*/ +/* Styling */ +body {color:red} +/*]]]]><![CDATA[>*/ + +/*--><!]]>*/ +</style></p>', + t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '/*<![CDATA[*/')) + ); + + $filtered_data = _filter_htmlcorrector('<p><style> + <!--/*--><![CDATA[/* ><!--*/ + /* Styling */ + body {color:red} + /*--><!]]>*/ +</style></p>'); + $this->assertEqual($filtered_data, '<p><style> +<!--/*--><![CDATA[/* ><!--*/ + + <!--/*--><![CDATA[/* ><!--*/ + /* Styling */ + body {color:red} + /*--><!]]]]><![CDATA[>*/ + +/*--><!]]>*/ +</style></p>', + t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--/*--><![CDATA[/* ><!--*/')) + ); + + $filtered_data = _filter_htmlcorrector('<p><script type="text/javascript"> +<!--//--><![CDATA[// ><!-- + alert("test"); +//--><!]]> +</script></p>'); + $this->assertEqual($filtered_data, '<p><script type="text/javascript"> +<!--//--><![CDATA[// ><!-- + +<!--//--><![CDATA[// ><!-- + alert("test"); +//--><!]]]]><![CDATA[> + +//--><!]]> +</script></p>', + t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--//--><![CDATA[// ><!--')) + ); + + $filtered_data = _filter_htmlcorrector('<p><script type="text/javascript"> +// <![CDATA[ + alert("test"); +// ]]> +</script></p>'); + $this->assertEqual($filtered_data, '<p><script type="text/javascript"> +<!--//--><![CDATA[// ><!-- + +// <![CDATA[ + alert("test"); +// ]]]]><![CDATA[> + +//--><!]]> +</script></p>', + t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '// <![CDATA[')) + ); + } /** |