Commit 8f7c59fae24d9ca1740aac25ec4b510a46d1e269
1 parent
3d2e4c72
redirect trim
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
frontend/components/UrlManager.php
| @@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
| 72 | public function parseRequest($request) | 72 | public function parseRequest($request) |
| 73 | { | 73 | { |
| 74 | $redirect = $this->checkRedirect($request->url); | 74 | $redirect = $this->checkRedirect($request->url); |
| 75 | - | 75 | +// die(var_dump($redirect)); |
| 76 | if ($redirect !== null) { | 76 | if ($redirect !== null) { |
| 77 | 77 | ||
| 78 | \Yii::$app->response->redirect("/" . $redirect->value, 301); | 78 | \Yii::$app->response->redirect("/" . $redirect->value, 301); |
| @@ -211,10 +211,12 @@ | @@ -211,10 +211,12 @@ | ||
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | $string .= '}'; | 213 | $string .= '}'; |
| 214 | + | ||
| 214 | $alias = Alias::find() | 215 | $alias = Alias::find() |
| 215 | - ->where(['route' => $string]) | 216 | + ->where(['route' => trim($string)]) |
| 216 | ->one(); | 217 | ->one(); |
| 217 | - | 218 | +// die(var_dump(Alias::find() |
| 219 | +// ->where(['route' => $string])->createCommand()->rawSql)); | ||
| 218 | return $alias; | 220 | return $alias; |
| 219 | 221 | ||
| 220 | 222 |