Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292673

Add $entity->toUrl() and $entity->toLink() methods to allowed methods list in Twig sandbox policy

$
0
0

Problem/Motivation

It would be wonderful to be able to access the toLink() and toUrl() entity methods directly inside a Twig template (like label(), id(), get*(), and a few others).

Steps to reproduce

Try to generate a link to an entity directly in a Twig template.

Proposed resolution

Add EntityInterface::toLink() and EntityInterface::toUrl() to the allowed functions in the Twig sandbox policy.

Remaining tasks

  1. Rescope the issue and implementation.
  2. Make sure the test coverage is sufficient.
  3. Reviews / refinements.
  4. RTBC.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD.

Original report by @Chi

I suppose this has no security implications.


Viewing all articles
Browse latest Browse all 292673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>