Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix XML renderer crash #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sei-Lisa
Copy link
Contributor

The XML renderer crashed because two styler properties it expected to be public are now private. Fixed by adding the corresponding getXXX functions to the styler.

The XML renderer crashed because two styler properties it expected to be public are now private. Fixed by adding the corresponding getXXX functions to the styler.
@Sei-Lisa
Copy link
Contributor Author

Test case:

<?php
include('class.geshi.php');
require_once GESHI_CLASSES_ROOT.'class.geshirenderer.php';
require_once GESHI_RENDERERS_ROOT.'class.geshirendererxml.php';

$geshi = new GeSHi('var a = 1.0;
// comment
function x() {
  var b = Math.PI;
  var c = "string\\n" + \'string\';
  return b;
}
', 'javascript');
$geshi->setRenderer(new GeSHiRendererXML);
echo $geshi->parseCode();

Without patch:
Fatal error: Cannot access private property GeSHiStyler::$language in /<path>/geshi/classes/renderers/class.geshirendererxml.php on line 129

With patch, output is generated but it includes css="Array" everywhere in the output, as expected as per issue #3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant