Skip to content

Comments

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

Open
pmxmatt wants to merge 1 commit intoimmobiliare:masterfrom
123CommsLimited:master
Open

Changed strlen for binary data to take into account mbstring.func_overload#71
pmxmatt wants to merge 1 commit intoimmobiliare:masterfrom
123CommsLimited:master

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