Merge pull request #1164 from abishai/master

compat for php 5.4.  Fixes #1163
This commit is contained in:
Kyle Johnson 2015-11-16 09:28:03 -07:00
commit c0216f74cb
1 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,21 @@ if ( !canView( 'Events' ) )
header( 'Content-type: image/jpeg' ); header( 'Content-type: image/jpeg' );
// Compatibility for PHP 5.4
if (!function_exists('imagescale'))
{
function imagescale($image, $new_width, $new_height = -1, $mode = 0)
{
$mode; // Not supported
$new_height = ($new_height == -1) ? imagesy($image) : $new_height;
$imageNew = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($imageNew, $image, 0, 0, 0, 0, (int)$new_width, (int)$new_height, imagesx($image), imagesy($image));
return $imageNew;
}
}
$errorText = false; $errorText = false;
if ( empty($_REQUEST['path']) ) if ( empty($_REQUEST['path']) )
{ {