Skip to content

profiling formatting. #51

Description

@pgee70

Have a minor gripe about the profiling formatting

Image

queries have ?> at the end of the line.

this is traced to a bug in the text helper /pocketarc/codeigniter/system/helpers/text_helper.php highlight_code function, where it does not remove the ?> from the injected ?> in the line:

$str = highlight_string('<?php '.$str.' ?>', TRUE);

consider removing this after the <?php tag is removed: so the next line is:

$str = preg_replace(
	array(
		'/<span style="color: #([A-Z0-9]+)">&lt;\?php(&nbsp;| )/i',
		'/\?&gt;<\/span>/i',
		'/(<span style="color: #[A-Z0-9]+">.*?)\?&gt;<\/span>\n<\/span>\n<\/code>/is',
		'/<span style="color: #[A-Z0-9]+"\><\/span>/i',
	),
	array(
		'<span style="color: #$1">',
		'</span>',
		'<span style="color: #$1">',
		"$1</span>\n</span>\n</code>",
		'',
		''
	),
	$str
);

then the regex in the array will remove the empty span.

our output is then:

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions