Welcome Guest, Not a member yet? Register   Sign In
Hook generates whitespace

Hi there!

I have a problem with my hook. If the hook is enabled, the hook creates a whitespace at the beginning of each page. Normally this is not a problem... But with RSS there is a problem, because XML (thus rss) expects the xml-expression at the first character...

Normally the output should generate "<?xml version=...".
If hooks are enabled it generates " <?xml version=...".

My Hook:
class TitleHook

    function doTitleHook()
        $CI =& get_instance();
        $output = $CI->output->get_output();                    
            $title = "WildeWetten - ".$CI->main_title;            
            $title = "Normal Title";
        $output = str_replace("{{MAIN_TITLE}}",$title, $output);

in hooks-config:

$hook['display_override'][] = array('class'    => 'TitleHook',
                                    'function' => 'doTitleHook',
                                    'filename' => 'TitleHook.php',
                                    'filepath' => 'hooks'

i also tested something like
$output = substr($output,1)
, but it seems, that the whitespace will be added after the hook...

Does anybody know how to fix?

Messages In This Thread
Hook generates whitespace - by El Forum - 06-03-2008, 06:43 AM

Theme © iAndrew 2016 - Forum software by © MyBB