Loading CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ Metatag 8.x-1.x-dev, 2022-xx-xx #3353826 by DamienMcKenna: Add default settings file. #3325035 by Panchuk: View page meta tags can be overridden by view block that placed on same page. #3335302 by DamienMcKenna, bsnodgrass, Anna D: Deprecated function: str_replace() line 432 MetaNameBase.php. Metatag 8.x-1.22, 2022-09-29 Loading src/Plugin/metatag/Tag/MetaNameBase.php +14 −3 Original line number Diff line number Diff line Loading @@ -429,6 +429,10 @@ abstract class MetaNameBase extends PluginBase { * The meta tag value after processing. */ protected function tidy($value) { if (is_null($value) || $value == '') { return ''; } $value = str_replace(["\r\n", "\n", "\r", "\t"], ' ', $value); $value = preg_replace('/\s+/', ' ', $value); return trim($value); Loading @@ -441,8 +445,8 @@ abstract class MetaNameBase extends PluginBase { * A render array or an empty string. */ public function output() { if (empty($this->value)) { // If there is no value, we don't want a tag output. // If there is no value, just return either an empty array or empty string. if (is_null($this->value) || $this->value == '') { return $this->multiple() ? [] : ''; } Loading @@ -458,7 +462,7 @@ abstract class MetaNameBase extends PluginBase { $elements = []; foreach ($values as $value) { $value = $this->tidy($value); if ($this->requiresAbsoluteUrl()) { if ($value != '' && $this->requiresAbsoluteUrl()) { // Relative URL. if (parse_url($value, PHP_URL_HOST) == NULL) { $value = $this->request->getSchemeAndHttpHost() . $value; Loading Loading @@ -511,6 +515,13 @@ abstract class MetaNameBase extends PluginBase { protected function parseImageUrl($value) { global $base_root; // Skip all logic if the string is empty. Unlike other scenarios, the logic // in this method is predicated on the value being a legitimate string, so // it's ok to skip all possible "empty" values, including the number 0, etc. if (empty($value)) { return ''; } // If image tag src is relative (starts with /), convert to an absolute // link; ignore protocol-relative URLs. $image_tag = FALSE; Loading Loading
CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ Metatag 8.x-1.x-dev, 2022-xx-xx #3353826 by DamienMcKenna: Add default settings file. #3325035 by Panchuk: View page meta tags can be overridden by view block that placed on same page. #3335302 by DamienMcKenna, bsnodgrass, Anna D: Deprecated function: str_replace() line 432 MetaNameBase.php. Metatag 8.x-1.22, 2022-09-29 Loading
src/Plugin/metatag/Tag/MetaNameBase.php +14 −3 Original line number Diff line number Diff line Loading @@ -429,6 +429,10 @@ abstract class MetaNameBase extends PluginBase { * The meta tag value after processing. */ protected function tidy($value) { if (is_null($value) || $value == '') { return ''; } $value = str_replace(["\r\n", "\n", "\r", "\t"], ' ', $value); $value = preg_replace('/\s+/', ' ', $value); return trim($value); Loading @@ -441,8 +445,8 @@ abstract class MetaNameBase extends PluginBase { * A render array or an empty string. */ public function output() { if (empty($this->value)) { // If there is no value, we don't want a tag output. // If there is no value, just return either an empty array or empty string. if (is_null($this->value) || $this->value == '') { return $this->multiple() ? [] : ''; } Loading @@ -458,7 +462,7 @@ abstract class MetaNameBase extends PluginBase { $elements = []; foreach ($values as $value) { $value = $this->tidy($value); if ($this->requiresAbsoluteUrl()) { if ($value != '' && $this->requiresAbsoluteUrl()) { // Relative URL. if (parse_url($value, PHP_URL_HOST) == NULL) { $value = $this->request->getSchemeAndHttpHost() . $value; Loading Loading @@ -511,6 +515,13 @@ abstract class MetaNameBase extends PluginBase { protected function parseImageUrl($value) { global $base_root; // Skip all logic if the string is empty. Unlike other scenarios, the logic // in this method is predicated on the value being a legitimate string, so // it's ok to skip all possible "empty" values, including the number 0, etc. if (empty($value)) { return ''; } // If image tag src is relative (starts with /), convert to an absolute // link; ignore protocol-relative URLs. $image_tag = FALSE; Loading