Jump to content

highlight_string adds a 1 to the end of everything


Username:

Recommended Posts

>subject.

 

Why does it do this and how can I fix it?

 

Example:

 

I write

 

<?php
echo"hello world!";
?>
other stuff/html here

 

After I submit I see this:

 

 

<?php
echo"hello world!";
?>
other stuff/html here

1

 

I'm using Geshi w/ highlight_string

 

This also happens if I use htmlspecialchars + highlight_string

Guess I should've posted this before..

<?php
define('ROOT', '../');
include ROOT.'common/common.php';
include ROOT.'common/header.php';
include('geshi/geshi.php');
print("<fieldset class='menu main'>");
$paste = $_GET['paste'];
$myFile = "pastes/$paste";
$fh = fopen($myFile, 'r');
$banip = fread($fh, filesize($myFile));
$source = highlight_string($banip);
$language = 'php';
$path = 'geshi/';
$geshi = new GeSHi($source, $language, $path);
echo $geshi->parse_code();
print("<br /><hr><center><a href='index.php'>Index</a></center>");
include ROOT.'common/footer.php';	
exit;
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.