Commit 7d985d59 authored by jhodgdon's avatar jhodgdon

Issue #2195749 by longwave: Fix up docs in String class

parent 74bb4e2c
......@@ -24,9 +24,9 @@ class String {
* An HTML safe version of $text, or an empty string if $text is not
* valid UTF-8.
*
* @see drupal_validate_utf8()
*
* @ingroup sanitization
*
* @see drupal_validate_utf8()
*/
public static function checkPlain($text) {
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
......@@ -54,9 +54,9 @@ public static function decodeEntities($text) {
*
* This function replaces variable placeholders in a string with the requested
* values and escapes the values so they can be safely displayed as HTML. It
* should be used on any unknown text that is intended to be printed to an HTML
* page (especially text that may have come from untrusted users, since in that
* case it prevents cross-site scripting and other security problems).
* should be used on any unknown text that is intended to be printed to an
* HTML page (especially text that may have come from untrusted users, since
* in that case it prevents cross-site scripting and other security problems).
*
* In most cases, you should use t() rather than calling this function
* directly, since it will translate the text (on non-English-only sites) in
......@@ -66,9 +66,9 @@ public static function decodeEntities($text) {
* A string containing placeholders.
* @param $args
* An associative array of replacements to make. Occurrences in $string of
* any key in $args are replaced with the corresponding value, after optional
* sanitization and formatting. The type of sanitization and formatting
* depends on the first character of the key:
* any key in $args are replaced with the corresponding value, after
* optional sanitization and formatting. The type of sanitization and
* formatting depends on the first character of the key:
* - @variable: Escaped to HTML using String::checkPlain(). Use this as the
* default choice for anything displayed on a page on the site.
* - %variable: Escaped to HTML and formatted using String::placeholder(),
......@@ -79,12 +79,12 @@ public static function decodeEntities($text) {
* String::checkPlain() previously, or is expected to contain some limited
* HTML tags and has already been run through filter_xss() previously).
*
* @return mixed
* The formatted string, or FALSE if no args specified.
*
* @see t()
* @ingroup sanitization
*
* @return mixte
* The formatted string with placeholders inserted, or FALSE if no args specified.
* @see t()
*/
public static function format($string, array $args = array()) {
// Transform arguments before inserting them.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment