[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
This commit is contained in:
Chris Smith 2010-09-10 00:10:40 +01:00
parent 818955062a
commit 0a50a02b66

View file

@ -564,26 +564,27 @@ function get_supported_image_types($type = false)
switch ($type) switch ($type)
{ {
// GIF // GIF
case 1: case IMAGETYPE_GIF:
$new_type = ($format & IMG_GIF) ? IMG_GIF : false; $new_type = ($format & IMG_GIF) ? IMG_GIF : false;
break; break;
// JPG, JPC, JP2 // JPG, JPC, JP2
case 2: case IMAGETYPE_JPEG:
case 9: case IMAGETYPE_JPC:
case 10: case IMAGETYPE_JPEG2000:
case 11: case IMAGETYPE_JP2:
case 12: case IMAGETYPE_JPX:
case IMAGETYPE_JB2:
$new_type = ($format & IMG_JPG) ? IMG_JPG : false; $new_type = ($format & IMG_JPG) ? IMG_JPG : false;
break; break;
// PNG // PNG
case 3: case IMAGETYPE_PNG:
$new_type = ($format & IMG_PNG) ? IMG_PNG : false; $new_type = ($format & IMG_PNG) ? IMG_PNG : false;
break; break;
// WBMP // WBMP
case 15: case IMAGETYPE_WBMP:
$new_type = ($format & IMG_WBMP) ? IMG_WBMP : false; $new_type = ($format & IMG_WBMP) ? IMG_WBMP : false;
break; break;
} }