runcmf / runtracy

Tracy Debugger Bar for Slim Framework
Apache License 2.0
73 stars 15 forks source link

Declaring `h` function without checking if `function_exists` in VendorVersionsPanel.phtml #14

Open SadeghPM opened 6 years ago

SadeghPM commented 6 years ago

Declaring h function without checking if function_exists in VendorVersionsPanel.phtml file, cause fatal error in some situation.

for example installing runtracy alongside robmorgan/phinx cause fatal error.

tracy:

<?php

use Tracy\Helpers;

function h($str) {
    return htmlspecialchars($str, ENT_QUOTES | ENT_HTML5, 'UTF-8');
}
...

robmorgan/phinx:

if (!function_exists('h')) {
    /**
     * Convenience method for htmlspecialchars.
     */
    function h($text, $double = true, $charset = null)
    {
...

For solving problem , please use if (!function_exists('h')) { to declare h function.