Issues

ZF-12373: Zend_Debug::dump empty result on php 5.4.х

Description


Output is empty.

Hotfix:
in /Zend/Debug.php

public static function dump($var, $label=null, $echo=true) { // ...

if(!extension_loaded('xdebug')) { $output = htmlspecialchars($output, ENT_QUOTES | ENT_SUBSTITUTE); }

// ... } ```

Comments

Your fix includes a problem: {{ENT_SUBSTITUTE}} is available only in PHP 5.4, but ZF1 supports PHP 5.2! The {{ENT_IGNORE}} constante was added in 5.3.

My proposal:


if(!extension_loaded('xdebug')) {
    $flags = ENT_QUOTES;
    if ((version_compare(PHP_VERSION, '5.4.0') >= 0)) {
        $flags = ENT_QUOTES | ENT_SUBSTITUTE;
    }
    $output = htmlspecialchars($output, $flags);
}

Yes you are right. I thought about backward compatibility later. But I've used [code]if (!defined('ENT_SUBSTITUTE'))[/code]

Patch added.

Applied patch to trunk (25094) and release-1.2 (25095)