If this is your first visit, check our documentation. To post, register or login.
Forums / Bug Reports / Developers Tool Kit: Line # values are off by 1

Developers Tool Kit: Line # values are off by 1

Started by lat9 on 19 Nov 2012, 7:52 PM · Views: 445

Results 1 to 2 of 2
19 Nov 2012, 7:52 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,140
Plugin Contributions:
56

Developers Tool Kit: Line # values are off by 1

I was chasing something down and using Developers Tool Kit to locate the offending line, went to edit the file with Notepad++, went to the line # specified by DTK ... and it wasn't the right line.

If you, for example, search for <?php in all catalog functions files, you'll find that the string is present in Line #0 of all the files.

/YOUR_ADMIN/developers_tool_kit.php (starting at line 184) currently reads for v1.5.1:

          if ($check_case) {
            $found_line= 'true';
            $found = 'true';
            $cnt_found++;
            $show_file .= "<br />Line #<strong>{$line_num}</strong> : " ;
            //prevent db pwd from being displayed, for sake of security
            $show_file .= (substr_count($line,"'DB_SERVER_PASSWORD'")) ? '***HIDDEN***' : htmlspecialchars($line, ENT_QUOTES, CHARSET);
            $show_file .= "<br />\n";
          } else {
            if ($cnt_lines >= 5) {
//            $show_file .= ' .';
              $cnt_lines=0;
            }
          }

and should be changed to

          if ($check_case) {
            $found_line= 'true';
            $found = 'true';
            $cnt_found++;
            $line_nump1 = $line_num+1;
            $show_file .= "<br />Line #<strong>{$line_nump1}</strong> : " ;
            //prevent db pwd from being displayed, for sake of security
            $show_file .= (substr_count($line,"'DB_SERVER_PASSWORD'")) ? '***HIDDEN***' : htmlspecialchars($line, ENT_QUOTES, CHARSET);
            $show_file .= "<br />\n";
          } else {
            if ($cnt_lines >= 5) {
//            $show_file .= ' .';
              $cnt_lines=0;
            }
          }
19 Nov 2012, 9:15 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Developers Tool Kit: Line # values are off by 1

This has been addressed for our next release ... thanks ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!