Issues

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

Issue Type: Bug Created: 2012-08-17T04:06:08.000+0000 Last Updated: 2012-11-07T20:11:25.000+0000 Status: Resolved Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Pavel Trizno (pavel.trizno) Assignee: Frank Brückner (frosch) Tags: - Zend_Debug

  • After1.12.0
  • FixForZF1.12.1

Related issues: Attachments: - Debug.php.patch

Description

<pre class="highlight">
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

Posted by Frank Brückner (frosch) on 2012-08-17T09:46:59.000+0000

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:

<pre class="highlight">
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);
}

Posted by Pavel Trizno (pavel.trizno) on 2012-08-17T10:04:24.000+0000

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

Posted by Frank Brückner (frosch) on 2012-08-17T10:24:15.000+0000

Patch added.

Posted by Rob Allen (rob) on 2012-11-07T20:11:25.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts