Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

If connection is aborted, now MediaView returns false after stopping …

…the transfer
  • Loading branch information...
commit 0300fc1c31634afcd327484978b9b30eb6ba8838 1 parent 940ce8b
@lorenzo lorenzo authored
View
8 cake/libs/view/media.php
@@ -208,7 +208,11 @@ function render() {
$this->_output();
$this->_clearBuffer();
- while (!feof($handle) && $this->_isActive()) {
+ while (!feof($handle)) {
+ if (!$this->_isActive()) {
+ fclose($handle);
+ return false;
+ }
set_time_limit(0);
$buffer = fread($handle, $chunkSize);
echo $buffer;
@@ -253,7 +257,7 @@ function _output() {
}
/**
- * Returns true if connectios is still active
+ * Returns true if connection is still active
* @return boolean
* @access protected
*/
View
2  cake/tests/cases/libs/view/media.test.php
@@ -73,7 +73,7 @@ class TestMediaView extends MediaView {
var $headers = array();
/**
- * active property to mock the status of a remote conenction
+ * active property to mock the status of a remote connection
*
* @var boolean true
* @access public
Please sign in to comment.
Something went wrong with that request. Please try again.