Skip to content

[Bug]: Canonical doesn't convert UTF8 slugs #508

@vandres

Description

@vandres

Although is not nice, but we are having slugs with Non-ASCII characters.

E.g. https://www.spanishlessonsmallorca.com/blog/qui%C3%A9n-invent%C3%B3-el-d%C3%ADa-de-muertos

The plugin then creates a canonical header tag like this: link: https://www.spanishlessonsmallorca.com/blog/quién-inventó-el-día-de-muertos>; rel="canonical"

Since there is no way to deactivcate that feature, the code should handle Non-ASCII characters properly.

Pseudo-Code:

public function injectCanonical ()
{
	list($field) = $this->_getElementAndSeoFields();

        Craft::$app->getResponse()->getHeaders()->add(
            'Link',
            '<' . utf8_decode($field->canonical) . '>; rel="canonical"'
        );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions