Zen Cart Logo
Forums / General Questions / PHP Warning: Empty delimiter. in Server Error Log

PHP Warning: Empty delimiter. in Server Error Log

Locked

Views: 5,306

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
15 Jun 2009, 10:17 PM
#1
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

PHP Warning: Empty delimiter. in Server Error Log

I was doing some dead link testing on a site today and got this error.

[Mon Jun 15 16:27:14 2009] [error] PHP Warning: strstr() [<a href='function.strstr'>function.strstr</a>]: Empty delimiter. in /includes/functions/functions_general.php on line 996

The call is to Set back button function zen_back_link().

I just can not get my head around how it's screwing up the array.

I have never seen this error before.

Zen Cart 1.38a, with all patches, zj_silver template

I don't think in normal operation that this error ever comes up.

Any ideas?

Skip

16 Jun 2009, 6:10 PM
#2
svakanda avatar

svakanda

New Zenner

Join Date:
Apr 2008
Location:
Missoula, MT
Posts:
58
Plugin Contributions:
0

Re: PHP Warning: Empty delimiter. in Server Error Log

  function zen_back_link() {
    if (sizeof($_SESSION['navigation']->path)-2 > 0) {
      $back = sizeof($_SESSION['navigation']->path)-2;
      $link = '<a href="' . zen_href_link($_SESSION['navigation']->path[$back]['page'], zen_array_to_string($_SESSION['navigation']->path[$back]['get'], array('action')), $_SESSION['navigation']->path[$back]['mode']) . '">';
    } else {
      if (isset($_SERVER['HTTP_REFERER']) && strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) {
        $link= $_SERVER['HTTP_REFERER'];
      } else {
        $link = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">';
      }
      $_SESSION['navigation'] = new navigationHistory;
    }
    return $link;
  }

looks like there is only one call to the strstr function there...only one thing i can imagine would be if the $_SERVER['HTTP_REFERER'] had a comma in it...strstr has two parameters + 1 optional.
http://us.php.net/manual/en/function.strstr.php

that last parameter is called before_needle, but acts much like a delimiter. I don't have an intimate knowledge of how PHP processes though...so I am not sure if that is really possible. But it IS a strange issue, i've never seen it before. Have you discovered anything else?

16 Jun 2009, 7:57 PM
#3
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: PHP Warning: Empty delimiter. in Server Error Log

Thanks for the info.

The only thing that I have seen here and on the web is that it comes from a bad rewrite rule feed to the cart.
I guess adding some sanitizing to the string would fix it but the issue is not that high on list right now.

Skip

16 Jun 2009, 8:18 PM
#4
svakanda avatar

svakanda

New Zenner

Join Date:
Apr 2008
Location:
Missoula, MT
Posts:
58
Plugin Contributions:
0

Re: PHP Warning: Empty delimiter. in Server Error Log

yeah sanitizing == smooth operashunz

24 Jul 2009, 6:15 PM
#5
dytron avatar

dytron

New Zenner

Join Date:
Feb 2008
Posts:
60
Plugin Contributions:
0

Re: PHP Warning: Empty delimiter. in Server Error Log

skipwater:

Thanks for the info.

The only thing that I have seen here and on the web is that it comes from a bad rewrite rule feed to the cart.
I guess adding some sanitizing to the string would fix it but the issue is not that high on list right now.

Skip

Got the same errors msg in my log today?

PHP Warning: strstr(): Empty delimiter. in /home/content/d/y/t/xxx/html/includes/functions/functions_general.php on line 996

  if (isset($_SERVER['HTTP_REFERER']) && strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) 

Have not modified this file "functions_general.php" but did just install the Query Cache mod dont know if that has anything to add to this error or not?

30 Nov 2009, 9:06 PM
#6
billipo avatar

billipo

New Zenner

Join Date:
Nov 2007
Posts:
10
Plugin Contributions:
0

Re: PHP Warning: Empty delimiter. in Server Error Log

I am having the same problem. It seems to have come up after some trojans were added to our site from a hack.

Is this the case with anyone else? Anyone found a fix?

Thanks, Bill