summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2014-04-15 19:50:33 +0200
committerLukas Reschke <lukas@statuscode.ch>2014-04-15 19:50:33 +0200
commitffab31e3ee491b89f2263ee60497526fab5f61f5 (patch)
treee0b9b52655a1740016f10c5d22a38beebb7e5be3 /tests
parent9de1cc52c0b2c0446e44b597b976bf693bf717e5 (diff)
parent2fb68c120b0b1f9c6d7ed9e3f10d595ffd080ddb (diff)
downloadnextcloud-server-ffab31e3ee491b89f2263ee60497526fab5f61f5.tar.gz
nextcloud-server-ffab31e3ee491b89f2263ee60497526fab5f61f5.zip
Merge pull request #8197 from owncloud/secure_mimetypes
White-list known secure mime types. Refs. #8184
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/helper.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index 0943e6bc1b9..5d319e40f02 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -71,6 +71,18 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
$this->assertEquals($result, $expected);
}
+ function testGetSecureMimeType() {
+ $dir=OC::$SERVERROOT.'/tests/data';
+
+ $result = OC_Helper::getSecureMimeType('image/svg+xml');
+ $expected = 'text/plain';
+ $this->assertEquals($result, $expected);
+
+ $result = OC_Helper::getSecureMimeType('image/png');
+ $expected = 'image/png';
+ $this->assertEquals($result, $expected);
+ }
+
function testGetFileNameMimeType() {
$this->assertEquals('text/plain', OC_Helper::getFileNameMimeType('foo.txt'));
$this->assertEquals('image/png', OC_Helper::getFileNameMimeType('foo.png'));