Problem/Motivation

Follow-up to #2570431: Document that certain (non-"href") attribute values in t() and SafeMarkup::format() are not supported and may be insecure

FormattableMarkup warning about use in "<" and ">" of an HTML tag talks about placeholder, use in placeholder string is documented in PlaceholderTrait

Proposed resolution

Make the warning about use of the object (the string value in the object).

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Create a patch Instructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards Instructions

User interface changes

No

API changes

No

Data model changes

No

CommentFileSizeAuthor
#52 2580505-52.patch8.18 KBsmustgrave
#52 interdiff-44-52.txt2.14 KBsmustgrave
#44 2580505-44.patch8.12 KBAbhijith S
#42 interdiff_39-42.txt1.37 KBnikitagupta
#42 2580505-42.patch8.11 KBnikitagupta
#40 2580505-39.patch8.11 KBnikitagupta
#39 2580505-39.patch8.11 KBnikitagupta
#26 2580505-25.patch8.31 KBkrknth
#24 interdiff-24.txt1.77 KBkgoel
#24 2580505-24.patch8.31 KBkgoel
#20 interdiff-20.txt2.23 KBkgoel
#20 2580505-20.patch8.28 KBkgoel
#17 2580505.18.patch8.31 KBYesCT
#17 interdiff.2580505.15.18.txt1.16 KBYesCT
#15 interdiff.2580505.14.15.txt785 bytesYesCT
#15 2580505.15.patch8.29 KBYesCT
#14 interdiff.2580505.13.14.txt1.52 KBYesCT
#14 2580505.14.patch8.46 KBYesCT
#13 interdiff.2580505.7.13.txt2.43 KBYesCT
#13 2580505.13.patch8.56 KBYesCT
#8 2580505.7.patch8.81 KBYesCT
#7 interdiff.2580505.6.7.txt755 bytesYesCT
#7 2580505.7.patch755 bytesYesCT
#6 interdiff.2580505.5.6.txt1.12 KBYesCT
#6 2580505-6.patch8.34 KBYesCT
#4 2580505-4.patch8.34 KBYesCT
#3 2580505-3.patch2.73 KBYesCT
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT created an issue. See original summary.

YesCT’s picture

Title: FormattableMarkup warning about use in "<" and ">" of an HTML tag should be about object, use in placeholder string is documented in PlaceholderTrait » FormattableMarkup warning in class description about use in "<" and ">" of an HTML tag should be about object, use in placeholder string is documented on placeholderFormat()
Related issues: +#2577785: Remove PlaceholderTrait
YesCT’s picture

YesCT’s picture

Title: FormattableMarkup warning in class description about use in "<" and ">" of an HTML tag should be about object, use in placeholder string is documented on placeholderFormat() » Improve FormattableMarkup documentation
Status: Active » Needs review
FileSize
8.34 KB

@xjm in #2577785-35: Remove PlaceholderTrait asked for some followups. I think can use this, since the placeholdertrait changes I was going to make are now in FormattableMarkup also.

YesCT’s picture

  1. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -32,30 +32,9 @@
    - *   Only the "href" attribute is supported via the special ":variable"
    - *   placeholder, to allow simple links to be inserted:
    
    @@ -179,6 +169,28 @@ public function jsonSerialize() {
    +   *   In $string, only HTML attributes that take a URL as the value, are
    +   *   supported via the special ":variable" placeholder. For example, with the
    +   *   "href" attribute, the ":variable" placeholder allows simple links to be
    

    not really true, also url for img src.

  2. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -83,7 +62,7 @@ class FormattableMarkup implements MarkupInterface {
    -   *   additional information about placeholders.
    +   *   additional information about correct and secure use of placeholders.
    

    added words about security to motivate people that they actually *do* want to go read it.

  3. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    -   *   - @variable: When the placeholder replacement value is:
    +   *   - @variable: Use as the default choice for anything displayed on the
    

    made the beginning of each @ % : section use parallel wording, an tell people when they should use it (and not use it) at the beginning.

YesCT’s picture

made consistant use of " or ' in the placeholderFormat calls.

YesCT’s picture

adding a reference for looking up which HTML attributes can take a URL value

to clarify:

+++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
@@ -134,39 +113,50 @@ public function jsonSerialize() {
+   *   - :variable: Use when the return value is to be used as a URL value of an
+   *     HTML attribute, for example the href attribute in an a tag.
YesCT’s picture

FileSize
8.81 KB

actual patch this time.

stefan.r’s picture

  1. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *   - %variable: Use when @variable would be appropriate, but the placeholder
    +   *     value will also be wrapped in <em> tags with a class. As with
    

    The grammar here sounds a bit funny

  2. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *     @variable, do not use within the "<" and ">" of an HTML tag, such as in
    +   *     HTML attribute values. Doing so is a security risk.
    ...
    -   *     As with @variable, do not use this within HTML attributes, JavaScript,
    -   *     or CSS. Doing so is a security risk.
    

    Is there a reason we are moving this?

  3. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    -   *       $string = "%output_text";
    -   *       $arguments = ['output_text' => 'text output here.'];
    -   *       $this->placeholderFormat($string, $arguments);
    +   *       $this->placeholderFormat('Prefix %output_text', ['%output_text' => 'text output.']);
    

    +1

  4. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    -   *   - :variable: Return value is escaped with
    +   *   - :variable: Use when the return value is to be used as a URL value of an
    +   *     HTML attribute, for example the href attribute in an a tag.
    +   *     Return value is escaped with
    ...
    -   *     using the "href" attribute, ensuring the attribute value is always
    -   *     wrapped in quotes:
    +   *     using the "href" attribute, ensuring the value is always wrapped in
    +   *     quotes.
    

    This change may not be needed, in the parent issue it was decided to only support the "href" attribute?

  5. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -179,6 +169,28 @@ public function jsonSerialize() {
    +   *     @todo Add some advice and stronger warnings.
    +   *       https://www.drupal.org/node/2569041
    +   *
    

    Just to be clear, what is this about and how is this related?

  6. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -179,6 +169,28 @@ public function jsonSerialize() {
    +   *   In $string, only HTML attributes that take a URL as the value, are
    +   *   supported via the special ":variable" placeholder. For example, with the
    +   *   "href" attribute, the ":variable" placeholder allows simple links to be
    +   *   inserted:
    

    This change may not be needed, in the parent issue it was decided to only support the "href" attribute?

  7. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -179,6 +169,28 @@ public function jsonSerialize() {
    +   *     - Secure: @code <a href=":variable">link text</a> @endcode
    +   *     - Secure: @code <a href=":variable" title="static text">link text</a> @endcode
    +   *     - Secure: @code <a href=":variable">@variable</a> @endcode
    

    +1 to less of the $this->placeholderFormat noise. Should we keep the explanations that were removed in the first hunk of the patch?

  8. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -179,6 +169,28 @@ public function jsonSerialize() {
    +   *       - Insecure: @code <img src=:variable />@endcode
    

    This change may not be needed, in the parent issue it was decided to only support the "href" attribute?

YesCT’s picture

I missed the part where we decided to only support href. Is there a particular comment I can look at?

stefan.r’s picture

Comments #42 and #50 in the parent. Other attributes than href are untested, and the docs state to only use formattablemarkup for simple markup. Core has no use case for any other attributes, and contrib can be added as people ask for it.

jhodgdon’s picture

Component: base system » documentation

moving to docs component, right?

YesCT’s picture

I think this puts back the clarification that only href is supported.

YesCT’s picture

changing unsupported to be more strongly worded as insecure.

YesCT’s picture

#9 5. yeah, I think it was asked for in the parent issue, but also handled there. and the linked issue has the related issue on it, so just taking that out.

[edit: need to respond to #9 1. and 2.]

jhodgdon’s picture

Status: Needs review » Needs work

I think maybe this isn't done, but I took a look through the docs as they are and have some comments. This is confusing stuff.

Overall: I think we should say something, somewhere (not sure where), about the general strategy for all these new formatting objects. Which I think is: when you are formatting some text, you need to always use the proper objects and placeholders to format anything that comes from the database (which is usually unsanitized) or user input (definitely unsanitized). If you do so, everything should be escaped exactly once, not zero times (security risk) or multiple times (ugly).

This text doesn't quite get that across to me. Some detailed notes follow, but that is the general gist.

  1. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -32,30 +32,9 @@
    - * - Variable placeholders should not be used within the "<" and ">" of an
    ...
    + * - The result of casting this object to a string should not be used within the
    

    This is totally changing the meaning of this section of docs. Is that right?

    Because before it was basically saying:

    Within the string you are formatting with placeholders, don't use placeholders in the part that is between < and > in an HTML tag.

    And now it says something totally different:

    Don't use the output of formatting this entire thing between < and > of an HTML tag.

    I don't think that is the right change to make?

  2. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *   - @variable: Use as the default choice for anything displayed on the
    +   *     site. Do not use within the "<" and ">" of an HTML tag, such as in HTML
    +   *     attribute values. Doing so is a security risk.
    

    I don't get it. Why is this a security risk? It is supposedly sanitized -- just below it says it is sanitized. So why is this a security risk? The security risk would only happen if you also used the wrong object to sanitize that placeholder.

  3. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *     - A MarkupInterface object, the object will be cast to a string and not
    +   *       sanitized.
    

    Yes, but that is presumably because the MarkupInterface object has previously been properly sanitized. If it was the right object and right placeholders to begin with, you should be OK?

  4. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *       To force sanitization of a MarkupInterface object, cast the
    +   *       replacement value to a string, since it is not known what strategy a
    +   *       MarkupInterface object uses for sanitization.
    

    But... The point is that you don't want to double-escape tags. If you use the right type of string formatting/sanitizing class, you should be OK right?

    Also I had to read this at least twice to understand it. Can it say something like:

    ... instead of passing a MarkupInterface object directly as the placeholder replacement value, cast it to a string first.

  5. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *   - %variable: Use when @variable would be appropriate, but the placeholder
    +   *     value will also be wrapped in <em> tags with a class. As with
    

    how about "... but you want the placeholder value to be wrapped in em tags..." or something like that? Confusing as it is.

  6. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -180,6 +170,28 @@ public function jsonSerialize() {
    +   *     - The : placeholder should be used for HTML attribute values, but is
    +   *       insecure not to have quotes around the attribute value:
    

    I thought it said above that it's only for href attributes, not for all attributes?

  7. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -180,6 +170,28 @@ public function jsonSerialize() {
    +   *     - Only the "href" attribute is supported. So, even other attributes
    +   *       which take a URL value are unsupported:
    +   *       - Insecure: @code <img src=":variable" />@endcode
    

    ok so this contradicts it. Better not to have contradictory text in the docs.

YesCT’s picture

Status: Needs work » Needs review
FileSize
1.16 KB
8.31 KB

not yet addressing #16.

#9 2.
yes. put the warning right up front so people know.

#9 1. awkward wording...
addressing that now.

YesCT’s picture

Status: Needs review » Needs work

needs work for #16.

kgoel’s picture

I am working on this.

kgoel’s picture

Status: Needs work » Needs review
FileSize
8.28 KB
2.23 KB

Addressed https://www.drupal.org/node/2580505#comment-10451213 5, 6 and 7 in this patch.

jhodgdon’s picture

I still don't know about this patch.

a) It cuts out a huge amount of documentation. Is this somewhere else? If so we should at least point there.

b) It makes a statement about security that I still do not understand.

YesCT’s picture

#21

a. No, it does not cut a huge amount of documentation, it moves it to better locations.

b. yes. that could have been stated in comment #20 when the patch was posted. we are only partially through addressing your earlier feedback.

#16

I agree, adding some clarity (see the section "overall" in #16) is a good idea.

1.

This is totally changing the meaning of this section of docs. Is that right?

Kind of. That information is still there, but is moved to the @param where it is relevant.

The section then on the *class* doc block *is* changed, to be about what to do with the class object (not about how to use a param on a method of the class).

Which I think is an improvement.

2. 3. and 4. need some more thought. I would like to get @pwolanin's input there.
And maybe add some more detail to the insecure examples to make what the risks are more clear. (right now the examples just say what not to do, they do not say what would happen if it were done insecurely.)

YesCT’s picture

looking at the interdiff in #20

  1. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -138,10 +138,10 @@ public function jsonSerialize() {
    -   *   - %variable: Use when @variable would be appropriate, but the placeholder
    -   *     value will also be wrappped in a placeholder class and wrapped in <em>
    -   *     tags. As with @variable, do not use within the "<" and ">" of an HTML
    -   *     tag, such as in HTML attribute values. Doing so is a security risk.
    +   *   - %variable: Use when @variable would be appropriate, but you want the
    +   *     placeholder value to be wrapped in em tags. As with @variable, do not
    +   *     use within the "<" and ">" of an HTML tag, such as in HTML attribute
    +   *     values. Doing so is a security risk.
    

    lost the information about the placeholder class.

  2. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -185,11 +185,11 @@ public function jsonSerialize() {
    +   *     - The : placeholder should be used for HTML "href" attribute values,
    +   *       but is insecure not to have quotes around the attribute value:
    

    "but is" should probably be "but it is"

kgoel’s picture

Addressed #23 1 and 2.

pwolanin’s picture

re #16

2) I'm not sure an attribute value is an example that's easy to see why it's dangerous. But, let's assume an href. I can supply a value like this which is fully escaped but still allows me to execute arbitrary javascript when the link is clicked:

<a href="javascript:eval(String.fromCharCode(97,108,101,114,116,40,34,35,34,41));">click me</a>

If we assume tag name, or an attribute name, they are even more trivial to exploit. This is why we have the special ":" placeholder for URLs to strip dangerous protocols in URL attribute values.

3) This is basically the replacement for the ! placeholder in D7 - we want some markup to pass through. This should have some more warnings perhaps.

4) I guess there are cases where double escaping is better than no escaping, or the markup object maybe have safe HTML but we need plain text.

krknth’s picture

#24
minor changes in patch about exceeding 80 characters.

not added any interdiff file.

stefan.r’s picture

  1. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *     - A MarkupInterface object, the object will be cast to a string and
    +   *       not sanitized.
    ...
    +   *       To force sanitization of a MarkupInterface object, cast the
    +   *       replacement value to a string, since it is not known what strategy a
    +   *       MarkupInterface object uses for sanitization.
    

    This wording here still seems a bit confusing

  2. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    -   *   - %variable: Use when the replacement value is to be wrapped in <em>
    -   *     tags.
    ...
    +   *     placeholder value to be wrapped in an em tag with a placeholder class.
    

    We're changing wrapped in <em> tags to wrapped in an em tag with a placeholder class, but isn't the previous wording clearer?

  3. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
    +   *   - :variable: Use when the return value is to be used as a URL value of
    +   *     an HTML attribute. Only the "href" attribute is supported.
    

    Use when the placeholder value is to be used as the value of a "href" attribute.

  4. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,39 +113,50 @@ public function jsonSerialize() {
        *     protocols using UrlHelper::stripDangerousProtocols(). Use this when
    ...
    +   *     using the "href" attribute, ensuring the value is always wrapped in
    

    The bit about the href attribute is repeated here.

  5. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -180,6 +170,28 @@ public function jsonSerialize() {
    +   *   In $string, only the "href" HTML attribute, which takes a URL as the
    

    Not just in $string, maybe this could be more forceful about us not supporting any HTML attribute anywhere through any placeholder (just href).

  6. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -180,6 +170,28 @@ public function jsonSerialize() {
    +   *     - It is insecure in $string to have @ or % placeholders within the "<"
    

    "@variable" or "%variable"

  7. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -180,6 +170,28 @@ public function jsonSerialize() {
    +   *       - Insecure: @code <@variable>text</@variable> @endcode
    +   *       - Insecure: @code <a @variable>link text</a> @endcode
    +   *       - Insecure: @code <a href="@variable">link text</a> @endcode
    +   *       - Insecure: @code <a title="@variable">link text</a> @endcode
    +   *       - Insecure: @code <a href=":variable" title="@variable">link text</a>@endcode
    

    Should these have more explanation about why these are insecure (see the removed code on top of this patch)?

  8. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -180,6 +170,28 @@ public function jsonSerialize() {
    +   *     - The : placeholder should be used for HTML "href" attribute values,
    

    ":variable" placeholder

  9. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -180,6 +170,28 @@ public function jsonSerialize() {
    +   *       - Insecure: @code <img src=":variable" />@endcode
    

    This is not insecure, just unsupported :)

jhodgdon’s picture

Status: Needs review » Needs work

Status was wrong, per last review.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

jungle’s picture

Version: 8.8.x-dev » 8.9.x-dev

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

nikitagupta’s picture

Assigned: Unassigned » nikitagupta
nikitagupta’s picture

Assigned: nikitagupta » Unassigned
Status: Needs work » Needs review
FileSize
8.11 KB

Reroll the Patch #26 also covers #27.

nikitagupta’s picture

Reroll the Patch #26 also covers #27.

davidhernandez’s picture

+ * - The result of casting this object to a string should not be used within

I had trouble reading this at first. It might read better was "The result from casting..."

+ * placeholder value to be wrapped in an em tag with a placeholder class.

Should the "em" here be capitalized? I'm not sure if there is a standard. Examples I checked around core are inconsistent.

nikitagupta’s picture

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Abhijith S’s picture

Fixed the CS issue in patch #43.
142 | WARNING | Line exceeds 80 characters; contains 81 characters

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Running 10.1 tests if they pass I'll mark RTBC.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
longwave’s picture

Status: Reviewed & tested by the community » Needs work

Unfortunately the formatting needs a bit of work still:

  1. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,35 +113,47 @@ public function jsonSerialize() {
        *       using \Drupal\Component\Utility\Html::escape().
    ...
    +   *       A call like:
    

    These lines can be wrapped together.

  2. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,35 +113,47 @@ public function jsonSerialize() {
    +   *     - %variable: Use when @variable would be appropriate, but you want the
    +   *     placeholder value to be wrapped in an <em> tag with a
    

    Indentation is off here in the first line.

  3. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,35 +113,47 @@ public function jsonSerialize() {
        *     @code
    ...
    +   *     $this->placeholderFormat('Prefix %output_text', ['%output_text' => 'text output.']);
        *     @endcode
    

    Indentation is off here.

  4. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -134,35 +113,47 @@ public function jsonSerialize() {
    +   *     - :variable: Use when the return value is to be used as a URL value of
    

    Indentation is off here.

smustgrave’s picture

longwave’s picture

Status: Needs review » Needs work

Two more nits and a wider comment:

  1. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -136,35 +115,47 @@ public function jsonSerialize() {
    +   *       using \Drupal\Component\Utility\Html::escape(). A call like:
    +   *
    +   *       @code
    

    Blank line isn't needed here.

  2. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -136,35 +115,47 @@ public function jsonSerialize() {
    +   *     - :variable: Use when the return value is to be used as a URL value of
    +   *       an HTML attribute. Only the "href" attribute is supported.
    +   *     Return value is escaped with
    

    Indentation is still off here; the first two lines need to go back in by two spaces. Also it looks like this entire paragraph can be rewrapped at closer to 80 characters.

  3. +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php
    @@ -182,6 +173,31 @@ public function jsonSerialize() {
    +   *   In $string, only the "href" HTML attribute, which takes a URL as the
    +   *   value, is supported via the special ":variable" placeholder. With the
    +   *   "href" attribute, the ":variable" placeholder allows simple links to be
    +   *   inserted:
    

    This is a bit repetitive of the section above that mentions the :variable format. Should we combine the two?

smustgrave’s picture

Not the best technical writer. There a good tag to get some feedback on that?

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.