Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute values containing multidimensional data will cause an mb_srtlen exception #132

Open
TheKeymaster opened this issue Aug 5, 2021 · 0 comments

Comments

@TheKeymaster
Copy link

Describe the bug

Passing a multidimensional array to the Attribute instance, will cause an mb_strlen exception.

To Reproduce

// Simply create a new Attribute instance and pass it multidimensional array data:
new \FINDOLOGIC\Export\Data\Attribute(
    'attribute_with_very_long_value',
    [
        'ayy' => [
            'interesting' => 'nice'
        ]
    ]
);

Expected behavior

A clear exception indicating I have passed wrong data there, which isn't valid.

Actual behavior

An mb_strlen exception happens, which isn't really clear about what happened:

mb_strlen() expects parameter 1 to be string, array given
 /home/dom/github/findologic/libflexport/src/FINDOLOGIC/Export/Helpers/DataHelper.php:101
 /home/dom/github/findologic/libflexport/src/FINDOLOGIC/Export/Data/Attribute.php:37
 /home/dom/github/findologic/libflexport/src/FINDOLOGIC/Export/Data/Attribute.php:46
 /home/dom/github/findologic/libflexport/src/FINDOLOGIC/Export/Data/Attribute.php:28

Screenshots

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants