routing icon indicating copy to clipboard operation
routing copied to clipboard

Unify system variable $basePath

Open mildabre opened this issue 1 year ago • 0 comments

There is a bug in implementation of system variable $basePath in Nette + Latte. The variable is created in UrlScript::getBasePath() with ending slash. But in Latte/MicroPresenter is used WITHOUT this ending slash - this is tricky. The purpose of this PR is unify $basePath in all nette packages to have everywere identical value.

Variable $basePath is used in 3 nette packages in 5 classes:

nette/application

  • MicroPresenter
  • TemplateFactory

nette/routing

  • Route
  • RouteList

nette/http

  • UrlScript

there are 3 separate PR for every package, to be merger all together:

https://github.com/nette/routing/pull/18 https://github.com/nette/http/pull/242 https://github.com/nette/application/pull/341

I will also publish on forum nette more deep explanation of this RFC.

This PR is a BC break, but the existing "dichotomy" between value in Latte and UrlScript is much worse. Therefore, I recommend unify the value of $basePath regardless of the BC break.

mildabre avatar Dec 03 '24 01:12 mildabre