-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix invalid route in ButtonOutline #3541
fix invalid route in ButtonOutline #3541
Conversation
bb792c9
to
dfcd668
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.storeViews reaching is potentially dangerous. Someone could just type random language in url and it would fail
core/lib/multistore.ts
Outdated
routeObj.path = '/' + storeCode + '/' + (routeObj.path.startsWith('/') ? routeObj.path.slice(1) : routeObj.path) | ||
} | ||
} else { | ||
if (storeCode && config.defaultStoreCode !== storeCode && config.storeViews[storeCode].appendStoreCode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if somehow config.storeViews[storeCode]
would not exist?
@@ -1,7 +1,7 @@ | |||
<template> | |||
<component | |||
:is="link ? 'router-link' : 'button'" | |||
:to="localizedRoute(link)" | |||
:to="link ? localizedRoute(link) : null" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe we shouldn't direct on users such logic; we're returning here the same object, it's not necessary and overcomplication for newcomers.
Related issues
followup to #3515