From d89af53f6311d9f4cec60d136cf017df9e1a36cd Mon Sep 17 00:00:00 2001 From: Fyorl Date: Sun, 8 Jul 2012 02:15:48 +0100 Subject: [PATCH] [ticket/10941] Added some comments for clarification PHPBB3-10941 --- tests/mock/fileupload.php | 7 +++++++ tests/uploads/filespec_test.php | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/mock/fileupload.php b/tests/mock/fileupload.php index 817b090346..409036ba63 100644 --- a/tests/mock/fileupload.php +++ b/tests/mock/fileupload.php @@ -21,6 +21,13 @@ class phpbb_mock_fileupload return true; } + /** + * Copied verbatim from phpBB/includes/functions_upload.php's fileupload + * class to ensure the correct behaviour of filespec::move_file. + * + * Maps file extensions to the constant in second index of the array + * returned by getimagesize() + */ public function image_types() { return array( diff --git a/tests/uploads/filespec_test.php b/tests/uploads/filespec_test.php index fe642ea24c..c3e3ddf8f2 100644 --- a/tests/uploads/filespec_test.php +++ b/tests/uploads/filespec_test.php @@ -37,6 +37,9 @@ class phpbb_filespec_test extends phpbb_test_case $config['rand_seed'] = ''; $config['rand_seed_last_update'] = time() + 600; + // This config value is normally pulled from the database which is set + // to this value at install time. + // See: phpBB/install/schemas/schema_data.sql $config['mime_triggers'] = 'body|head|html|img|plaintext|a href|pre|script|table|title'; $user = new phpbb_mock_user(); @@ -104,6 +107,9 @@ class phpbb_filespec_test extends phpbb_test_case public function additional_checks_variables() { + // False here just indicates the file is too large and fails the + // filespec::additional_checks method because of it. All other code + // paths in that method are covered elsewhere. return array( array('gif', true), array('jpg', false), @@ -129,6 +135,8 @@ class phpbb_filespec_test extends phpbb_test_case public function check_content_variables() { + // False here indicates that a file is non-binary and contains + // disallowed content that makes IE report the mimetype incorrectly. return array( array('gif', true), array('jpg', true),