Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed strlen for binary data to take into account mbstring.func_overload #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pmxmatt
Copy link

@pmxmatt pmxmatt commented Oct 28, 2014

The function strlen behaves differently when mbstring.func_overload is enabled for the strlen function.

This was causing the message sending to fail I've updated the code based on the comment from a user on the official documentation http://php.net/manual/en/function.strlen.php#54906 .

@duccio
Copy link
Member

duccio commented Oct 28, 2014

Hi, thanks but… latin1?

@pmxmatt
Copy link
Author

pmxmatt commented Oct 28, 2014

Using latin1 forces it into single-byte mode.

I've tested this with both mbstring.func_overload on and off in environment and it is now counting correctly.

@lucabrunox
Copy link
Contributor

What's the point of checking mbstring.func_overload if mb_strlen($aMessage['BINARY_NOTIFICATION'],'latin1'); does always the right job? It could be used in place of strlen always I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants