With \parse_url() the storecode will be added to the $categoryUrlPath when web/url/use_store is enabled, that's why later in the code duplicate values are removed with implode('/', array_unique(explode('/', $url))); or the other technique in PathSlugStrategy.
But this will also filter out deliberate duplicate values, like /men/lifestyle/clothes/sweaters/sweaters to /men/lifestyle/clothes/sweaters. So with this MR we change \parse_url() and just strip off the base url directly with a string replace. Because the base url also has te store code in it, when the web/url/use_store is enabled, so the path will never have the store code in it and we don't need tricks to strip of duplicate values.
With
\parse_url()
the storecode will be added to the$categoryUrlPath
whenweb/url/use_store
is enabled, that's why later in the code duplicate values are removed withimplode('/', array_unique(explode('/', $url)));
or the other technique inPathSlugStrategy
.But this will also filter out deliberate duplicate values, like
/men/lifestyle/clothes/sweaters/sweaters
to/men/lifestyle/clothes/sweaters
. So with this MR we change\parse_url()
and just strip off the base url directly with a string replace. Because the base url also has te store code in it, when theweb/url/use_store
is enabled, so the path will never have the store code in it and we don't need tricks to strip of duplicate values.