Giter Club home page Giter Club logo

Comments (3)

mikehaertl avatar mikehaertl commented on May 28, 2024

@ComradePashka I've tried to add test cases for your problem but I couldn't really reproduce the issue. It would help if you could check the tests in 20b1083. You can also run them locally if you have phpunit installed. Just run phpunit from the projects root directory.

If that's not an option, maybe you can come up with a simplified example config and a step by step instruction for how to reproduce the problem.

from yii2-localeurls.

mikehaertl avatar mikehaertl commented on May 28, 2024

@ComradePashka I've done some more tests with the following setup:

$config = [
    'language' => 'en',
    'components' => [
        'urlManager' => [
            'class' => 'codemix\localeurls\UrlManager',
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'languages' => ['en','de'],
            'rules' => [
                '<slug:.+>' => 'site/index',
            ],
        ],

I've then tested different things:

  • Open /de/simpleslug works
  • Open /en/simpleslug redirects to /simpleslug
  • Open /de/some/slug/url works
  • Open /en/some/slug/url redirects to /some%2Fslug%2Furl which gives a 404 from the webserver due to the %2F in the URL

So the problem is with slugs, that contain slashes. But you can't really have slashes in slugs anyway. E.g. if you try to create a URL like this:

Url::to(['site/index', 'slug' => 'some/slug/url'])

You get /some%2Fslug%2Furl which leads to a 404 again. This is the same that happens when we do the redirect for /en/some/slug/url above.

So I'm not sure if there really is a valid bug. Any comments?

from yii2-localeurls.

mikehaertl avatar mikehaertl commented on May 28, 2024

@ComradePashka As there was no feedback I have to assume that the issue no longer exists. I'm closing this for now. Feel free to add a comment if you think there's still something to fix. An updated test case for the problem would be very helpful in that case.

from yii2-localeurls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.