X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fmodules%2Fcontrib%2Fmetatag%2Fsrc%2FPlugin%2Fmetatag%2FTag%2FMetaNameBase.php;h=9212571ef2f17a72784f639114a21ca0165919cb;hb=059867c3f96750652c80f39e44c442a58c2549ee;hp=5eafb805a04b37e02ea237b7f451cf13f86519c6;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2;p=yaffs-website diff --git a/web/modules/contrib/metatag/src/Plugin/metatag/Tag/MetaNameBase.php b/web/modules/contrib/metatag/src/Plugin/metatag/Tag/MetaNameBase.php index 5eafb805a..9212571ef 100644 --- a/web/modules/contrib/metatag/src/Plugin/metatag/Tag/MetaNameBase.php +++ b/web/modules/contrib/metatag/src/Plugin/metatag/Tag/MetaNameBase.php @@ -314,15 +314,17 @@ abstract class MetaNameBase extends PluginBase { * A render array or an empty string. */ public function output() { - // Parse out the image URL, if needed. - $value = $this->parseImageUrl(); - $value = $this->tidy($value); - - if (empty($value)) { + if (empty($this->value)) { // If there is no value, we don't want a tag output. - $element = ''; + return $this->multiple() ? [] : ''; } - else { + + // Parse out the image URL, if needed. + $value = $this->parseImageUrl(); + $values = $this->multiple() ? explode(',', $value) : [$value]; + $elements = []; + foreach ($values as $value) { + $value = $this->tidy($value); if ($this->requiresAbsoluteUrl()) { // Relative URL. if (parse_url($value, PHP_URL_HOST) == NULL) { @@ -339,7 +341,7 @@ abstract class MetaNameBase extends PluginBase { $value = str_replace('http://', 'https://', $value); } - $element = [ + $elements[] = [ '#tag' => 'meta', '#attributes' => [ $this->nameAttribute => $this->name, @@ -348,7 +350,7 @@ abstract class MetaNameBase extends PluginBase { ]; } - return $element; + return $this->multiple() ? $elements : reset($elements); } /**