php error log bug

SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
The php error log shows the span tags and isn’t coloured correctly due to jrCore_entity_string() being used in the wrong place.
Existing code from line 5528 of jrCore/index.php:
            while ($cnt > 0) {
                $index = md5(substr($_er[$idx], 27));
                if (!isset($_ln[$index])) {
                    $level = str_replace(':', '', jrCore_string_field($_er[$idx], 5));
                    $_ln[$index] = "<span class=\"php_{$level}\">" . $_er[$idx];
                    $_nm[$index] = 1;
                }
                else {
                    $_nm[$index]++;
                }
                unset($_er[$idx]);
                $cnt--;
                $idx++;
            }
            $out = '<div id="error_log"><br>';
            foreach ($_ln as $k => $v) {
                $out .= jrCore_entity_string($v) . ' [x ' . $_nm[$k] . ']</span><br><br>';
            }

That is fixed by moving jrCore_entity_string to within the html:

             while ($cnt > 0) {
                $index = md5(substr($_er[$idx], 27));
                if (!isset($_ln[$index])) {
                    $level = str_replace(':', '', jrCore_string_field($_er[$idx], 5));
                    $_ln[$index] = "<span class=\"php_{$level}\">" . jrCore_entity_string($_er[$idx]);
                    $_nm[$index] = 1;
                }
                else {
                    $_nm[$index]++;
                }
                unset($_er[$idx]);
                $cnt--;
                $idx++;
            }
            $out = '<div id="error_log"><br>';
            foreach ($_ln as $k => $v) {
                $out .= $v . ' [x ' . $_nm[$k] . ']</span><br><br>';
            }



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 09/03/14 02:33:36AM
brian
@brian
11 years ago
10,149 posts
Thank you Steve - I will check this out.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags