shoppingflux / shoppingfluxexport

7 stars 7 forks source link

Remove control characters from xml feed #57

Open ronan-gloo opened 8 years ago

ronan-gloo commented 8 years ago

Expected behaviour

The sent xml must be valid, which is not actually the case when data contains control chars

Actual behaviour

control chars are wrote in feed: no xml reader can open it without error / warning if not cleaned

Steps to reproduce the behaviour

Uses this pattern replacement in order to sure to remove them all in string fields: preg_replace('/[[:cntrl:]]/', '', $field);

Vincent-Profileo commented 7 years ago

Hello, preg_replace takes too much memory. Function "clean" allready cleans characters. Could we remove "_clean" and only use "clean" function ? Thank you