Welcome Guest, Not a member yet? Register   Sign In
FoxyCart XML Datafeed issue
#1

[eluser]cwillenbrock[/eluser]
I'm trying to incorporate FoxyCart into a CI build I'm working on and am running into issues with getting the XML Datafeed that is sent via cURL to come in properly.

I've tested everything outside of CI and it works fine, but when I post the data to a controller, it gets corrupted.

I tried to include it in the post, but ironically the post is removing the characters that were different.

The difference in the straight vs. the CI received feed is as follows (minus the spaces):

PURE:
% 1 5 F % 0 A % 0 5 % 1 E W % E 4 % E D % F 8 % 9 7 h % B 7 % C 7 % C 4 % E 0 % 0 A % 2 7 U - % D 0 d % E 1 % E E % E 7 % F 7 % D 1 % 2 F % B F % 2 4 % E 0 % C 8 y D % C 2 % C 7 p % ......

What shows as POST from the Controller:
F % 0 A % 1 E W % E 4 % E D % F 8 % 9 7 h % B 7 % C 7 % C 4 % E 0 % 0 A % 2 7 U - % D 0 d % E 1 % E E % E 7 % F 7 % D 1 % 2 F % B F % 2 4 % E 0 % C 8 y D % C 2 % C 7 p % ......

So what appears to be getting chopped is what is in bold:
% 1 5 F % 0 A % 0 5 % 1 E W % E 4 % E D % F 8 % 9 7 h % B 7 % C 7 % C 4 % E 0 % 0 A % 2 7 U - % D 0 d % E 1 % E E % E 7 % F 7 % D 1 % 2 F % B F % 2 4 % E 0 % C 8 y D % C 2 % C 7 p % ......

Any thoughts as to what might be effecting the feed?
#2

[eluser]cwillenbrock[/eluser]
After a little more digging into the differences, I've noticed that any character of % 0 0 to % 2 0 (but without the spaces) with the exception of % 0 9 gets removed from the string which is what's causing the corruption.

So I now I know WHAT is causing the corruption, but I don't know what's causing the string to get affected.

Again, any ideas?
#3

[eluser]cwillenbrock[/eluser]
Okay, since I literally just spent the last 5 hrs trying to fix this problem, in the off chance someone else has this issue, here's the solution:

The issue has to do with the input filtering as part of the core functionality in CI.

The fix (in this instance) is to go to line 694 of system > core > Input.php and change it to the following:

Code:
$str = remove_invisible_characters($str, FALSE);

If someone from the Ellis team has a better solution, please chime in, but this did the trick.
#4

[eluser]Unknown[/eluser]
Like you, I was struggling with this issue for a significant amount of time, and I finally stumbled on your solution after a number of other less relevant forum topics led nowhere. Thank you for posting this solution!




Theme © iAndrew 2016 - Forum software by © MyBB