to fix "Undefined index: html"

https://community.humhub.com/content/perma?id=107414
This commit is contained in:
Evgeniy Tkachenko 2017-05-26 14:00:48 +03:00 committed by GitHub
parent e899710a0a
commit 4ee1f3f95d

View File

@ -115,7 +115,7 @@ class UrlOembed extends \yii\db\ActiveRecord
if ($jsonOut != "") {
try {
$data = \yii\helpers\Json::decode($jsonOut);
if (isset($data['type']) && ($data['type'] === "video" || $data['type'] === 'rich' || $data['type'] === 'photo')) {
if (isset($data['html']) && isset($data['type']) && ($data['type'] === "video" || $data['type'] === 'rich' || $data['type'] === 'photo')) {
$html = "<div data-guid='".uniqid('oembed-')."' data-richtext-feature class='oembed_snippet' data-url='" . \yii\helpers\Html::encode($url) . "'>" . $data['html'] . "</div>";
}
} catch (\yii\base\InvalidParamException $ex) {