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.

IP Deny Manager logic problem

Discussion in 'General Discussion' started by rbmatt, Jul 10, 2003.

  1. rbmatt

    rbmatt Well-Known Member

    Joined:
    Oct 21, 2002
    Messages:
    212
    Likes Received:
    0
    Trophy Points:
    16
    The :2082/3 module for the IP deny manager has a bug in the listdenyips sub.

    The code is as follows:

    open(HC,"$htaccess") || print "<b>Error: while opening $htaccess</b>\n";
    while(<HC>) {
    if (!/^#/) {
    /^deny[\t\s]+from[\t\s]+(\S+)/i;
    push(@BLOCKIPS,$1);
    }
    }
    close(HC);

    All the regex does is strip a "deny from ip" to just "ip"
    The problem is if its not a "deny from ip" line, the regex returns a blank line. Then, that blank line is pushed to @BLOCKIPS
    With the default Frontpage htaccess, there are about 13 lines, which causes 13 entries in the dropdown box. This is a simple fix that darkorb should correct- not major, but annoying.
    Simply replace:

    push(@BLOCKIPS,$1);

    with:

    if($1 ne ""){push(@BLOCKIPS,$1);}



    Thanks!

    cPanel.net Support Ticket Number: None
     
  2. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    May I know the path to this file so that I can edit it with your suggested code?

    cPanel.net Support Ticket Number:
     
  3. rbmatt

    rbmatt Well-Known Member

    Joined:
    Oct 21, 2002
    Messages:
    212
    Likes Received:
    0
    Trophy Points:
    16
    Nick from cPanel fixed this so it is standard now. No need to edit anything.
    Thanks Nick!

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page