The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cpanelphp adds a line?

Discussion in 'General Discussion' started by rbmatt, Mar 27, 2003.

  1. rbmatt

    rbmatt Well-Known Member

    Joined:
    Oct 21, 2002
    Messages:
    212
    Likes Received:
    0
    Trophy Points:
    16
    I'm trying to do a skin in php. Apparently, a blank line is put before the beginning, so a header() won't work. I've looked at the wrapper, but can't make it do what I want... plus it will be overwritten on update.
    Does anyone else experience this?
     
  2. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Yes it's a problem in cpanelphp, but I don't see how you could solve it without modifying it.

    The problem is here:

    my $top = 5;
    my $cont = 0;
    foreach $line (@cpanel) {
    my $dont = 0;
    if ($top > 0) {
    if ($line =~ /:/i) {
    $dont = 1;
    }
    $top--;
    }
    unless ($dont) { print TMP $line; }
    }

    Instead of looking for lines containing the ':' character, you may just skip until the empty line which separates the HTTP headers from the body and copy from there on.

    my $copy = 0;
    foreach (@cpanel) {
    if ($copy) { print TMP; }
    elsif (/^\s*$/) { $copy = 1; }
    }
     
  3. rbmatt

    rbmatt Well-Known Member

    Joined:
    Oct 21, 2002
    Messages:
    212
    Likes Received:
    0
    Trophy Points:
    16
    Thanks-
    Now can we get this in the edge version so it will not change this file? I know I can chattr it, but what if it really needs to be upgraded.
     

Share This Page