Exemplo n.º 1
0
 public function getOEmbed()
 {
     $oembed = parent::getOEmbed();
     if ($this->embedCode && $this->oembed) {
         $width = $this->oembed->get('width');
         $height = $this->oembed->get('height');
         $this->attributes(['width' => $width, 'height' => $height]);
     }
     return $oembed;
 }
Exemplo n.º 2
0
 public function getOEmbed()
 {
     $oembed = parent::getOEmbed();
     $sizes = ['width', 'height'];
     foreach ($sizes as $key) {
         $size = isset($oembed[$key]) ? $oembed[$key] : 0;
         if (!preg_match('~^\\d+$~', $size)) {
             $oembed[$key] = 0;
         }
     }
     return $oembed;
 }