Loading core/lib/Drupal/Component/Render/FormattableMarkup.php +5 −5 Original line number Diff line number Diff line Loading @@ -106,17 +106,17 @@ public function jsonSerialize(): string { * * Secure examples. * @code * // Returns the HTML string "Prefix $some_variable". * // Return the HTML string "Prefix $some_variable". * $this->placeholderFormat('Prefix @foo', ['@foo' => $some_variable]); * // Convert object to a sanitized string. * // Convert an object to a sanitized string. * $this->placeholderFormat('Non-sanitized replacement value: @foo', ['@foo' => (string) $safe_string_interface_object]); * // Wraps $some_variable in an <em> tag. * // Wrap $some_variable in an <em> tag. * $this->placeholderFormat('Prefix %foo', ['%foo' => $some_variable]); * // The following are using the : placeholder inside an HTML tag. * $this->placeholderFormat('<a href=":foo">link text</a>', [':foo' => $some_variable]); * $this->placeholderFormat('<a href=":foo" title="static text">link text</a>', [':foo' => $some_variable]); * $this->placeholderFormat('<a href=":foo">link text</a>', [':foo' => $some_variable]); * // Use : placeholder inside an HTML tag. * // Use a : placeholder inside an HTML tag. * $this->placeholderFormat('<img src=":foo" />', [':foo' => '/image.png']); * @endcode * The above are typical examples of using the placeholders correctly. Loading @@ -128,7 +128,7 @@ public function jsonSerialize(): string { * $this->placeholderFormat('<a @foo>link text</a>, ['@foo' => $some_variable]); * $this->placeholderFormat('<a href="@foo">link text</a>, ['@foo' => $some_variable]); * $this->placeholderFormat('<a title="@foo">link text</a>, ['@foo' => $some_variable]); * // Convert object to a string nad not string that is not sanitized. * // Implicitly convert an object to a string, which is not sanitized. * $this->placeholderFormat('Non-sanitized replacement value: @foo', ['@foo' => $safe_string_interface_object]); * @endcode * These are the more common mistakes that can be made. Make sure that your Loading Loading
core/lib/Drupal/Component/Render/FormattableMarkup.php +5 −5 Original line number Diff line number Diff line Loading @@ -106,17 +106,17 @@ public function jsonSerialize(): string { * * Secure examples. * @code * // Returns the HTML string "Prefix $some_variable". * // Return the HTML string "Prefix $some_variable". * $this->placeholderFormat('Prefix @foo', ['@foo' => $some_variable]); * // Convert object to a sanitized string. * // Convert an object to a sanitized string. * $this->placeholderFormat('Non-sanitized replacement value: @foo', ['@foo' => (string) $safe_string_interface_object]); * // Wraps $some_variable in an <em> tag. * // Wrap $some_variable in an <em> tag. * $this->placeholderFormat('Prefix %foo', ['%foo' => $some_variable]); * // The following are using the : placeholder inside an HTML tag. * $this->placeholderFormat('<a href=":foo">link text</a>', [':foo' => $some_variable]); * $this->placeholderFormat('<a href=":foo" title="static text">link text</a>', [':foo' => $some_variable]); * $this->placeholderFormat('<a href=":foo">link text</a>', [':foo' => $some_variable]); * // Use : placeholder inside an HTML tag. * // Use a : placeholder inside an HTML tag. * $this->placeholderFormat('<img src=":foo" />', [':foo' => '/image.png']); * @endcode * The above are typical examples of using the placeholders correctly. Loading @@ -128,7 +128,7 @@ public function jsonSerialize(): string { * $this->placeholderFormat('<a @foo>link text</a>, ['@foo' => $some_variable]); * $this->placeholderFormat('<a href="@foo">link text</a>, ['@foo' => $some_variable]); * $this->placeholderFormat('<a title="@foo">link text</a>, ['@foo' => $some_variable]); * // Convert object to a string nad not string that is not sanitized. * // Implicitly convert an object to a string, which is not sanitized. * $this->placeholderFormat('Non-sanitized replacement value: @foo', ['@foo' => $safe_string_interface_object]); * @endcode * These are the more common mistakes that can be made. Make sure that your Loading