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

Link to comment
Share on other sites

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;
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.