From cda1f46d8c402c14239ba96560375dcacd05f2c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 29 Nov 2012 16:37:26 +0000 Subject: [PATCH] Check against interface Compressor, not for methods --- inc/classes/middleware/compressor/class_CompressorChannel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index c1b213cf..8ca26e13 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -94,10 +94,10 @@ class CompressorChannel extends BaseMiddleware implements Registerable { if ( (is_null($compressorInstance->getCompressor())) || (!is_object($compressorInstance->getCompressor())) - || (!method_exists($compressorInstance->getCompressor(), 'compressStream')) - || (!method_exists($compressorInstance->getCompressor(), 'decompressStream')) + || (!$compressorInstance instanceof Compressor) ) { // Set the null compressor handler. This should not be configureable! + // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay? $compressorInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor')); } // END - if -- 2.39.5