summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2017-01-25 17:08:46 +0000
committerAlex Pott2017-01-25 17:08:46 +0000
commit63cad2c62651a6d46457ff41a8a8a185c488f1b0 (patch)
treeda7d132507ef94ba69337b38ec83bddd381aba10
parent92c611417616e595cf4d6a490c3d4bc8ced24896 (diff)
Issue #2572821 by AbhishekLal, xxronis, Adita, ritzz, dimaro, hardik.p, amit.drupal, gianani, quietone, subhojit777, alexpott: Fix documentation on hook_user_format_name_alter()
-rw-r--r--core/modules/user/user.api.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index d4a093e..2f40eb9 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -109,13 +109,16 @@ function hook_user_cancel_methods_alter(&$methods) {
* that is displayed. Can be used to ensure user privacy in situations where
* $account->getDisplayName() is too revealing.
*
- * @param string $name
- * The string that $account->getDisplayName() will return.
- *
- * @param $account
- * The account object the name belongs to.
+ * @param string|Drupal\Component\Render\MarkupInterface $name
+ * The username that is displayed for a user. If a hook implementation changes
+ * this to an object implementing MarkupInterface it is the responsibility of
+ * the implementation to ensure the user's name is escaped properly. String
+ * values will be autoescaped.
+ * @param \Drupal\Core\Session\AccountInterface $account
+ * The user object on which the operation is being performed.
*
* @see \Drupal\Core\Session\AccountInterface::getDisplayName()
+ * @see sanitization
*/
function hook_user_format_name_alter(&$name, $account) {
// Display the user's uid instead of name.