fix

parent 6fc656d5
...@@ -40,7 +40,10 @@ class PostController extends BaseController ...@@ -40,7 +40,10 @@ class PostController extends BaseController
*/ */
protected function findModelByUrl($url) protected function findModelByUrl($url)
{ {
if (($model = Post::find()->where(['url' => $url])->one()) !== null) { if (($model = Post::find()->where([
'url' => $url,
'active' => 1
])->one()) !== null) {
return $model; return $model;
} else { } else {
throw new NotFoundHttpException('The requested page does not exist.'); throw new NotFoundHttpException('The requested page does not exist.');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment