mathmarques / Smarty-View

Slim Framework 3 view layer built on top of Smarty
MIT License
24 stars 15 forks source link

baseUrl problem with Edge #6

Closed drnasin closed 7 years ago

drnasin commented 7 years ago

Hello there, seems like

$this->uri->getBaseUrl()

Is using ->getAuthority() to build a scheme and host which results in http://username:password@localhost/

and MS Edge is dying here...

Solution I used was to use $this->uri->getBasePath() instead of getBaseUrl() in SmartyPlugins->baseUrl function...

mathmarques commented 7 years ago

getBaseUrl and getBasPath have some problems... See Here So we provide an way to manual set your base path to be used by plugin. Instead of:

 $smartyPlugins = new \Slim\Views\SmartyPlugins($c['router'], $c['request']->getUri());

You can pass a string on the second argument:

 $smartyPlugins = new \Slim\Views\SmartyPlugins($c['router'], 'your base path here');
drnasin commented 7 years ago

Ah I see, I was already wondering why is there a check if uri is string an then if it's object. Now I get it...thank you @mathmarques

Rudloff commented 7 years ago

Hello, Here is a quick way to work around this issue:

$smartyPlugins = new \Slim\Views\SmartyPlugins($c['router'], $c['request']->getUri()->withUserInfo(null));