Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Nasty little bug in header.inc pfSense 2.0 (and 1.2.3)

    Scheduled Pinned Locked Moved webGUI
    2 Posts 2 Posters 3.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lsoltero
      last edited by

      Hello All,

      Today while modifying the webGui for our application we ran into an issue where java script file for one our custom pages was not being loaded.  This was tracked down to a coding error in header.inc. This does not affect the general distribution of pfSense 1.2.X or 2.0 but one of these days its going to bite one of the developers where it hurts…

      line 40 in header.inc currently reads

      /*
              *      Find all javascript files that need to be included
              *      for this page ... from the arrays ... :)
              *      Coded by: Erik Kristensen
              */

      $dir  = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
              $path = "/usr/local/www/javascript/" . $dir . "/";
              if (is_dir($path)) {

      the trim line should be changed to
      $dir  = trim(basename($_SERVER["SCRIPT_FILENAME"], '.php'));

      otherwise the file name gets bangled by random removal of ., p, h, p from the file names!

      take care.

      –luis

      1 Reply Last reply Reply Quote 0
      • E
        Efonnes
        last edited by

        The suggested fix has been tested by me and applied in the latest 2.0 code.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.