Author Topic: Warning: stristr() [function.stristr]: Empty delimiter in ...  (Read 7481 times)

communicat

  • Beginner
  • *
  • Posts: 10
Warning: stristr() [function.stristr]: Empty delimiter in ...
« on: February 28, 2010, 21:38:39 pm »
Hi,

I am pretty desperate by now so I would appreciate any help very much!
In VirtueMart I keep getting this errormessage when products are shown:

Warning: stristr() [function.stristr]: Empty delimiter in /home/.../public_html/.../administrator/components/com_virtuemart/html/shop.browse.php on line 418

I am using Joomla! 1.5 and VM 1.1.4 (including the latest fix). I have reinstalled VM 3 times over, but the error keeps appearing, even when I haven't changed anything within css.

Changing rights on shop.browse.php or the images file doesn't help. Neither does changing the URL in configuration. I don't know php (just html) and I can't see if anything is awkward on line 418 on shop.browse.php. It looks like this:

                  } else {

                  $search_string .="&".$key."=".urlencode($val);

                  }

               }

            }

         }

      }

THIS EMPTY LINE IS 418


      $tpl->set( 'VM_BROWSE_ORDERBY_FIELDS', $VM_BROWSE_ORDERBY_FIELDS);



       if ($DescOrderBy == "DESC") {

Any suggestion is very welcome because I don't know what else I can try.  ???




[attachment cleanup by admin]

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28339
  • Always on vacation
    • Jenkin Hill Internet
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #1 on: March 01, 2010, 08:59:05 am »
This is a PHP warning. What version are you using?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

communicat

  • Beginner
  • *
  • Posts: 10
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #2 on: March 01, 2010, 11:43:00 am »
I am using Joomla! 1.5 and VM 1.1.4 (including the latest fix).

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28339
  • Always on vacation
    • Jenkin Hill Internet
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #3 on: March 01, 2010, 13:55:30 pm »
No, what PHP version?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

communicat

  • Beginner
  • *
  • Posts: 10
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #4 on: March 01, 2010, 14:22:54 pm »
When I look at my controlpanel (Cpanel) it sais version 3.2.4 on phpMyAdmin.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28339
  • Always on vacation
    • Jenkin Hill Internet
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #5 on: March 01, 2010, 14:58:49 pm »
I hope not! Everyone should now be on PHP5 as even PHP4 is past end of life.

There was a bug with PHP4.2.3 which incorrectly gave that error message - http://www.php.net/manual/en/function.stristr.php#25718

If you cannot upgrade to PHP5 then you can turn off PHP error reporting either directly in the server php.ini or indirectly by useing .htaccess (Google should locate the code needed).
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

communicat

  • Beginner
  • *
  • Posts: 10
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #6 on: March 01, 2010, 16:53:35 pm »
I was wrong, my PHP version is 5.2.11. So perhaps it is another problem?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28339
  • Always on vacation
    • Jenkin Hill Internet
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #7 on: March 01, 2010, 17:11:16 pm »
I just looked at the imafge you show. You have double spacing of the code, the actual line 418 and the only place stristr is used is actually
Code: [Select]
&& !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )

Check that line - but I'm guessing that the site works even without the problem. If so just reduce/turn off the PHP warning messages.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

communicat

  • Beginner
  • *
  • Posts: 10
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #8 on: March 02, 2010, 09:19:40 am »
After more research on the topic, I tried to add 'php_flag register_globals off' to my .htaccess file as an alternative to making changes in php.ini (which I have no access to). But this caused even larger problems.

I then asked my provider to set the php error warnings to 'off'. This solved my problem.  :)

But out of curiosity, what exactly is wrong in the following line:
&& !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )

Because I think if I would have changed this, it might also have fixed my problem. What is the double spacing problem?

Thank you for your help!

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28339
  • Always on vacation
    • Jenkin Hill Internet
Re: Warning: stristr() [function.stristr]: Empty delimiter in ...
« Reply #9 on: March 02, 2010, 11:02:52 am »
I'd guess there is a minor syntax issue in that line, which is why you see the error when PHP reporting level is set too low. But the line is still executed OK. Often such things are related to the need to use quotes around variables.

Double spacing is introduced in some editors. Although it may not stop a script from running what it does do is screw up line numbering.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29