aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2010-09-10 00:10:40 +0100
committerChris Smith <toonarmy@phpbb.com>2010-09-10 21:26:20 +0100
commit0a50a02b66e9a921b1b798e40fe5f70ce5a23fa1 (patch)
tree78789b3432ea9725949e8595f6222d24f80cda5e /phpBB/includes/functions_posting.php
parent818955062a10919312bf038b58c4eb8718a04134 (diff)
downloadforums-0a50a02b66e9a921b1b798e40fe5f70ce5a23fa1.tar
forums-0a50a02b66e9a921b1b798e40fe5f70ce5a23fa1.tar.gz
forums-0a50a02b66e9a921b1b798e40fe5f70ce5a23fa1.tar.bz2
forums-0a50a02b66e9a921b1b798e40fe5f70ce5a23fa1.tar.xz
forums-0a50a02b66e9a921b1b798e40fe5f70ce5a23fa1.zip
[ticket/7252] Replace magic values with PHP constants.
get_supported_image_types() in includes/functions_posting.php contained the values of PHP constants hardcoded instead of using the constants. PHPBB3-7252
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 5e25648eb8..6a53213230 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -564,26 +564,27 @@ function get_supported_image_types($type = false)
switch ($type)
{
// GIF
- case 1:
+ case IMAGETYPE_GIF:
$new_type = ($format & IMG_GIF) ? IMG_GIF : false;
break;
// JPG, JPC, JP2
- case 2:
- case 9:
- case 10:
- case 11:
- case 12:
+ case IMAGETYPE_JPEG:
+ case IMAGETYPE_JPC:
+ case IMAGETYPE_JPEG2000:
+ case IMAGETYPE_JP2:
+ case IMAGETYPE_JPX:
+ case IMAGETYPE_JB2:
$new_type = ($format & IMG_JPG) ? IMG_JPG : false;
break;
// PNG
- case 3:
+ case IMAGETYPE_PNG:
$new_type = ($format & IMG_PNG) ? IMG_PNG : false;
break;
// WBMP
- case 15:
+ case IMAGETYPE_WBMP:
$new_type = ($format & IMG_WBMP) ? IMG_WBMP : false;
break;
}