Welcome Guest, Not a member yet? Register   Sign In
German characters getting truncated in $_POST
#1

[eluser]yabdab[/eluser]
OK I am at my wits end on this one.

I have PayPal sending me a _POST payload.

On the index.php page I catch that post and dump it to make sure it is getting sent correctly. I do this before any CI stuff if fired up.

It looks similar to this...

Code:
print_r($_POST, true);

Output looks like so...

Code:
Array(
...
[first_name] => Günter
...
)

Everything looks fine. But when I try to use the $_POST object in my library, this happens...

Code:
Array(
...
[first_name] => G
...
)


Does CI do anything to the $_POST arg?

I can see it doing something to $this->input->post() , but I am not using that.

Anyone have any idea what is happening?

I am using CI 2.1 with HMVC on PHP 5.3

Thanks.
#2

[eluser]yabdab[/eluser]
OK, looks like it is happening in the core/Input.php via _sanitize_globals().

More specifically the _clean_input_data($str) function.

Seems to be happening on both the utf-8 and xss clean portions of this function.

The data is coming from PayPal and is not sent via UTF-8 charset afaik.

Is there a way to to convert *any* data passed in to the utf-8 charset?
#3

[eluser]Stefan Hueg[/eluser]
Yeah,
check php.net for

Code:
iconv();
mb_convert_encoding();
#4

[eluser]yabdab[/eluser]
[quote author="Stefan Hueg" date="1335622336"]Yeah,
check php.net for

Code:
iconv();
mb_convert_encoding();
[/quote]

Yes, but shouldn't that be done already with the utf8 class? ( clean_string )




Theme © iAndrew 2016 - Forum software by © MyBB