mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Correcting constructor of MediaView to fix issues with viewVars not being set.
Correcting use of MediaView in Dispatcher. Fixes #366
This commit is contained in:
parent
0293a840c5
commit
547ed839d9
2 changed files with 7 additions and 3 deletions
|
@ -605,7 +605,8 @@ class Dispatcher extends Object {
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
App::import('View', 'Media', false);
|
App::import('View', 'Media', false);
|
||||||
$Media = new MediaView();
|
$controller = null;
|
||||||
|
$Media = new MediaView($controller);
|
||||||
$ext = array_pop(explode('.', $url));
|
$ext = array_pop(explode('.', $url));
|
||||||
|
|
||||||
if (isset($Media->mimeType[$ext])) {
|
if (isset($Media->mimeType[$ext])) {
|
||||||
|
|
|
@ -17,7 +17,9 @@
|
||||||
* @since CakePHP(tm) v 1.2.0.5714
|
* @since CakePHP(tm) v 1.2.0.5714
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
class MediaView {
|
App::import('View', 'View', false);
|
||||||
|
|
||||||
|
class MediaView extends View {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds known mime type mappings
|
* Holds known mime type mappings
|
||||||
|
@ -90,7 +92,8 @@ class MediaView {
|
||||||
*
|
*
|
||||||
* @param object $controller
|
* @param object $controller
|
||||||
*/
|
*/
|
||||||
function __construct($controller = null) {
|
function __construct(&$controller = null) {
|
||||||
|
parent::__construct($controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue