@@ -84,8 +84,9 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function init() |
| 86 | 86 | { |
| 87 | - if (!$this->request) |
|
| 88 | - $this->request = Yii::$app->request; |
|
| 87 | + if (!$this->request) { |
|
| 88 | + $this->request = Yii::$app->request; |
|
| 89 | + } |
|
| 89 | 90 | parent::init(); |
| 90 | 91 | } |
| 91 | 92 | |
@@ -247,8 +248,9 @@ discard block |
||
| 247 | 248 | } |
| 248 | 249 | |
| 249 | 250 | $path = Yii::getAlias($this->imagePath ?: $this->web . $image); |
| 250 | - if ($this->imagePath) |
|
| 251 | - $path = $this->imagePath; |
|
| 251 | + if ($this->imagePath) { |
|
| 252 | + $path = $this->imagePath; |
|
| 253 | + } |
|
| 252 | 254 | if (file_exists($path)) { |
| 253 | 255 | $imageSize = getimagesize($path); |
| 254 | 256 | $this->view->registerMetaTag(['property' => 'og:image:width', 'content' => $imageSize[0]]); |