Skip to content

HTML title encoding issue #372

Open

Description

@JanPetterMG

There's an encoding issue in the HTML provider.

$embed->getProviders()['html']->getTitle()
Returns: Tilbehør for brytere =
Expected: Tilbehør for brytere =<250A | Effektbrytere | Elektroskandia nettbutikk

HTML code: <title>Tilbeh&oslash;r for brytere =&lt;250A | Effektbrytere | Elektroskandia nettbutikk</title>

URL: https://webshop.elektroskandia.no/nor/categories/TELE-DATA-SIKKERHET/INDUSTRI-AUTOMASJON/Effektbrytere/Effektbrytere-MCCB/Tilbeh%C3%B8r-for-brytere-%3D%3C250A/c/702258853

Demo v3: https://oscarotero.com/embed3/demo/index.php?url=https%3A%2F%2Fwebshop.elektroskandia.no%2Fnor%2Fcategories%2FTELE-DATA-SIKKERHET%2FINDUSTRI-AUTOMASJON%2FEffektbrytere%2FEffektbrytere-MCCB%2FTilbeh%25C3%25B8r-for-brytere-%253D%253C250A%2Fc%2F702258853

Version 3.4.8
PHP 7.4.2

Activity

  1. oscarotero commented on Jul 8, 2020

    @oscarotero
    Collaborator

    Seems like the problem is in the strip_tags function, that consider <250A ... is a html tag, so remove it.
    Not sure how fix it, because removing strip_tags opens the door to other issues.

  2. JanPetterMG commented on Jul 10, 2020

    @JanPetterMG
    ContributorAuthor

    I see, but why is the HTML document unencoded before tags are stripped?
    The contents of the <title> tag clearly says &lt;250A, so this shouldn't be a problem in the first place...

  3. kzgzhn commented on Nov 18, 2020

    @kzgzhn
  4. Vitorinox commented on Oct 31, 2026

    @Vitorinox
    Collaborator

    Hi @JanPetterMG, PR #589 should fix this: a < followed by a number, a space or = no longer swallows the rest of the text.

    You can test it with composer require embed/embed:dev-fix/4.5.5. We will leave the PR open for a few days before releasing 4.5.5, so any feedback is very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions