Handles the {{SHORTDESC:...}} parser function.
More...
|
| isValid ( $shortDesc) |
| Validates a short description.
|
|
| sanitize ( $shortDesc) |
| Sanitizes a short description by converting it into plaintext.
|
|
| doHandle (Parser $parser, $shortDesc, $controlArg) |
| Parser function.
|
|
|
static | handle (Parser $parser, $shortDesc, $controlArg='') |
| Parser function callback.
|
|
Handles the {{SHORTDESC:...}} parser function.
- Copyright
- GPL-2.0-or-later
◆ doHandle()
Wikibase\Client\Hooks\ShortDescHandler::doHandle |
( |
Parser | $parser, |
|
|
| $shortDesc, |
|
|
| $controlArg ) |
Parser function.
- Parameters
-
Parser | $parser | |
string | $shortDesc | Short description of the current page, as plain text. |
string | $controlArg | An extra argument to control behavior (such as 'noreplace'). |
- Returns
- void
◆ factory()
static Wikibase\Client\Hooks\ShortDescHandler::factory |
( |
| ) |
|
|
staticprivate |
◆ handle()
static Wikibase\Client\Hooks\ShortDescHandler::handle |
( |
Parser | $parser, |
|
|
| $shortDesc, |
|
|
| $controlArg = '' ) |
|
static |
Parser function callback.
- Parameters
-
Parser | $parser | |
string | $shortDesc | Short description of the current page, as plain text. |
string | $controlArg | An extra argument to control behavior (such as 'noreplace'). |
- Returns
- string
◆ isValid()
Wikibase\Client\Hooks\ShortDescHandler::isValid |
( |
| $shortDesc | ) |
|
Validates a short description.
Valid descriptions are not empty (contain something other than whitespace/punctuation).
- Parameters
-
string | $shortDesc | Short description of the current page, as plain text. |
- Returns
- bool
◆ parseNoReplace()
Wikibase\Client\Hooks\ShortDescHandler::parseNoReplace |
( |
| $parser, |
|
|
| $controlArg ) |
|
private |
- Parameters
-
Parser | $parser | |
string | $controlArg | |
- Returns
- bool
◆ sanitize()
Wikibase\Client\Hooks\ShortDescHandler::sanitize |
( |
| $shortDesc | ) |
|
Sanitizes a short description by converting it into plaintext.
Note that the sanitized description can still contain HTML (that was encoded as entities in the original) as there is no reason why someone shouldn't mention HTML tags in a description. That means the sanitized value is actually less safe for HTML inclusion than the original one (can contain <script> tags)! It is clients' responsibility to handle it safely.
- Parameters
-
string | $shortDesc | Short description of the current page, as HTML. |
- Returns
- string Plaintext of description.
The documentation for this class was generated from the following file: