1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-15 03:05:26 +02:00

Update $sanitizer->testAll() method for more methods per processwire/processwire-issues#85

This commit is contained in:
Ryan Cramer
2016-11-23 07:15:17 -05:00
parent 2a66b67174
commit 942cac2707

View File

@@ -1589,14 +1589,13 @@ class Sanitizer extends Wire {
* for text coming from user input since it doesn't allow any other HTML. But if you just * for text coming from user input since it doesn't allow any other HTML. But if you just
* want full markdown, then specify TRUE for the `$options` argument. * want full markdown, then specify TRUE for the `$options` argument.
* *
* ~~~~~
* Basic allowed markdown currently includes: * Basic allowed markdown currently includes:
* **strong** * - `**strong**`
* *emphasis* * - `*emphasis*`
* [anchor-text](url) * - `[anchor-text](url)`
* ~~strikethrough~~ * - `~~strikethrough~~`
* `code` * - code surrounded by backticks
* ~~~~~ *
* ~~~~~ * ~~~~~
* // basic markdown * // basic markdown
* echo $sanitizer->entitiesMarkdown($str); * echo $sanitizer->entitiesMarkdown($str);
@@ -2317,42 +2316,50 @@ class Sanitizer extends Wire {
*/ */
public function testAll($value) { public function testAll($value) {
$sanitizers = array( $sanitizers = array(
'alpha',
'alphanumeric',
'array',
'bool',
'date',
'digits',
'email',
'emailHeader',
'entities',
'entities1',
'entitiesMarkdown',
'fieldName',
'filename',
'float',
'int',
'intArray',
'intSigned',
'intUnsigned',
'markupToLine',
'markupToText',
'minArray',
'name', 'name',
'names', 'names',
'varName',
'fieldName',
'templateName',
'pageName', 'pageName',
'pageNameTranslate', 'pageNameTranslate',
'pageNameUTF8', 'pageNameUTF8',
'filename',
'path',
'pagePathName', 'pagePathName',
'email', 'pagePathNameUTF8',
'emailHeader', 'path',
'text', 'purify',
'textarea', 'removeNewlines',
'url',
'selectorField', 'selectorField',
'selectorValue', 'selectorValue',
'entities',
'entities1',
'unentities',
'entitiesMarkdown',
'purify',
'string', 'string',
'date', 'templateName',
'int', 'text',
'intUnsigned', 'textarea',
'intSigned', 'unentities',
'float', 'url',
'array', 'varName',
'intArray',
'bool',
); );
$results = array(); $results = array();
foreach($sanitizers as $method) { foreach($sanitizers as $method) {
$results[$method] = $this->$method($value); $results[$method] = $this->$method($value);
} }
return $results; return $results;
} }