Reputation: 2098
function encoded_header($raw)
{
mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');
if ( mb_eregi('[^][<>a-z0-9 _".()/;,:+@|-]', $raw) )
{
$chunks = str_split($raw, 20 );
$encoded = array();
foreach ( $chunks as $chunk )
{
array_push($encoded, base64_encode( $chunk ) );
}
return '=?utf-8?B?' . implode('?==?utf-8?B?', $encoded) . '?=';
}
else
{
return $raw;
}
}
The above function, when called, gives me:
Error: [2] - mb_eregi() [function.mb-eregi0]: mbregex compile err: premature end of char-class
We recently updated our php to version 5.3.3 and we encounter this error. Our previous version 5.0.2 worked fine.
I searched google but did not come up with anything useful. Anyone got any suggestions on how to fix this error?
Upvotes: 2
Views: 481
Reputation: 1894
mb_eregi()
is depreciated in version 5.3
so user preg_match();
try this:
preg_match('/[^][<>a-z0-9 _".()\;,:+@|-]/i', $row);
Upvotes: 4