[SPIP] PUBLISHED : |attribut_url

SPIP

Article validated

The article « |attribut_url (|attribut_url - SPIP) »
was validated by George.


|attribut_url

Thursday 18 July 2024 , by jack

Table of contents

  • See also

The |attribut_url filter must be applied to a tag when it is used as the
href or src attribute of an HTML tag in order to secure this usage.

This filter is therefore the equivalent of |attribut_html
(SPIP) adapted to
URLs, as it makes changes that would break URLs.

Examples :

  1. Securing the url of a link contained in an environment variable :

    []

  2. In the template squelettes-dist/modeles/favicon.html, the
    |attribut_url filter secures the #ENV*{favicon} tag which comes from
    the environment and whose content may be dangerous.

    []

Language strings

The attribut_url filter must also be used on language strings returning a
url.

See also|Back to the table of contents

  • |attribut_html
    (SPIP)

— Sent by SPIP (https://www.spip.net/)