Close Connection when there is no connection value.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13161 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2013-09-25 15:29:32 +00:00
parent 034a5c0288
commit f70ce644ce
1410 changed files with 7188 additions and 53541 deletions

View file

@ -89,18 +89,26 @@ class fileController extends file
*/
function procFileImageResize()
{
$source_src = Context::get('source_src');
$file_srl = Context::get('file_srl');
$width = Context::get('width');
$height = Context::get('height');
$type = Context::get('type');
$output_src = Context::get('output_src');
if(!$source_src || !$width) return new Object(-1,'msg_invalid_request');
if(!$output_src)
if(!$file_srl || !$width)
{
$output_src = $source_src . '.resized' . strrchr($source_src,'.');
return new Object(-1,'msg_invalid_request');
}
if(!$type) $type = 'ratio';
$oFileModel = getModel('file');
$fileInfo = $oFileModel->getFile($file_srl);
if(!$fileInfo || $fileInfo->direct_download != 'Y')
{
return new Object(-1,'msg_invalid_request');
}
$source_src = $fileInfo->uploaded_filename;
$output_src = $source_src . '.resized' . strrchr($source_src,'.');
$type = 'ratio';
if(!$height) $height = $width-1;
if(FileHandler::createImageFile($source_src,$output_src,$width,$height,'','ratio'))
@ -306,6 +314,8 @@ class fileController extends file
unset($_SESSION[$session_key][$file_srl]);
Context::close();
$fp = fopen($uploaded_filename, 'rb');
if(!$fp) return $this->stop('msg_file_not_found');
@ -329,8 +339,6 @@ class fileController extends file
fpassthru($fp);
}
Context::close();
exit();
}