I moved a site from one Nginx server to another Nginx server and when I went to access the site I get this fatal error:
Fatal error: Cannot re-assign auto-global variable _FILES in /var/www/inc/images.inc.php on line 227
Caches were cleared and template set to uni.
The code in question is:
function moveUploadedImage( $_FILES, $fname, $path_and_name, $maxsize='', $imResize='true' )
{
global $max_photo_height;
global $max_photo_width;
$height = $max_photo_height;
if ( !$height )
$height = 400;
$width = $max_photo_width;
if ( !$width )
$width = 400;
if ( $maxsize && ($_FILES[$fname]['size'] > $maxsize || $_FILES[$fname]['size'] == 0) )
{
if ( file_exists($_FILES[$fname]['tmp_name']) )
{
unlink($_FILES[$fname]['tmp_name']);
}
return false;
}
else
{
$scan = getimagesize($_FILES[$fname]['tmp_name']);
if ( ($scan['mime'] == 'image/jpeg' && $ext = '.jpg' ) ||
( $scan['mime'] == 'image/gif' && $ext = '.gif' ) ||
( $scan['mime'] == 'image/png' && $ext = '.png' ) ) //deleted .bmp format
{
$path_and_name .= $ext;
move_uploaded_file( $_FILES[$fname]['tmp_name'], $path_and_name );
if ( $imResize )
imageResize( $path_and_name, $path_and_name, $width, $height );
}
else
{
return IMAGE_ERROR_WRONG_TYPE;
}
}
return $ext;
}
I don't understand why the function is being called when I go to visit the site's home page