From 7ac94421bf85eb04c00c5ed05390e1ea0c6bcb0b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 25 Dec 2012 18:06:17 +0100 Subject: Move washtml class into Roundcube Framework (rcube_washtml), add some improvements --- tests/Framework/Washtml.php | 28 ++++++++++++++++++++++++++++ tests/MailFunc.php | 2 +- tests/phpunit.xml | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/Framework/Washtml.php (limited to 'tests') diff --git a/tests/Framework/Washtml.php b/tests/Framework/Washtml.php new file mode 100644 index 000000000..088ac4a8c --- /dev/null +++ b/tests/Framework/Washtml.php @@ -0,0 +1,28 @@ +Firefox' + .'Internet Explorer

'; + + $washer = new rcube_washtml; + + $washed = $washer->wash($html); + + $this->assertNotRegExp('/data:text/', $washed, "Remove data:text/html links"); + $this->assertNotRegExp('/vbscript:/', $washed, "Remove vbscript: links"); + } + +} diff --git a/tests/MailFunc.php b/tests/MailFunc.php index 4d4250c22..38c0bac30 100644 --- a/tests/MailFunc.php +++ b/tests/MailFunc.php @@ -173,7 +173,7 @@ class MailFunc extends PHPUnit_Framework_TestCase function test_resolve_base() { $html = file_get_contents(TESTS_DIR . 'src/htmlbase.txt'); - $html = rcmail_resolve_base($html); + $html = rcube_washtml::resolve_base($html); $this->assertRegExp('|src="http://alec\.pl/dir/img1\.gif"|', $html, "URI base resolving [1]"); $this->assertRegExp('|src="http://alec\.pl/dir/img2\.gif"|', $html, "URI base resolving [2]"); diff --git a/tests/phpunit.xml b/tests/phpunit.xml index c9e229e97..627b4120d 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -28,6 +28,7 @@ Framework/User.php Framework/Utils.php Framework/VCard.php + Framework/Washtml.php HtmlToText.php MailFunc.php -- cgit v1.2.3