pivasoftware / easycwmp

EasyCwmp:
http://www.easycwmp.org/
GNU General Public License v2.0
73 stars 59 forks source link

Fix handling of whitespaces in common_set_list function #27

Open okraits opened 7 years ago

okraits commented 7 years ago

If the payload contains whitespaces (for example openvpn remote parameter), the common_set_list function splits the payload at these whitespaces. This commit fixes this issue.

pivasoftware commented 7 years ago

the common_set_list is not used yet in the current version of easycwmp data model. But it could be used in the future, and you are right if the list contains a value that contains spaces then it will be treated in wrong way. But your suggestion does not meet the issue, I really do not understand how your modif can fix the issue, please review your suggestion

okraits commented 6 years ago

The fix changes the internal field separator to ,, iterates over the string parts and restores the previous separator value (probably whitespace) afterwards. See https://gist.github.com/okraits/3e0a14827a619b4f85dcc27cb1df32b1 for a test of the fix.