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

Odd number of elements in hash assignment at lib/perl5/Mojolicious/Plugin/I18N.pm line 122. #23

Open
preaction opened this issue Jul 30, 2020 · 0 comments

Comments

@preaction
Copy link

It looks like the plugin does not allow a Mojo::URL object to be the first argument to url_for, though Mojolicious allows it and simply passes the URL through. It seems like the fix would be to add another check when trying to discard an element from @_:

-        shift if (@_ % 2 && !ref $_[0]) || (@_ > 1 && ref $_[-1]);
+        shift if (@_ % 2 && (!ref $_[0] || ref $_[0] eq 'Mojo::URL')) || (@_ > 1 && ref $_[-1]);
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

No branches or pull requests

1 participant