Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with emails


ysztof

Recommended Posts

Posted

Hi,

 

 

 

When client is finishing setting up account or when I'm trying to send an email from admin panel there is an error page:

 

 

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in /var/www/web5/web/admin/includes/classes/email.php on line 486

 

Warning: mb_strstr() [function.mb-strstr]: Empty haystack in /var/www/web5/web/admin/includes/classes/email.php on line 486

 

Warning: mb_send_mail() [function.mb-send-mail]: Unsupported charset ""iso-8859-1"" - will be regarded as ascii in /var/www/web5/web/admin/includes/classes/email.php on line 522

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/web5/web/admin/includes/classes/email.php:486) in /var/www/web5/web/admin/includes/functions/general.php on line 22

 

emails however are delivered without problems.

 

Any help appreciated

 

K.

Posted

See http://www.zen-cart.com/forum/showthread.p...6442&page=2

 

The empty haystack error is allegedly caused by a bug in some versions of PHP, and is supposedly caused by the following:

 

The character sets used in many countries can be quite happily represented by single byte 8bit characters, but many others require multi-byte characters. As a result, PHP has it's original single byte character and string handling routines, and multibyte equivalents. e.g. The string position function strpos has a multibyte equivalent mb_strpos.

Each of those is passed 2 parameters, the first, a character string, and the second, also a char string, to be looked for in the first string.

Now some programmer, working late at night decided that this was like looking for a needle in a haystack, and coded it mb_strpos(Haystack, Needle).

Hence the 'Empty Haystack'.....

The mb_ functions can also be 'overloaded' meaning that is the single character functions are used with a multibyte string, the mb_ functions are automatically used, meaning that you don't have to change the code. Or maybe they are used all the time?

 

That takes care of the 'what' now the 'why'.

 

Certain releases of PHP are said to have a bug, that if while using the mb_ functions, they hit a character in the 'Haystack' they believe is not part of that character ste, they don't skip over and contiue, but exit with an error. Hence the 'Empty Haystack'.

 

A possible cure is said to be to remove the overloading of the mb_ functions, with the code I posted in the last thread. Since on most hosted sites you cannot alter the PHP setup, this is often settable in a .htaccess file.

 

A suggested fix is to add

 

php_flag mbstring.func_overload 0

 

to you .htaccess file.

 

Isn't google amazing?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted

Many thanks for your response m8

 

 

Isn't google amazing?

 

 

sure it is but I've tried this before posting and it didnt help...

 

 

:)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...