8000 [Bugfix] Re-enable array_get to fetch "flat" array keys containing dots. by cmenke · Pull Request #645 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[Bugfix] Re-enable array_get to fetch "flat" array keys containing dots. #645

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

Merged
merged 1 commit into from
Mar 22, 2013
Merged

Conversation

cmenke
Copy link
@cmenke cmenke commented Mar 21, 2013

Fixes an issue introduced with #530, when using array_get to fetch flat array keys containing dots. These are used by e.g. Symony's Translation Component:

// e.g. lang/en/messages.php
return array(
    'symfony2.is.great' => 'Symfony2 is great',
    'symfony2.is.amazing' => 'Symfony2 is amazing',
    'symfony2.has.bundles' => 'Symfony2 has bundles',
    'user.login' => 'Login',
);

Example taken from Symfony Translation Docs.

This PR simply makes array_get check if the array key exists (and return its value if true), before attempting to iterate through the array using the keys "dot"-notation.

Allowing for array keys to contain "dots" to detect flattened id/value pairs (e.g. used by Symfony's Translation Component).
taylorotwell added a commit that referenced this pull request Mar 22, 2013
[Bugfix] Re-enable array_get to fetch "flat" array keys containing dots.
@taylorotwell taylorotwell merged commit daa0739 into laravel:master Mar 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0