Zen Cart Logo
Forums / General Questions / myDEBUG: 3 identical files yesterday

myDEBUG: 3 identical files yesterday

Locked

Views: 1,468

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
7 Sep 2014, 3:56 PM
#1
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

myDEBUG: 3 identical files yesterday

I do not have any documented code changes over the past week other than update the USPS shipping to K5 this morning, I haven't a clue where to start.

Any ideas or suggestions?

I did look at the raw server logs and the timestamp for the 3 logfiles matched (within a 3 minute timeframe) when

UK-ResearchInMotion Blackberry IP 93.186.30.240 was hitting the server 8-10 times per second

[06-Sep-2014 08:50:27 America/Los_Angeles] #1  strstr() called at [/home/chainwea/public_html/includes/functions/functions_lookups.php:712]
#2  zen_run_normal() called at [/home/chainwea/public_html/includes/modules/westminster_new/product_listing.php:34]
#3  include(/home/chainwea/public_html/includes/modules/westminster_new/product_listing.php) called at [/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_modules_product_listing.php:14]
#4  require(/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_modules_product_listing.php) called at [/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_index_product_list.php:100]
#5  require(/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_index_product_list.php) called at [/home/chainwea/public_html/includes/modules/pages/index/main_template_vars.php:219]
#6  require(/home/chainwea/public_html/includes/modules/pages/index/main_template_vars.php) called at [/home/chainwea/public_html/includes/templates/westminster_new/common/tpl_main_page.php:253]
#7  require(/home/chainwea/public_html/includes/templates/westminster_new/common/tpl_main_page.php) called at [/home/chainwea/public_html/index.php:97]

[06-Sep-2014 08:50:27 America/Los_Angeles] PHP Warning:  strstr(): Empty needle in /home/chainwea/public_html/includes/functions/functions_lookups.php on line 712
7 Sep 2014, 6:08 PM
#2
lat9 avatar

lat9

Administrator

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

Re: myDEBUG: 3 identical files yesterday

Hmm, that's the following (highlighted) line in /includes/functions/functions_lookups.php:

  function zen_run_normal() {
    $zc_run = false;
    switch (true) {
[B]      case (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])):[/B]
      // down for maintenance not for ADMIN
        $zc_run = true;
        break;

The PHP warning is that the $_SERVER['REMOTE_ADDR'] portion is null/empty. While it shouldn't be empty, if you've got someone pounding on your site it's quite possible that they've got a mechanism to obfuscate that value. A possible solution for this case would be to change the line to read:

      case (!empty ($_SERVER['REMOTE_ADDR']) && strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])):

The strstr case in the functions_lookups module is the tip of the proverbial iceberg; using the DTK in a v1.5.3 test site's admin to search for $_SESSION['REMOTE_ADDR'] yields 55 matches, most of them similar to the function's usage.

13 Sep 2014, 8:25 AM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: myDEBUG: 3 identical files yesterday

I also had this debug error yesterday.

27 Feb 2015, 6:05 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: myDEBUG: 3 identical files yesterday

Just to close the loop, lest people read this down the road and think they need to do the same, this is fixed in v1.6.0, albeit somewhat differently, by making sure the IP is never blank in the first place.

23 Jul 2015, 5:25 PM
#5
ninaclark444 avatar

ninaclark444

New Zenner

Join Date:
Jul 2015
Location:
London
Posts:
2
Plugin Contributions:
0

Re: myDEBUG: 3 identical files yesterday

      case (!empty ($_SE RVER['REMOTE_ADDR']) && strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])):

Great! The above solved my problem. Thanks a lot! :) :) :)